QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
23 #include <QMessageBox>
28 , mNameOnly( nameOnly )
29 , mPropertyDefinition( def )
38 mType->setCurrentIndex( mType->findData( def.
dataType() ) );
41 mType->setEnabled(
false );
43 mType->setEnabled(
true );
63 const QString title = tr(
"New Auxiliary Field" );
64 const QString msg = tr(
"Invalid name. Auxiliary field '%1' already exists." ).arg( fieldName );
65 QMessageBox::critical(
this, title, msg, QMessageBox::Ok );
67 else if ( def.
comment().isEmpty() )
69 const QString title = tr(
"New Auxiliary Field" );
70 const QString msg = tr(
"Name is a mandatory parameter." );
71 QMessageBox::critical(
this, title, msg, QMessageBox::Ok );
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
@ DataTypeString
Property requires a string value.
@ DataTypeBoolean
Property requires a boolean value.
QgsPropertyDefinition propertyDefinition() const
Returns the underlying property definition.
@ DataTypeNumeric
Property requires a numeric value.
QgsAuxiliaryLayer * auxiliaryLayer()
Returns the current auxiliary layer.
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
DataType dataType() const
Returns the allowable field/value data type for the property.
QgsFields fields() const FINAL
Returns the list of fields of this layer.
void setComment(const QString &comment)
Sets comment of the property.
DataType
Valid data types required by property.
Definition for a property.
QgsNewAuxiliaryFieldDialog(const QgsPropertyDefinition &definition, QgsVectorLayer *layer, bool nameOnly=true, QWidget *parent=nullptr)
Constructor.
QString comment() const
Returns the comment of the property.
void setName(const QString &name)
Sets the name of the property.
static QgsGui * instance()
Returns a pointer to the singleton instance.
Represents a vector layer which manages a vector based data sets.
QgsPropertyDefinition mPropertyDefinition
static QString nameFromProperty(const QgsPropertyDefinition &def, bool joined=false)
Returns the name of the auxiliary field for a property definition.
bool addAuxiliaryField(const QgsPropertyDefinition &definition)
Adds an auxiliary field for the given property.
int lookupField(const QString &fieldName) const
Looks up field's index from the field name.
void setDataType(DataType type)
Sets the data type.
void setOrigin(const QString &origin)
Sets the origin of the property.