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 defined

New in version 3.22.

QgsExternalStorageFileWidget(parent: QWidget = None) QgsExternalStorageFileWidget creates a widget for selecting a file or a folder.

Methods

actionEvent

addFileWidgetScope

Add file widget specific scope to expression context

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

createFileWidgetScope

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

customEvent

destroy

disconnectNotify

dragEnterEvent

param event

dragLeaveEvent

dragMoveEvent

dropEvent

param event

enterEvent

event

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.

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isMultiFiles

Returns true if path is a multifiles

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

messageBar

Returns message bar used to report messages

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

relativePath

Returns a filePath with relative path options applied (or not) !

resizeEvent

sender

senderSignalIndex

setExpressionContext

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

setFilePaths

Update filePath according to filePaths list

setMessageBar

Set messageBar to report messages

setReadOnly

param readOnly

setSelectedFileNames

param fileNames

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.

sharedPainter

showEvent

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.

tabletEvent

timerEvent

toUrl

returns a HTML code with a link to the given file path

updateLayout

updateMicroFocus

wheelEvent

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: PyQt5.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

QgsExpressionContextScope

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

New in version 3.22.

Return type

QgsExpressionContext

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

setStorageType()

New in version 3.22.

Return type

QgsExternalStorage

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

QgsMessageBar

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
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

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 messages

New 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 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()

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 defined

See also

setStorageType()

New in version 3.22.

Parameters

urlExpression (str) –

sharedPainter(self) QPainter
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

setStorageType()

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.

New in version 3.22.

Return type

QgsExpression

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.

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)