Class: QgsExternalStorageFileWidget

The QgsExternalStorageFileWidget class creates a widget for selecting a file or a folder and stores it to a given external storage backend if defined

Added in version 3.22.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsExternalStorageFileWidget

Base classes

QgsFileWidget

The QgsFileWidget class creates a widget for selecting a file or a folder.

QWidget

QObject

QPaintDevice

Methods

addFileWidgetScope

Add file widget specific scope to expression context

expressionContext

Returns expression context used for storage url expression evaluation

externalStorage

Returns external storage used to store selected file names, None if none have been defined.

messageBar

Returns message bar used to report messages

setExpressionContext

Set expression context to be used when for storage URL expression evaluation

setMessageBar

Set messageBar to report messages

setStorageAuthConfigId

Sets the authentication configuration ID to be used for the current external storage (if defined)

setStorageType

Set storageType storage type unique identifier as defined in QgsExternalStorageRegistry or null QString if there is no storage defined.

setStorageUrlExpression

Set urlExpression expression, which once evaluated, provide the URL used to store selected documents.

storageAuthConfigId

Returns the authentication configuration ID used for the current external storage (if defined)

storageType

Returns storage type unique identifier as defined in QgsExternalStorageRegistry.

storageUrlExpression

Returns expression, which once evaluated, provide the URL used to store selected documents.

storageUrlExpressionString

Returns the original, unmodified expression string, which once evaluated, provide the URL used to store selected documents.

Static Methods

createFileWidgetScope

Creates and Returns an expression context scope specific to QgsExternalStorageFileWidget It defines the variable containing the user selected file name

class qgis.gui.QgsExternalStorageFileWidget[source]

Bases: QgsFileWidget

__init__(parent: QWidget | None = None)

QgsExternalStorageFileWidget creates a widget for selecting a file or a folder.

Parameters:

parent (Optional[QWidget] = None)

addFileWidgetScope(self)[source]

Add file widget specific scope to expression context

static createFileWidgetScope() QgsExpressionContextScope | None[source]

Creates and Returns an expression context scope specific to QgsExternalStorageFileWidget It defines the variable containing the user selected file name

Added in version 3.22.

Return type:

Optional[QgsExpressionContextScope]

expressionContext(self) QgsExpressionContext

Returns expression context used for storage url expression evaluation

Added in version 3.22.

Return type:

QgsExpressionContext

externalStorage(self) QgsExternalStorage | None[source]

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

setStorageType()

Added in version 3.22.

Return type:

Optional[QgsExternalStorage]

messageBar(self) QgsMessageBar | None[source]

Returns message bar used to report messages

Added in version 3.22.

Return type:

Optional[QgsMessageBar]

setExpressionContext(self, context: QgsExpressionContext)[source]

Set expression context to be used when for storage URL expression evaluation

Added in version 3.22.

Parameters:

context (QgsExpressionContext)

setMessageBar(self, messageBar: QgsMessageBar | None)[source]

Set messageBar to report messages

Added in version 3.22.

Parameters:

messageBar (Optional[QgsMessageBar])

setStorageAuthConfigId(self, authCfg: str | None)[source]

Sets the authentication configuration ID to be used for the current external storage (if defined)

Added in version 3.22.

Parameters:

authCfg (Optional[str])

setStorageType(self, storageType: str | None)[source]

Set storageType storage type unique identifier as defined in QgsExternalStorageRegistry 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

storageType()

Added in version 3.22.

Parameters:

storageType (Optional[str])

setStorageUrlExpression(self, urlExpression: str | None)[source]

Set urlExpression expression, which once evaluated, provide the URL used to store selected documents. This is used only if an external storage has been defined

See also

setStorageType()

Added in version 3.22.

Parameters:

urlExpression (Optional[str])

storageAuthConfigId(self) str

Returns the authentication configuration ID used for the current external storage (if defined)

Added in version 3.22.

Return type:

str

storageType(self) str[source]

Returns storage type unique identifier as defined in QgsExternalStorageRegistry. Returns null QString if there is no storage defined, only file selection.

See also

setStorageType()

Added in version 3.22.

Return type:

str

storageUrlExpression(self) QgsExpression | None[source]

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.

Added in version 3.22.

Return type:

Optional[QgsExpression]

storageUrlExpressionString(self) str[source]

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.

Added in version 3.22.

Return type:

str