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.

Methods

actionEvent
changeEvent
childEvent
closeEvent
connectNotify
contextMenuEvent
create
customEvent
defaultRoot Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget.RelativeDefaultPath.
destroy
disconnectNotify
documentPath documentPath returns the path of the current document in the widget
documentViewerContent returns the type of content used in the document viewer
documentViewerHeight returns the height of the document viewer
documentViewerWidth returns the width of the document viewer
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
enterEvent
event
fileWidget access the file widget to allow its configuration
fileWidgetVisible returns if the file widget is visible in the widget
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPreviousChild
hideEvent
initPainter
inputMethodEvent
isSignalConnected
keyPressEvent
keyReleaseEvent
leaveEvent
metric
mouseDoubleClickEvent
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
moveEvent
nativeEvent
paintEvent
receivers
relativeStorage Configures if paths are handled absolute or relative and if relative, which should be the base path.
resizeEvent
sender
senderSignalIndex
setDefaultRoot Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget.RelativeDefaultPath.
setDocumentPath
setDocumentViewerContent setDocumentViewerContent defines the type of content to be shown.
setDocumentViewerHeight setDocumentViewerWidth set the height of the document viewer.
setDocumentViewerWidth setDocumentViewerWidth set the width of the document viewer.
setFileWidgetVisible Sets the visiblity of the file widget in the layout
setReadOnly defines if the widget is readonly
setRelativeStorage Configures if paths are handled absolute or relative and if relative, which should be the base path.
sharedPainter
showEvent
tabletEvent
timerEvent
updateMicroFocus
wheelEvent

Signals

valueChanged emitteed as soon as the current document changes [signal]

Attributes

Image
NoContent
Web
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.

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

documentPath returns the path of the current document in the widget

Parameters:type – determines the type of the returned null variant if the document is not defined yet
documentViewerContent(self) → QgsExternalResourceWidget.DocumentViewerContent

returns the type of content used in the document viewer

documentViewerHeight(self) → int

returns the height of the document viewer

documentViewerWidth(self) → int

returns the width of the document viewer

dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
fileWidget(self) → QgsFileWidget

access the file widget to allow its configuration

fileWidgetVisible(self) → bool

returns if the file widget is visible in the widget

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.

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

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

setDocumentPath(self, documentPath: Any)
setDocumentViewerContent(self, content: QgsExternalResourceWidget.DocumentViewerContent)

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

setDocumentViewerHeight(self, height: int)

setDocumentViewerWidth set the height of the document viewer.

Parameters:height – the height. Use 0 for automatic best display.
setDocumentViewerWidth(self, width: int)

setDocumentViewerWidth set the width of the document viewer.

Parameters:width – the width. Use 0 for automatic best display.
setFileWidgetVisible(self, visible: bool)

Sets the visiblity of the file widget in the layout

setReadOnly(self, readOnly: bool)

defines if the widget is readonly

setRelativeStorage(self, relativeStorage: QgsFileWidget.RelativeStorage)

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

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

emitteed as soon as the current document changes [signal]

wheelEvent()