QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
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 , DateTime , Custom = 3000 } |
Predefined standard property templates. More... | |
Public Member Functions | |
QgsPropertyDefinition ()=default | |
Constructs an empty property. | |
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. | |
QgsPropertyDefinition (const QString &name, DataType dataType, const QString &description, const QString &helpText, const QString &origin=QString(), const QString &comment=QString()) | |
Constructor for custom QgsPropertyDefinitions. | |
QString | comment () const |
Returns the comment of the property. | |
DataType | dataType () const |
Returns the allowable field/value data type for the property. | |
QString | description () const |
Descriptive name of the property. | |
QString | helpText () const |
Helper text for using the property, including a description of the valid values for the property. | |
QString | name () const |
Returns the name of the property. | |
QString | origin () const |
Returns the origin of the property. | |
void | setComment (const QString &comment) |
Sets comment of the property. | |
void | setDataType (DataType type) |
Sets the data type. | |
void | setName (const QString &name) |
Sets the name of the property. | |
void | setOrigin (const QString &origin) |
Sets the origin of the property. | |
StandardPropertyTemplate | standardTemplate () const |
Returns the property's standard template, if applicable. | |
bool | supportsAssistant () const |
Returns true if the property is of a type which is compatible with property override assistants. | |
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 44 of file qgsproperty.h.
Valid data types required by property.
Definition at line 82 of file qgsproperty.h.
Predefined standard property templates.
Definition at line 49 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 25 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 180 of file qgsproperty.cpp.
|
inline |
Returns the comment of the property.
Definition at line 166 of file qgsproperty.h.
|
inline |
Returns the allowable field/value data type for the property.
Definition at line 186 of file qgsproperty.h.
|
inline |
Descriptive name of the property.
Definition at line 161 of file qgsproperty.h.
|
inline |
Helper text for using the property, including a description of the valid values for the property.
Definition at line 176 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 137 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 149 of file qgsproperty.h.
|
inline |
Sets comment of the property.
Definition at line 171 of file qgsproperty.h.
|
inline |
Sets the data type.
Definition at line 181 of file qgsproperty.h.
|
inline |
Sets the name of the property.
Definition at line 142 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 156 of file qgsproperty.h.
|
inline |
Returns the property's standard template, if applicable.
Non standard types will return the Custom template.
Definition at line 192 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 189 of file qgsproperty.cpp.