Class: QgsExternalStorageFileWidget¶
- class qgis.gui.QgsExternalStorageFileWidget¶
Bases:
QgsFileWidget
The
QgsExternalStorageFileWidget
class creates a widget for selecting a file or a folder and stores it to a given external storage backend if definedNew in version 3.22.
QgsExternalStorageFileWidget(parent: QWidget = None)
QgsExternalStorageFileWidget
creates a widget for selecting a file or a folder.Methods
Add file widget specific scope to expression context
Creates and Returns an expression context scope specific to QgsExternalStorageFileWidget It defines the variable containing the user selected file name
- param event
- param event
Returns expression context used for storage url expression evaluation
Returns external storage used to store selected file names, None if none have been defined.
Returns true if
path
is a multifilesReturns message bar used to report messages
Returns a filePath with relative path options applied (or not) !
Set expression context to be used when for storage URL expression evaluation
Update filePath according to
filePaths
listSet
messageBar
to report messages- param readOnly
- param fileNames
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.Set
urlExpression
expression, which once evaluated, provide the URL used to store selected documents.Returns the authentication configuration ID used for the current external storage (if defined)
Returns storage type unique identifier as defined in
QgsExternalStorageRegistry
.Returns expression, which once evaluated, provide the URL used to store selected documents.
Returns the original, unmodified expression string, which once evaluated, provide the URL used to store selected documents.
returns a HTML code with a link to the given file path
- actionEvent(self, QActionEvent)¶
- addFileWidgetScope(self)¶
Add file widget specific scope to expression context
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- createFileWidgetScope() QgsExpressionContextScope ¶
Creates and Returns an expression context scope specific to QgsExternalStorageFileWidget It defines the variable containing the user selected file name
New in version 3.22.
- Return type
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, event: QDragEnterEvent)¶
- Parameters
event (QDragEnterEvent) –
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, event: QDropEvent)¶
- Parameters
event (QDropEvent) –
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- expressionContext(self) QgsExpressionContext ¶
Returns expression context used for storage url expression evaluation
See also
New in version 3.22.
- Return type
- externalStorage(self) QgsExternalStorage ¶
Returns external storage used to store selected file names, None if none have been defined. If no external storage has been defined,
QgsExternalStorageFileWidget
will only update file path according to selected files.See also
New in version 3.22.
- Return type
- 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)¶
- isMultiFiles(path: str) bool ¶
Returns true if
path
is a multifiles
- 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], sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- relativePath(self, filePath: str, removeRelative: bool) str ¶
Returns a filePath with relative path options applied (or not) !
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setExpressionContext(self, context: QgsExpressionContext)¶
Set expression context to be used when for storage URL expression evaluation
See also
New in version 3.22.
- Parameters
context (QgsExpressionContext) –
- setFilePaths(self, filePaths: Iterable[str])¶
Update filePath according to
filePaths
list
- setMessageBar(self, messageBar: QgsMessageBar)¶
Set
messageBar
to report messagesNew in version 3.22.
- Parameters
messageBar (QgsMessageBar) –
- setReadOnly(self, readOnly: bool)¶
- Parameters
readOnly (bool) –
- setSelectedFileNames(self, fileNames: Iterable[str])¶
- Parameters
fileNames (Iterable[str]) –
- 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. If no external storage has been defined,QgsExternalStorageFileWidget
will only update file path according to selected files.See also
New in version 3.22.
- Parameters
storageType (str) –
- setStorageUrlExpression(self, urlExpression: str)¶
Set
urlExpression
expression, which once evaluated, provide the URL used to store selected documents. This is used only if an external storage has been definedSee also
New in version 3.22.
- Parameters
urlExpression (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
- storageUrlExpression(self) QgsExpression ¶
Returns expression, which once evaluated, provide the URL used to store selected documents. This is used only if an external storage has been defined. Returns null if no expression has been set.
See also
New in version 3.22.
- Return type
- storageUrlExpressionString(self) str ¶
Returns the original, unmodified expression string, which once evaluated, provide the URL used to store selected documents. This is used only if an external storage has been defined. Returns null if no expression has been set.
See also
New in version 3.22.
- Return type
str
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- toUrl(self, path: str) str ¶
returns a HTML code with a link to the given file path
- updateLayout(self)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶