Class: QgsExternalResourceWidget¶
- class qgis.gui.QgsExternalResourceWidget¶
Bases:
PyQt5.QtWidgets.QWidget
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.
QgsExternalResourceWidget(parent: QWidget = None)
QgsExternalResourceWidget
creates a widget with a file widget and a document viewer Both part of the widget are optional.See also
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
Returns file widget to allow its configuration
returns if the file widget is visible in the widget
Returns message bar used to report messages
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.- param documentPath:
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 visibility of the file widget in the layout
Set
messageBar
to report messagesdefines if the widget is readonly
Configures if paths are handled absolute or relative and if relative, which should be the base path.
Sets the authentication configuration ID to be used for the current external storage (if defined)
Set
storageType
storage type unique identifier as defined inQgsExternalStorageRegistry
or null QString if there is no storage defined, only file selection.Returns the authentication configuration ID used for the current external storage (if defined)
Returns storage type unique identifier as defined in
QgsExternalStorageRegistry
.Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
Attributes
- Audio = 3¶
- class DocumentViewerContent¶
Bases:
int
- Image = 1¶
- NoContent = 0¶
- Video = 4¶
- Web = 2¶
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, QEvent)¶
- defaultRoot(self) str ¶
Configures the base path which should be used if the relativeStorage property is set to
QgsFileWidget
.RelativeDefaultPath.- Return type:
str
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- 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:
- 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(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- fileWidget(self) QgsExternalStorageFileWidget ¶
Returns file widget to allow its configuration
- Return type:
- fileWidgetVisible(self) bool ¶
returns if the file widget is visible in the widget
- Return type:
bool
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- messageBar(self) QgsMessageBar ¶
Returns message bar used to report messages
New in version 3.22.
- Return type:
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- relativeStorage(self) QgsFileWidget.RelativeStorage ¶
Configures if paths are handled absolute or relative and if relative, which should be the base path.
- Return type:
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- 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 visibility of the file widget in the layout
- Parameters:
visible (bool) –
- setMessageBar(self, messageBar: QgsMessageBar)¶
Set
messageBar
to report messagesNew in version 3.22.
- Parameters:
messageBar (QgsMessageBar) –
- 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) –
- setStorageAuthConfigId(self, authCfg: str)¶
Sets the authentication configuration ID to be used for the current external storage (if defined)
New in version 3.22.
- Parameters:
authCfg (str) –
- setStorageType(self, storageType: str)¶
Set
storageType
storage type unique identifier as defined inQgsExternalStorageRegistry
or null QString if there is no storage defined, only file selection.See also
New in version 3.22.
- Parameters:
storageType (str) –
- showEvent(self, QShowEvent)¶
- storageAuthConfigId(self) str ¶
Returns the authentication configuration ID used for the current external storage (if defined)
New in version 3.22.
- Return type:
str
- storageType(self) str ¶
Returns storage type unique identifier as defined in
QgsExternalStorageRegistry
. Returns null QString if there is no storage defined, only file selection.See also
New in version 3.22.
- Return type:
str
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- valueChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- wheelEvent(self, QWheelEvent)¶