QgsAbstractFileContentSourceLineEdit class

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.

Derived classes

class QgsImageSourceLineEdit
A line edit widget with toolbutton for setting a raster image path.
class QgsSvgSourceLineEdit
A line edit widget with toolbutton for setting an SVG image path.

Constructors, destructors, conversion operators

QgsAbstractFileContentSourceLineEdit(QWidget* parent = nullptr)
Constructor for QgsAbstractFileContentSourceLineEdit, with the specified parent widget.

Public functions

auto messageBar() const -> QgsMessageBar*
Returns the message bar associated with the widget.
void setLastPathSettingsKey(const QString& key)
Sets a specific settings key to use when storing the last used path for the file source.
void setMessageBar(QgsMessageBar* bar)
Sets the message bar associated with the widget.
auto source() const -> QString
Returns the current file source.

Signals

void sourceChanged(const QString& source)
Emitted whenever the file source is changed in the widget.

Public slots

void setSource(const QString& source)
Sets a new source to show in the widget.

Function documentation

QgsMessageBar* QgsAbstractFileContentSourceLineEdit::messageBar() const

Returns the message bar associated with the widget.

void QgsAbstractFileContentSourceLineEdit::setMessageBar(QgsMessageBar* bar)

Sets the message bar associated with the widget.

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

QString QgsAbstractFileContentSourceLineEdit::source() const

Returns the current file source.

void QgsAbstractFileContentSourceLineEdit::setSource(const QString& source) public slot

Sets a new source to show in the widget.