15#ifndef QGSFIELDDOMAINWIDGET_H
16#define QGSFIELDDOMAINWIDGET_H
18#include "ui_qgscodedvaluedomainwidgetbase.h"
19#include "ui_qgsfielddomainwidgetbase.h"
20#include "ui_qgsglobdomainwidgetbase.h"
21#include "ui_qgsrangedomainwidgetbase.h"
28#include <QAbstractTableModel>
31class QDialogButtonBox;
150 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
151 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
152 QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
153 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
154 Qt::ItemFlags
flags(
const QModelIndex &index )
const override;
155 QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
156 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
157 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
171 QList<QgsCodedValue>
values()
const {
return mValues; }
174 QList<QgsCodedValue> mValues;
325 void validityChanged(
bool isValid );
329 QDialogButtonBox *mButtonBox =
nullptr;
FieldDomainType
Types of field domain.
Abstract base class for widgets which configure the extended properties of a QgsFieldDomain subclass.
void changed()
Emitted whenever the field domain configuration in the widget changes.
~QgsAbstractFieldDomainWidget() override
virtual bool isValid() const =0
Returns true if the widget currently represents a valid field domain configuration.
QgsAbstractFieldDomainWidget(QWidget *parent=nullptr)
Constructor for QgsAbstractFieldDomainWidget, with the specified parent widget.
virtual QgsFieldDomain * createFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType) const =0
Creates a new field domain using the properties from the widget.
virtual void setFieldDomain(const QgsFieldDomain *domain)=0
Sets the current field domain to show properties for in the widget.
QgsFieldDomain * createFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType) const override
Creates a new field domain using the properties from the widget.
void setFieldDomain(const QgsFieldDomain *domain) override
Sets the current field domain to show properties for in the widget.
QgsCodedFieldDomainWidget(QWidget *parent=nullptr)
Constructor for QgsCodedFieldDomainWidget, with the specified parent widget.
bool isValid() const override
Returns true if the widget currently represents a valid field domain configuration.
A table model for representing the values in a QgsCodedValue list.
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QgsCodedValueTableModel(QObject *parent)
Constructor for QgsCodedValueTableModel, with the specified parent object.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
Qt::ItemFlags flags(const QModelIndex &index) const override
void setValues(const QList< QgsCodedValue > &values)
Sets the values to show in the model.
QList< QgsCodedValue > values() const
Returns the values from the model.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
void setFieldDomain(const QgsFieldDomain *domain)
Sets the current field domain to show properties for in the dialog.
void setNameEditable(bool editable)
Sets if name of the field domain is editable.
QgsFieldDomainDialog(Qgis::FieldDomainType type, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags())
Constructor for QgsFieldDomainDialog for the given domain type, with the specified parent widget and ...
std::unique_ptr< QgsFieldDomain > createFieldDomain() const
Creates a new field domain using the properties from the dialog.
void setPoliciesEditable(bool editable)
Sets if merge and split policies are editable.
A widget for configuration of the properties of a QgsFieldDomain.
QgsFieldDomainWidget(Qgis::FieldDomainType type, QWidget *parent=nullptr)
Constructor for QgsFieldDomainWidget for the given domain type, with the specified parent widget.
void setPoliciesEditable(bool editable)
Sets if merge and split policies are editable.
void setNameEditable(bool editable)
Sets if name of the field domain is editable.
void setFieldDomain(const QgsFieldDomain *domain)
Sets the current field domain to show properties for in the widget.
std::unique_ptr< QgsFieldDomain > createFieldDomain() const
Creates a new field domain using the properties from the widget.
bool isValid() const
Returns true if the widget currently represents a valid field domain configuration.
void validityChanged(bool isValid)
Emitted whenever the validity of the field domain configuration in the widget changes.
Base class for field domains.
QgsGlobDomainWidget(QWidget *parent=nullptr)
Constructor for QgsGlobDomainWidget, with the specified parent widget.
void setFieldDomain(const QgsFieldDomain *domain) override
Sets the current field domain to show properties for in the widget.
QgsFieldDomain * createFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType) const override
Creates a new field domain using the properties from the widget.
bool isValid() const override
Returns true if the widget currently represents a valid field domain configuration.
void setFieldDomain(const QgsFieldDomain *domain) override
Sets the current field domain to show properties for in the widget.
bool isValid() const override
Returns true if the widget currently represents a valid field domain configuration.
QgsRangeDomainWidget(QWidget *parent=nullptr)
Constructor for QgsRangeDomainWidget, with the specified parent widget.
QgsFieldDomain * createFieldDomain(const QString &name, const QString &description, QMetaType::Type fieldType) const override
Creates a new field domain using the properties from the widget.