Class: QgsExternalResourceWidget

class qgis.gui.QgsExternalResourceWidget(parent: QWidget = None)

Bases: PyQt5.QtWidgets.QWidget

QgsExternalResourceWidget creates a widget with a file widget and a document viewer Both part of the widget are optional.

See also

QgsFileWidget

Widget to display file path with a push button for an “open file” dialog It can also be used to display a picture or a web page.

Parameters

parent

class DocumentViewerContent

Bases: int

Image = 1
NoContent = 0
Web = 2
actionEvent()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
defaultRoot(self) → str

Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget.RelativeDefaultPath.

Return type

str

destroy()
disconnectNotify()
documentPath(self, type: QVariant.Type = QVariant.String) → Any

documentPath returns the path of the current document in the widget

Parameters

type (QVariant.Type = QVariant.String) – determines the type of the returned null variant if the document is not defined yet

Return type

Any

documentViewerContent(self) → QgsExternalResourceWidget.DocumentViewerContent

returns the type of content used in the document viewer

Return type

QgsExternalResourceWidget.DocumentViewerContent

documentViewerHeight(self) → int

returns the height of the document viewer

Return type

int

documentViewerWidth(self) → int

returns the width of the document viewer

Return type

int

dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
eventFilter(self, watched: QObject, event: QEvent) → bool
Parameters
  • watched (QObject) –

  • event (QEvent) –

Return type

bool

fileWidget(self) → QgsFileWidget

access the file widget to allow its configuration

Return type

QgsFileWidget

fileWidgetVisible(self) → bool

returns if the file widget is visible in the widget

Return type

bool

focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
relativeStorage(self) → QgsFileWidget.RelativeStorage

Configures if paths are handled absolute or relative and if relative, which should be the base path.

Return type

QgsFileWidget.RelativeStorage

resizeEvent()
sender()
senderSignalIndex()
setDefaultRoot(self, defaultRoot: str)

Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget.RelativeDefaultPath.

Parameters

defaultRoot (str) –

setDocumentPath(self, documentPath: Any)
Parameters

documentPath (Any) –

setDocumentViewerContent(self, content: QgsExternalResourceWidget.DocumentViewerContent)

setDocumentViewerContent defines the type of content to be shown. Widget will be adapted accordingly

Parameters

content (QgsExternalResourceWidget.DocumentViewerContent) –

setDocumentViewerHeight(self, height: int)

setDocumentViewerWidth set the height of the document viewer.

Parameters

height (int) – the height. Use 0 for automatic best display.

setDocumentViewerWidth(self, width: int)

setDocumentViewerWidth set the width of the document viewer.

Parameters

width (int) – the width. Use 0 for automatic best display.

setFileWidgetVisible(self, visible: bool)

Sets the visiblity of the file widget in the layout

Parameters

visible (bool) –

setReadOnly(self, readOnly: bool)

defines if the widget is readonly

Parameters

readOnly (bool) –

setRelativeStorage(self, relativeStorage: QgsFileWidget.RelativeStorage)

Configures if paths are handled absolute or relative and if relative, which should be the base path.

Parameters

relativeStorage (QgsFileWidget.RelativeStorage) –

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
valueChanged

emitteed as soon as the current document changes [signal]

wheelEvent()