QGIS API Documentation
3.0.2-Girona (307d082)
|
Definition for a property. More...
#include <qgsproperty.h>
Public Types | |
enum | DataType { DataTypeString = 0, DataTypeNumeric, DataTypeBoolean } |
Valid data types required by property. More... | |
enum | StandardPropertyTemplate { Boolean = 0, Integer, IntegerPositive, IntegerPositiveGreaterZero, Double, DoublePositive, Double0To1, Rotation, String, Opacity, RenderUnits, ColorWithAlpha, ColorNoAlpha, PenJoinStyle, BlendMode, Point, Size, Size2D, LineStyle, StrokeWidth, FillStyle, CapStyle, HorizontalAnchor, VerticalAnchor, SvgPath, Offset, Custom = 3000 } |
Predefined standard property templates. More... | |
Public Member Functions | |
QgsPropertyDefinition ()=default | |
Constructs an empty property. More... | |
QgsPropertyDefinition (const QString &name, const QString &description, StandardPropertyTemplate type, const QString &origin=QString(), const QString &comment=QString()) | |
Constructor for QgsPropertyDefinition, using a standard property template. More... | |
QgsPropertyDefinition (const QString &name, DataType dataType, const QString &description, const QString &helpText, const QString &origin=QString(), const QString &comment=QString()) | |
Constructor for custom QgsPropertyDefinitions. More... | |
QString | comment () const |
Returns the comment of the property. More... | |
DataType | dataType () const |
Returns the allowable field/value data type for the property. More... | |
QString | description () const |
Descriptive name of the property. More... | |
QString | helpText () const |
Helper text for using the property, including a description of the valid values for the property. More... | |
QString | name () const |
Returns the name of the property. More... | |
QString | origin () const |
Returns the origin of the property. More... | |
void | setComment (const QString &comment) |
Sets comment of the property. More... | |
void | setDataType (DataType type) |
Sets the data type. More... | |
void | setName (const QString &name) |
Sets the name of the property. More... | |
void | setOrigin (const QString &origin) |
Sets the origin of the property. More... | |
StandardPropertyTemplate | standardTemplate () const |
Returns the property's standard template, if applicable. More... | |
bool | supportsAssistant () const |
Returns true if the property is of a type which is compatible with property override assistants. More... | |
Definition for a property.
QgsPropertyDefinition defines the type of values allowed for a property, and handles descriptive names and help text for using the property. Definitions can use one of the predefined standard templates to simplify definition of commonly used property types, such as colors and blend modes.
Definition at line 46 of file qgsproperty.h.
Valid data types required by property.
Definition at line 83 of file qgsproperty.h.
Predefined standard property templates.
Definition at line 51 of file qgsproperty.h.
|
default |
Constructs an empty property.
QgsPropertyDefinition::QgsPropertyDefinition | ( | const QString & | name, |
const QString & | description, | ||
QgsPropertyDefinition::StandardPropertyTemplate | type, | ||
const QString & | origin = QString() , |
||
const QString & | comment = QString() |
||
) |
Constructor for QgsPropertyDefinition, using a standard property template.
name | is used internally and should be a unique, alphanumeric string. |
description | can be any localised string describing what the property is used for. |
type | one of the predefined standard property template |
origin | The origin of the property |
comment | A free comment for the property |
Definition at line 24 of file qgsproperty.cpp.
QgsPropertyDefinition::QgsPropertyDefinition | ( | const QString & | name, |
DataType | dataType, | ||
const QString & | description, | ||
const QString & | helpText, | ||
const QString & | origin = QString() , |
||
const QString & | comment = QString() |
||
) |
Constructor for custom QgsPropertyDefinitions.
name | is used internally and should be a unique, alphanumeric string. |
dataType | the data type for the property |
description | can be any localised string describing what the property is used for. |
helpText | parameter should specify a descriptive string for users outlining the types of value acceptable by the property (eg 'dashed' or 'solid' for a line style property). |
origin | The origin of the property |
comment | A free comment for the property |
Definition at line 174 of file qgsproperty.cpp.
|
inline |
Returns the comment of the property.
Definition at line 167 of file qgsproperty.h.
|
inline |
Returns the allowable field/value data type for the property.
Definition at line 187 of file qgsproperty.h.
|
inline |
Descriptive name of the property.
Definition at line 162 of file qgsproperty.h.
|
inline |
Helper text for using the property, including a description of the valid values for the property.
Definition at line 177 of file qgsproperty.h.
|
inline |
Returns the name of the property.
This is used internally and should be a unique, alphanumeric string.
Definition at line 138 of file qgsproperty.h.
|
inline |
Returns the origin of the property.
For example, a PAL property has an origin set to "labeling" while a diagram property has an origin set to "diagram".
Definition at line 150 of file qgsproperty.h.
|
inline |
Sets comment of the property.
Definition at line 172 of file qgsproperty.h.
|
inline |
Sets the data type.
Definition at line 182 of file qgsproperty.h.
|
inline |
Sets the name of the property.
Definition at line 143 of file qgsproperty.h.
|
inline |
Sets the origin of the property.
For example, a PAL property has an origin set to "labeling" while a diagram property has an origin set to "diagram".
Definition at line 157 of file qgsproperty.h.
|
inline |
Returns the property's standard template, if applicable.
Non standard types will return the Custom template.
Definition at line 193 of file qgsproperty.h.
bool QgsPropertyDefinition::supportsAssistant | ( | ) | const |
Returns true if the property is of a type which is compatible with property override assistants.
Definition at line 183 of file qgsproperty.cpp.