Skip to content

Commit fa8189a

Browse files
committedFeb 5, 2017
Tweak property definitions for size type properties
1 parent 2c65a66 commit fa8189a

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed
 

‎python/core/qgsproperty.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class QgsPropertyDefinition
2323
BlendMode,
2424
Point,
2525
Size,
26+
Size2D,
2627
LineStyle,
2728
FillStyle,
2829
CapStyle,

‎src/core/qgspallabeling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void QgsPalLayerSettings::initPropertyDefinitions()
145145
{ QgsPalLayerSettings::ShapeRotation, QgsPropertyDefinition( "ShapeRotation", QObject::tr( "Shape rotation" ), QgsPropertyDefinition::Double ) },
146146
{ QgsPalLayerSettings::ShapeOffset, QgsPropertyDefinition( "ShapeOffset", QObject::tr( "Shape offset" ), QgsPropertyDefinition::Offset ) },
147147
{ QgsPalLayerSettings::ShapeOffsetUnits, QgsPropertyDefinition( "ShapeOffsetUnits", QObject::tr( "Shape offset units" ), QgsPropertyDefinition::RenderUnits ) },
148-
{ QgsPalLayerSettings::ShapeRadii, QgsPropertyDefinition( "ShapeRadii", QObject::tr( "Shape radii" ), QgsPropertyDefinition::Size ) },
148+
{ QgsPalLayerSettings::ShapeRadii, QgsPropertyDefinition( "ShapeRadii", QObject::tr( "Shape radii" ), QgsPropertyDefinition::Size2D ) },
149149
{ QgsPalLayerSettings::ShapeRadiiUnits, QgsPropertyDefinition( "ShapeRadiiUnits", QObject::tr( "Symbol radii units" ), QgsPropertyDefinition::RenderUnits ) },
150150
{ QgsPalLayerSettings::ShapeTransparency, QgsPropertyDefinition( "ShapeTransparency", QObject::tr( "Shape transparency" ), QgsPropertyDefinition::Transparency ) },
151151
{ QgsPalLayerSettings::ShapeBlendMode, QgsPropertyDefinition( "ShapeBlendMode", QObject::tr( "Shape blend mode" ), QgsPropertyDefinition::BlendMode ) },

‎src/core/qgsproperty.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ QgsPropertyDefinition::QgsPropertyDefinition( const QString& name, const QString
112112
break;
113113

114114
case Size:
115+
mTypes = DataTypeNumeric;
116+
mHelpText = QObject::tr( "double [>= 0.0]" );
117+
break;
118+
119+
case Size2D:
115120
mTypes = DataTypeString;
116121
mHelpText = QObject::tr( "double size [<b>width,height</b>]" );
117122
break;

‎src/core/qgsproperty.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class CORE_EXPORT QgsPropertyDefinition
6464
PenJoinStyle, //!< Pen join style
6565
BlendMode, //!< Blend mode
6666
Point, //!< 2D point
67-
Size, //!< 2D size
67+
Size, //!< 1D size (eg marker radius, or square marker height/width)
68+
Size2D, //!< 2D size (width/height different)
6869
LineStyle, //!< Line style (eg solid/dashed)
6970
FillStyle, //!< Fill style (eg solid, lines)
7071
CapStyle, //!< Line cap style (eg round)

‎src/core/symbology-ng/qgssymbollayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ void QgsSymbolLayer::initPropertyDefinitions()
4040

4141
PROPERTY_DEFINITIONS = QgsPropertiesDefinition
4242
{
43-
{ QgsSymbolLayer::PropertySize, QgsPropertyDefinition( "size", QObject::tr( "Symbol size" ), QgsPropertyDefinition::DoublePositive ) },
43+
{ QgsSymbolLayer::PropertySize, QgsPropertyDefinition( "size", QObject::tr( "Symbol size" ), QgsPropertyDefinition::Size ) },
4444
{ QgsSymbolLayer::PropertyAngle, QgsPropertyDefinition( "angle", QObject::tr( "Rotation angle" ), QgsPropertyDefinition::Double ) },
4545
{ QgsSymbolLayer::PropertyName, QgsPropertyDefinition( "name", QObject::tr( "Symbol name" ), QgsPropertyDefinition::String ) },
4646
{ QgsSymbolLayer::PropertyFillColor, QgsPropertyDefinition( "fillColor", QObject::tr( "Symbol fill color" ), QgsPropertyDefinition::ColorWithAlpha ) },
4747
{ QgsSymbolLayer::PropertyOutlineColor, QgsPropertyDefinition( "outlineColor", QObject::tr( "Symbol outline color" ), QgsPropertyDefinition::ColorWithAlpha ) },
4848
{ QgsSymbolLayer::PropertyOutlineWidth, QgsPropertyDefinition( "outlineWidth", QObject::tr( "Symbol outline width" ), QgsPropertyDefinition::DoublePositive ) },
4949
{ QgsSymbolLayer::PropertyOutlineStyle, QgsPropertyDefinition( "outlineStyle", QObject::tr( "Symbol outline style" ), QgsPropertyDefinition::LineStyle )},
50-
{ QgsSymbolLayer::PropertyOffset, QgsPropertyDefinition( "offset", QObject::tr( "Symbol offset" ), QgsPropertyDefinition::Size )},
50+
{ QgsSymbolLayer::PropertyOffset, QgsPropertyDefinition( "offset", QObject::tr( "Symbol offset" ), QgsPropertyDefinition::Offset )},
5151
{ QgsSymbolLayer::PropertyCharacter, QgsPropertyDefinition( "char", QObject::tr( "Marker character(s)" ), QgsPropertyDefinition::String )},
5252
{ QgsSymbolLayer::PropertyWidth, QgsPropertyDefinition( "width", QObject::tr( "Symbol width" ), QgsPropertyDefinition::DoublePositive )},
5353
{ QgsSymbolLayer::PropertyHeight, QgsPropertyDefinition( "height", QObject::tr( "Symbol height" ), QgsPropertyDefinition::DoublePositive )},

0 commit comments

Comments
 (0)
Please sign in to comment.