Class: QgsAbstractFileContentSourceLineEdit

Abstract base class for a widgets which allows users to select content from a file, embedding a file, etc.

This class is designed to be used by content which is managed by a QgsAbstractContentCache, i.e. it can handle either direct file paths, base64 encoded contents, or remote HTTP urls.

Added in version 3.6.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsAbstractFileContentSourceLineEdit

Base classes

QWidget

QObject

QPaintDevice

Subclasses

QgsPictureSourceLineEditBase

A line edit widget with toolbutton for setting a raster image path.

Methods

messageBar

Returns the message bar associated with the widget.

propertyOverrideToolButton

Returns the property override tool button

setLastPathSettingsKey

Sets a specific settings key to use when storing the last used path for the file source.

setMessageBar

Sets the message bar associated with the widget.

setPropertyOverrideToolButtonVisible

Sets the visibility of the property override tool button

setSource

Sets a new source to show in the widget.

source

Returns the current file source.

Signals

sourceChanged

Emitted whenever the file source is changed in the widget.

class qgis.gui.QgsAbstractFileContentSourceLineEdit[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsAbstractFileContentSourceLineEdit, with the specified parent widget.

Parameters:

parent (Optional[QWidget] = None)

messageBar(self) QgsMessageBar | None[source]

Returns the message bar associated with the widget.

See also

setMessageBar()

Return type:

Optional[QgsMessageBar]

propertyOverrideToolButton(self) QgsPropertyOverrideButton | None[source]

Returns the property override tool button

Added in version 3.16.

Return type:

Optional[QgsPropertyOverrideButton]

setLastPathSettingsKey(self, key: str | None)[source]

Sets a specific settings key to use when storing the last used path for the file source.

Parameters:

key (Optional[str])

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

Sets the message bar associated with the widget. This allows the widget to push feedback messages to the appropriate message bar.

See also

messageBar()

Parameters:

bar (Optional[QgsMessageBar])

setPropertyOverrideToolButtonVisible(self, visible: bool)[source]

Sets the visibility of the property override tool button

Added in version 3.16.

Parameters:

visible (bool)

setSource(self, source: str | None)[source]

Sets a new source to show in the widget.

See also

source()

See also

sourceChanged()

Parameters:

source (Optional[str])

source(self) str[source]

Returns the current file source.

See also

setSource()

See also

sourceChanged()

Return type:

str

signal sourceChanged(source: str)[source]

Emitted whenever the file source is changed in the widget.

Parameters:

source (str)