Skip to content
Permalink
Browse files

Tweak property definitions for size type properties

  • Loading branch information
nyalldawson committed Feb 5, 2017
1 parent 2c65a66 commit fa8189a53c395589ae886c0513adb74409a535df
@@ -23,6 +23,7 @@ class QgsPropertyDefinition
BlendMode,
Point,
Size,
Size2D,
LineStyle,
FillStyle,
CapStyle,
@@ -145,7 +145,7 @@ void QgsPalLayerSettings::initPropertyDefinitions()
{ QgsPalLayerSettings::ShapeRotation, QgsPropertyDefinition( "ShapeRotation", QObject::tr( "Shape rotation" ), QgsPropertyDefinition::Double ) },
{ QgsPalLayerSettings::ShapeOffset, QgsPropertyDefinition( "ShapeOffset", QObject::tr( "Shape offset" ), QgsPropertyDefinition::Offset ) },
{ QgsPalLayerSettings::ShapeOffsetUnits, QgsPropertyDefinition( "ShapeOffsetUnits", QObject::tr( "Shape offset units" ), QgsPropertyDefinition::RenderUnits ) },
{ QgsPalLayerSettings::ShapeRadii, QgsPropertyDefinition( "ShapeRadii", QObject::tr( "Shape radii" ), QgsPropertyDefinition::Size ) },
{ QgsPalLayerSettings::ShapeRadii, QgsPropertyDefinition( "ShapeRadii", QObject::tr( "Shape radii" ), QgsPropertyDefinition::Size2D ) },
{ QgsPalLayerSettings::ShapeRadiiUnits, QgsPropertyDefinition( "ShapeRadiiUnits", QObject::tr( "Symbol radii units" ), QgsPropertyDefinition::RenderUnits ) },
{ QgsPalLayerSettings::ShapeTransparency, QgsPropertyDefinition( "ShapeTransparency", QObject::tr( "Shape transparency" ), QgsPropertyDefinition::Transparency ) },
{ QgsPalLayerSettings::ShapeBlendMode, QgsPropertyDefinition( "ShapeBlendMode", QObject::tr( "Shape blend mode" ), QgsPropertyDefinition::BlendMode ) },
@@ -112,6 +112,11 @@ QgsPropertyDefinition::QgsPropertyDefinition( const QString& name, const QString
break;

case Size:
mTypes = DataTypeNumeric;
mHelpText = QObject::tr( "double [>= 0.0]" );
break;

case Size2D:
mTypes = DataTypeString;
mHelpText = QObject::tr( "double size [<b>width,height</b>]" );
break;
@@ -64,7 +64,8 @@ class CORE_EXPORT QgsPropertyDefinition
PenJoinStyle, //!< Pen join style
BlendMode, //!< Blend mode
Point, //!< 2D point
Size, //!< 2D size
Size, //!< 1D size (eg marker radius, or square marker height/width)
Size2D, //!< 2D size (width/height different)
LineStyle, //!< Line style (eg solid/dashed)
FillStyle, //!< Fill style (eg solid, lines)
CapStyle, //!< Line cap style (eg round)
@@ -40,14 +40,14 @@ void QgsSymbolLayer::initPropertyDefinitions()

PROPERTY_DEFINITIONS = QgsPropertiesDefinition
{
{ QgsSymbolLayer::PropertySize, QgsPropertyDefinition( "size", QObject::tr( "Symbol size" ), QgsPropertyDefinition::DoublePositive ) },
{ QgsSymbolLayer::PropertySize, QgsPropertyDefinition( "size", QObject::tr( "Symbol size" ), QgsPropertyDefinition::Size ) },
{ QgsSymbolLayer::PropertyAngle, QgsPropertyDefinition( "angle", QObject::tr( "Rotation angle" ), QgsPropertyDefinition::Double ) },
{ QgsSymbolLayer::PropertyName, QgsPropertyDefinition( "name", QObject::tr( "Symbol name" ), QgsPropertyDefinition::String ) },
{ QgsSymbolLayer::PropertyFillColor, QgsPropertyDefinition( "fillColor", QObject::tr( "Symbol fill color" ), QgsPropertyDefinition::ColorWithAlpha ) },
{ QgsSymbolLayer::PropertyOutlineColor, QgsPropertyDefinition( "outlineColor", QObject::tr( "Symbol outline color" ), QgsPropertyDefinition::ColorWithAlpha ) },
{ QgsSymbolLayer::PropertyOutlineWidth, QgsPropertyDefinition( "outlineWidth", QObject::tr( "Symbol outline width" ), QgsPropertyDefinition::DoublePositive ) },
{ QgsSymbolLayer::PropertyOutlineStyle, QgsPropertyDefinition( "outlineStyle", QObject::tr( "Symbol outline style" ), QgsPropertyDefinition::LineStyle )},
{ QgsSymbolLayer::PropertyOffset, QgsPropertyDefinition( "offset", QObject::tr( "Symbol offset" ), QgsPropertyDefinition::Size )},
{ QgsSymbolLayer::PropertyOffset, QgsPropertyDefinition( "offset", QObject::tr( "Symbol offset" ), QgsPropertyDefinition::Offset )},
{ QgsSymbolLayer::PropertyCharacter, QgsPropertyDefinition( "char", QObject::tr( "Marker character(s)" ), QgsPropertyDefinition::String )},
{ QgsSymbolLayer::PropertyWidth, QgsPropertyDefinition( "width", QObject::tr( "Symbol width" ), QgsPropertyDefinition::DoublePositive )},
{ QgsSymbolLayer::PropertyHeight, QgsPropertyDefinition( "height", QObject::tr( "Symbol height" ), QgsPropertyDefinition::DoublePositive )},

0 comments on commit fa8189a

Please sign in to comment.
You can’t perform that action at this time.