18 #include "qgis_core.h" 28 #include <QStringList> 29 #include <QDomElement> 30 #include <QDomDocument> 133 QgsPropertyDefinition(
const QString &name,
DataType dataType,
const QString &description,
const QString &helpText,
const QString &origin = QString(),
const QString &comment = QString() );
138 QString
name()
const {
return mName; }
143 void setName(
const QString &name ) { mName = name; }
150 QString
origin()
const {
return mOrigin; }
157 void setOrigin(
const QString &origin ) { mOrigin = origin; }
172 void setComment(
const QString &comment ) { mComment = comment; }
199 bool supportsAssistant()
const;
204 QString mDescription;
211 static QString trString();
252 static QgsProperty fromExpression(
const QString &expression,
bool isActive =
true );
257 static QgsProperty fromField(
const QString &fieldName,
bool isActive =
true );
262 static QgsProperty fromValue(
const QVariant &value,
bool isActive =
true );
272 operator bool()
const;
280 Type propertyType()
const;
286 bool isActive()
const;
292 void setActive(
bool active );
299 void setStaticValue(
const QVariant &value );
306 QVariant staticValue()
const;
313 void setField(
const QString &field );
320 QString field()
const;
327 void setExpressionString(
const QString &expression );
334 QString expressionString()
const;
340 QString asExpression()
const;
369 QVariant value(
const QgsExpressionContext &context,
const QVariant &defaultValue = QVariant(),
bool *ok
SIP_OUT =
nullptr )
const;
383 QString valueAsString(
const QgsExpressionContext &context,
const QString &defaultString = QString(),
bool *ok
SIP_OUT =
nullptr )
const;
397 QColor valueAsColor(
const QgsExpressionContext &context,
const QColor &defaultColor = QColor(),
bool *ok
SIP_OUT =
nullptr )
const;
447 QVariant toVariant()
const;
455 bool loadVariant(
const QVariant &property );
477 bool convertToTransformer();
480 operator QVariant()
const 482 return QVariant::fromValue( *
this );
487 mutable QExplicitlySharedDataPointer<QgsPropertyPrivate> d;
493 QVariant propertyValue(
const QgsExpressionContext &context,
const QVariant &defaultValue = QVariant(),
bool *ok =
nullptr )
const;
499 #endif // QGSPROPERTY_H
Render units (eg mm/pixels/map units)
QString helpText() const
Helper text for using the property, including a description of the valid values for the property...
Field based property (QgsFieldBasedProperty)
Positive integer values (including 0)
1D size (eg marker radius, or square marker height/width)
Expression based property (QgsExpressionBasedProperty)
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Non-zero positive integer values.
DataType dataType() const
Returns the allowable field/value data type for the property.
Color with alpha channel.
Positive double value (including 0)
void setName(const QString &name)
Sets the name of the property.
Q_DECLARE_METATYPE(QModelIndex)
Rotation (value between 0-360 degrees)
Integer value (including negative values)
QString name() const
Returns the name of the property.
Property requires a boolean value.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Property requires a numeric value.
A store for object properties.
Fill style (eg solid, lines)
Double value (including negative values)
QString origin() const
Returns the origin of the property.
void setDataType(DataType type)
Sets the data type.
Definition for a property.
DataType
Valid data types required by property.
QString description() const
Descriptive name of the property.
void setOrigin(const QString &origin)
Sets the origin of the property.
Line style (eg solid/dashed)
void setComment(const QString &comment)
Sets comment of the property.
StandardPropertyTemplate standardTemplate() const
Returns the property's standard template, if applicable.
StandardPropertyTemplate
Predefined standard property templates.
QString comment() const
Returns the comment of the property.
Line cap style (eg round)
Invalid (not set) property.
2D size (width/height different)
Color with no alpha channel.
Double value between 0-1 (inclusive)