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
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.
Enums
Methods
Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget.RelativeDefaultPath.
documentPath returns the path of the current document in the widget
returns the type of content used in the document viewer
returns the height of the document viewer
returns the width of the document viewer
access the file widget to allow its configuration
returns if the file widget is visible in the widget
Configures if paths are handled absolute or relative and if relative, which should be the base path.
Configures the base path which should be used if the relativeStorage property is set to QgsFileWidget.RelativeDefaultPath.
setDocumentViewerContent defines the type of content to be shown.
setDocumentViewerWidth set the height of the document viewer.
setDocumentViewerWidth set the width of the document viewer.
Sets the visiblity of the file widget in the layout
defines if the widget is readonly
Configures if paths are handled absolute or relative and if relative, which should be the base path.
Signals
emitteed as soon as the current document changes [signal]
Attributes
-
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.
-
showEvent
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
valueChanged
¶ emitteed as soon as the current document changes [signal]
-
wheelEvent
()¶
-
class