Skip to content

Class QfExpressionVariableModel

ClassList > QfExpressionVariableModel

Inherits the following classes: QStandardItemModel

Public Types

Type Name
enum Roles
enum VariableScope

Public Properties

Type Name
property QgsProject * currentProject

Public Signals

Type Name
signal void currentProjectChanged

Public Functions

Type Name
QfExpressionVariableModel (QObject * parent=nullptr)
Q_INVOKABLE int addVariable (VariableScope scope, const QString & name, const QString & value)
QgsProject * currentProject () const
Q_INVOKABLE void reloadVariables ()
Q_INVOKABLE void removeVariable (VariableScope scope, const QString & name)
QHash< int, QByteArray > roleNames () override const
Q_INVOKABLE void save ()
void setCurrentProject (QgsProject * project)
bool setData (const QModelIndex & index, const QVariant & value, int role) override

Public Types Documentation

enum Roles

enum QfExpressionVariableModel::Roles {
    VariableEditableRole = Qt::EditRole,
    VariableNameRole = Qt::UserRole,
    VariableValueRole = Qt::UserRole + 1,
    VariableScopeRole = Qt::UserRole + 2,
    VariableOriginalNameRole = Qt::UserRole + 3
};

enum VariableScope

enum QfExpressionVariableModel::VariableScope {
    GlobalScope,
    ProjectScope
};

Public Properties Documentation

property currentProject [1/2]

QgsProject * QfExpressionVariableModel::currentProject;

Public Signals Documentation

signal currentProjectChanged

void QfExpressionVariableModel::currentProjectChanged;

Public Functions Documentation

function QfExpressionVariableModel

explicit QfExpressionVariableModel::QfExpressionVariableModel (
    QObject * parent=nullptr
) 

function addVariable

Q_INVOKABLE int QfExpressionVariableModel::addVariable (
    VariableScope scope,
    const QString & name,
    const QString & value
) 

function currentProject [2/2]

QgsProject * QfExpressionVariableModel::currentProject () const

Returns the current project used to retrieve variables from.


function reloadVariables

Q_INVOKABLE void QfExpressionVariableModel::reloadVariables () 

function removeVariable

Q_INVOKABLE void QfExpressionVariableModel::removeVariable (
    VariableScope scope,
    const QString & name
) 

function roleNames

QHash< int, QByteArray > QfExpressionVariableModel::roleNames () override const

function save

Q_INVOKABLE void QfExpressionVariableModel::save () 

function setCurrentProject

void QfExpressionVariableModel::setCurrentProject (
    QgsProject * project
) 

Sets the project used to retrieve variables from.


function setData

bool QfExpressionVariableModel::setData (
    const QModelIndex & index,
    const QVariant & value,
    int role
) override


The documentation for this class was generated from the following file src/gui/qfexpressionvariablemodel.h