Skip to content

Commit 0c08088

Browse files
committedMar 31, 2013
data defined properties for ellipse symbol layer
1 parent 83af61b commit 0c08088

File tree

5 files changed

+543
-567
lines changed

5 files changed

+543
-567
lines changed
 

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

Lines changed: 272 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* *
1414
***************************************************************************/
1515
#include "qgsellipsesymbollayerv2.h"
16+
#include "qgsexpression.h"
1617
#include "qgsfeature.h"
1718
#include "qgsrendercontext.h"
1819
#include "qgsvectorlayer.h"
@@ -24,7 +25,9 @@
2425
#include <QDomElement>
2526

2627
QgsEllipseSymbolLayerV2::QgsEllipseSymbolLayerV2(): mSymbolName( "circle" ), mSymbolWidth( 4 ), mSymbolWidthUnit( QgsSymbolV2::MM ), mSymbolHeight( 3 ),
27-
mSymbolHeightUnit( QgsSymbolV2::MM ), mFillColor( Qt::black ), mOutlineColor( Qt::white ), mOutlineWidth( 0 ), mOutlineWidthUnit( QgsSymbolV2::MM )
28+
mSymbolHeightUnit( QgsSymbolV2::MM ), mFillColor( Qt::white ), mOutlineColor( Qt::black ), mOutlineWidth( 0 ), mOutlineWidthUnit( QgsSymbolV2::MM ),
29+
mWidthExpression( 0 ), mHeightExpression( 0 ), mRotationExpression( 0 ), mOutlineWidthExpression( 0 ), mFillColorExpression( 0 ),
30+
mOutlineColorExpression( 0 ), mSymbolNameExpression( 0 )
2831
{
2932
mPen.setColor( mOutlineColor );
3033
mPen.setWidth( 1.0 );
@@ -91,63 +94,95 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::create( const QgsStringMap& propertie
9194
}
9295

9396
//data defined properties
94-
if ( properties.contains( "height_field" ) )
97+
if ( properties.contains( "width_expression" ) )
9598
{
96-
layer->setHeightField( properties["height_field"] );
99+
layer->setDataDefinedProperty( "width", properties["width_expression"] );
97100
}
98-
if ( properties.contains( "width_field" ) )
101+
if ( properties.contains( "height_expression" ) )
99102
{
100-
layer->setWidthField( properties["width_field"] );
103+
layer->setDataDefinedProperty( "height", properties["height_expression"] );
101104
}
102-
if ( properties.contains( "rotation_field" ) )
105+
if ( properties.contains( "rotation_expression" ) )
103106
{
104-
layer->setRotationField( properties["rotation_field"] );
107+
layer->setDataDefinedProperty( "rotation", properties["rotation_expression"] );
105108
}
106-
if ( properties.contains( "outline_width_field" ) )
109+
if ( properties.contains( "outline_width_expression" ) )
107110
{
108-
layer->setOutlineWidthField( properties["outline_width_field"] );
111+
layer->setDataDefinedProperty( "outline_width", properties[ "outline_width_expression" ] );
109112
}
110-
if ( properties.contains( "fill_color_field" ) )
113+
if ( properties.contains( "fill_color_expression" ) )
111114
{
112-
layer->setFillColorField( properties["fill_color_field"] );
115+
layer->setDataDefinedProperty( "fill_color", properties["fill_color_expression"] );
113116
}
114-
if ( properties.contains( "outline_color_field" ) )
117+
if ( properties.contains( "outline_color_expression" ) )
115118
{
116-
layer->setOutlineColorField( properties["outline_color_field"] );
119+
layer->setDataDefinedProperty( "outline_color", properties["outline_color_expression"] );
117120
}
118-
if ( properties.contains( "symbol_name_field" ) )
121+
if ( properties.contains( "symbol_name_expression" ) )
119122
{
120-
layer->setSymbolNameField( properties["symbol_name_field"] );
123+
layer->setDataDefinedProperty( "symbol_name", properties["symbol_name_expression"] );
124+
}
125+
126+
//compatibility with old project file format
127+
if ( !properties["width_field"].isEmpty() )
128+
{
129+
layer->setDataDefinedProperty( "width", properties["width_field"] );
130+
}
131+
if ( !properties["height_field"].isEmpty() )
132+
{
133+
layer->setDataDefinedProperty( "height", properties["height_field"] );
134+
}
135+
if ( !properties["rotation_field"].isEmpty() )
136+
{
137+
layer->setDataDefinedProperty( "rotation", properties["rotation_field"] );
138+
}
139+
if ( !properties["outline_width_field"].isEmpty() )
140+
{
141+
layer->setDataDefinedProperty( "outline_width", properties[ "outline_width_field" ] );
142+
}
143+
if ( !properties["fill_color_field"].isEmpty() )
144+
{
145+
layer->setDataDefinedProperty( "fill_color", properties["fill_color_field"] );
146+
}
147+
if ( !properties["outline_color_field"].isEmpty() )
148+
{
149+
layer->setDataDefinedProperty( "outline_color", properties["outline_color_field"] );
150+
}
151+
if ( !properties["symbol_name_field"].isEmpty() )
152+
{
153+
layer->setDataDefinedProperty( "symbol_name", properties["symbol_name_field"] );
121154
}
122155

123156
return layer;
124157
}
125158

126159
void QgsEllipseSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context )
127160
{
128-
const QgsFeature* f = context.feature();
129161

130-
if ( f )
162+
if ( mOutlineWidthExpression )
131163
{
132-
if ( mOutlineWidthIndex != -1 )
133-
{
134-
double width = f->attribute( mOutlineWidthIndex ).toDouble() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOutlineWidthUnit );
135-
mPen.setWidthF( width );
136-
}
137-
if ( mFillColorIndex != -1 )
138-
{
139-
mBrush.setColor( QColor( f->attribute( mFillColorIndex ).toString() ) );
140-
}
141-
if ( mOutlineColorIndex != -1 )
142-
{
143-
mPen.setColor( QColor( f->attribute( mOutlineColorIndex ).toString() ) );
144-
}
145-
146-
if ( mWidthIndex != -1 || mHeightIndex != -1 || mSymbolNameIndex != -1 )
164+
double width = mOutlineWidthExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toDouble();
165+
width *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOutlineWidthUnit );
166+
mPen.setWidthF( width );
167+
}
168+
if ( mFillColorExpression )
169+
{
170+
QString colorString = mFillColorExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toString();
171+
mBrush.setColor( QColor( colorString ) );
172+
}
173+
if ( mOutlineColorExpression )
174+
{
175+
QString colorString = mOutlineColorExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toString();
176+
mPen.setColor( QColor( colorString ) );
177+
}
178+
if ( mWidthExpression || mHeightExpression || mSymbolNameExpression )
179+
{
180+
QString symbolName = mSymbolName;
181+
if ( mSymbolNameExpression )
147182
{
148-
QString symbolName = ( mSymbolNameIndex == -1 ) ? mSymbolName : f->attribute( mSymbolNameIndex ).toString();
149-
preparePath( symbolName, context, f );
183+
symbolName = mSymbolNameExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toString();
150184
}
185+
preparePath( symbolName, context, context.feature() );
151186
}
152187

153188
QPainter* p = context.renderContext().painter();
@@ -158,9 +193,9 @@ void QgsEllipseSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Rend
158193

159194
//priority for rotation: 1. data defined symbol level, 2. symbol layer rotation (mAngle)
160195
double rotation = 0.0;
161-
if ( f && mRotationIndex != -1 )
196+
if ( mRotationExpression )
162197
{
163-
rotation = f->attribute( mRotationIndex ).toDouble();
198+
rotation = mRotationExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toDouble();
164199
}
165200
else if ( !doubleNear( mAngle, 0.0 ) )
166201
{
@@ -193,19 +228,7 @@ void QgsEllipseSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
193228
mPen.setColor( mOutlineColor );
194229
mPen.setWidthF( mOutlineWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOutlineWidthUnit ) );
195230
mBrush.setColor( mFillColor );
196-
197-
//resolve data defined attribute indices
198-
const QgsVectorLayer* vlayer = context.layer();
199-
if ( vlayer )
200-
{
201-
mWidthIndex = vlayer->fieldNameIndex( mWidthField );
202-
mHeightIndex = vlayer->fieldNameIndex( mHeightField );
203-
mRotationIndex = vlayer->fieldNameIndex( mRotationField );
204-
mOutlineWidthIndex = vlayer->fieldNameIndex( mOutlineWidthField );
205-
mFillColorIndex = vlayer->fieldNameIndex( mFillColorField );
206-
mOutlineColorIndex = vlayer->fieldNameIndex( mOutlineColorField );
207-
mSymbolNameIndex = vlayer->fieldNameIndex( mSymbolNameField );
208-
}
231+
prepareExpressions( context.layer() );
209232
}
210233

211234
void QgsEllipseSymbolLayerV2::stopRender( QgsSymbolV2RenderContext & )
@@ -346,13 +369,67 @@ QgsStringMap QgsEllipseSymbolLayerV2::properties() const
346369
map["outline_color"] = QgsSymbolLayerV2Utils::encodeColor( mOutlineColor );
347370
map["outline_color_field"] = mOutlineColorField;
348371
map["symbol_name_field"] = mSymbolNameField;
372+
373+
//data defined properties
374+
if ( mWidthExpression )
375+
{
376+
map["width_expression"] = mWidthExpression->dump();
377+
}
378+
if ( mHeightExpression )
379+
{
380+
map["height_expression"] = mHeightExpression->dump();
381+
}
382+
if ( mRotationExpression )
383+
{
384+
map["rotation_expression"] = mRotationExpression->dump();
385+
}
386+
if ( mOutlineWidthExpression )
387+
{
388+
map["outline_width_expression"] = mOutlineWidthExpression->dump();
389+
}
390+
if ( mFillColorExpression )
391+
{
392+
map["fill_color_expression"] = mFillColorExpression->dump();
393+
}
394+
if ( mOutlineColorExpression )
395+
{
396+
map["outline_color_expression"] = mOutlineColorExpression->dump();
397+
}
398+
if ( mSymbolNameExpression )
399+
{
400+
map["symbol_name_expression"] = mSymbolNameExpression->dump();
401+
}
349402
return map;
350403
}
351404

352405
bool QgsEllipseSymbolLayerV2::hasDataDefinedProperty() const
353406
{
354-
return ( mWidthIndex != -1 || mHeightIndex != -1 || mOutlineWidthIndex != -1
355-
|| mFillColorIndex != -1 || mOutlineColorIndex != -1 );
407+
return ( mWidthExpression || mHeightExpression || mRotationExpression || mOutlineWidthExpression ||
408+
mFillColorExpression || mOutlineColorExpression || mSymbolNameExpression );
409+
}
410+
411+
void QgsEllipseSymbolLayerV2::prepareExpressions( const QgsVectorLayer* vl )
412+
{
413+
if ( !vl )
414+
{
415+
return;
416+
}
417+
418+
const QgsFields& fields = vl->pendingFields();
419+
if ( mWidthExpression )
420+
mWidthExpression->prepare( fields );
421+
if ( mHeightExpression )
422+
mHeightExpression->prepare( fields );
423+
if ( mRotationExpression )
424+
mRotationExpression->prepare( fields );
425+
if ( mOutlineWidthExpression )
426+
mOutlineWidthExpression->prepare( fields );
427+
if ( mFillColorExpression )
428+
mFillColorExpression->prepare( fields );
429+
if ( mOutlineColorExpression )
430+
mOutlineColorExpression->prepare( fields );
431+
if ( mSymbolNameExpression )
432+
mSymbolNameExpression->prepare( fields );
356433
}
357434

358435
void QgsEllipseSymbolLayerV2::preparePath( const QString& symbolName, QgsSymbolV2RenderContext& context, const QgsFeature* f )
@@ -362,32 +439,34 @@ void QgsEllipseSymbolLayerV2::preparePath( const QString& symbolName, QgsSymbolV
362439

363440
double width = 0;
364441

365-
if ( f && mWidthIndex != -1 ) //1. priority: data defined setting on symbol layer level
442+
if ( mWidthExpression ) //1. priority: data defined setting on symbol layer level
366443
{
367-
width = f->attribute( mWidthIndex ).toDouble() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ct, mSymbolWidthUnit );
444+
width = mWidthExpression->evaluate( const_cast<QgsFeature*>( f ) ).toDouble();
368445
}
369446
else if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale ) //2. priority: is data defined size on symbol level
370447
{
371-
width = mSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ct, mSymbolWidthUnit );
448+
width = mSize;
372449
}
373450
else //3. priority: global width setting
374451
{
375-
width = mSymbolWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ct, mSymbolWidthUnit );
452+
width = mSymbolWidth;
376453
}
454+
width *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( ct, mSymbolWidthUnit );
377455

378456
double height = 0;
379-
if ( f && mHeightIndex != -1 ) //1. priority: data defined setting on symbol layer level
457+
if ( mHeightExpression ) //1. priority: data defined setting on symbol layer level
380458
{
381-
height = f->attribute( mHeightIndex ).toDouble() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ct, mSymbolHeightUnit );
459+
height = mHeightExpression->evaluate( const_cast<QgsFeature*>( f ) ).toDouble();
382460
}
383461
else if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale ) //2. priority: is data defined size on symbol level
384462
{
385-
height = mSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ct, mSymbolHeightUnit );
463+
height = mSize;
386464
}
387465
else //3. priority: global height setting
388466
{
389-
height = mSymbolHeight * QgsSymbolLayerV2Utils::lineWidthScaleFactor( ct, mSymbolHeightUnit );
467+
height = mSymbolHeight;
390468
}
469+
height *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( ct, mSymbolHeightUnit );
391470

392471
if ( symbolName == "circle" )
393472
{
@@ -415,51 +494,160 @@ void QgsEllipseSymbolLayerV2::preparePath( const QString& symbolName, QgsSymbolV
415494

416495
QSet<QString> QgsEllipseSymbolLayerV2::usedAttributes() const
417496
{
418-
QSet<QString> dataDefinedAttributes;
419-
if ( !mWidthField.isEmpty() )
497+
QSet<QString> attributes;
498+
499+
//add data defined attributes
500+
QStringList columns;
501+
if ( mWidthExpression )
502+
columns.append( mWidthExpression->referencedColumns() );
503+
if ( mHeightExpression )
504+
columns.append( mHeightExpression->referencedColumns() );
505+
if ( mRotationExpression )
506+
columns.append( mRotationExpression->referencedColumns() );
507+
if ( mOutlineWidthExpression )
508+
columns.append( mOutlineWidthExpression->referencedColumns() );
509+
if ( mFillColorExpression )
510+
columns.append( mFillColorExpression->referencedColumns() );
511+
if ( mOutlineColorExpression )
512+
columns.append( mOutlineColorExpression->referencedColumns() );
513+
if ( mSymbolNameExpression )
514+
columns.append( mSymbolNameExpression->referencedColumns() );
515+
516+
QStringList::const_iterator it = columns.constBegin();
517+
for ( ; it != columns.constEnd(); ++it )
518+
{
519+
attributes.insert( *it );
520+
}
521+
return attributes;
522+
}
523+
524+
void QgsEllipseSymbolLayerV2::setOutputUnit( QgsSymbolV2::OutputUnit unit )
525+
{
526+
mSymbolWidthUnit = unit;
527+
mSymbolHeightUnit = unit;
528+
mOutlineWidthUnit = unit;
529+
}
530+
531+
QgsSymbolV2::OutputUnit QgsEllipseSymbolLayerV2::outputUnit() const
532+
{
533+
QgsSymbolV2::OutputUnit unit = mSymbolWidthUnit;
534+
if ( mSymbolHeightUnit != unit || mOutlineWidthUnit != unit )
420535
{
421-
dataDefinedAttributes.insert( mWidthField );
536+
return QgsSymbolV2::Mixed;
422537
}
423-
if ( !mHeightField.isEmpty() )
538+
return unit;
539+
}
540+
541+
const QgsExpression* QgsEllipseSymbolLayerV2::dataDefinedProperty( const QString& property ) const
542+
{
543+
if ( property == "width" )
424544
{
425-
dataDefinedAttributes.insert( mHeightField );
545+
return mWidthExpression;
426546
}
427-
if ( !mRotationField.isEmpty() )
547+
else if ( property == "height" )
428548
{
429-
dataDefinedAttributes.insert( mRotationField );
549+
return mHeightExpression;
430550
}
431-
if ( !mOutlineWidthField.isEmpty() )
551+
else if ( property == "rotation" )
432552
{
433-
dataDefinedAttributes.insert( mOutlineWidthField );
553+
return mRotationExpression;
434554
}
435-
if ( !mFillColorField.isEmpty() )
555+
else if ( property == "outline_width" )
436556
{
437-
dataDefinedAttributes.insert( mFillColorField );
557+
return mOutlineWidthExpression;
438558
}
439-
if ( !mOutlineColorField.isEmpty() )
559+
else if ( property == "fill_color" )
440560
{
441-
dataDefinedAttributes.insert( mOutlineColorField );
561+
return mFillColorExpression;
442562
}
443-
if ( !mSymbolNameField.isEmpty() )
563+
else if ( property == "outline_color" )
444564
{
445-
dataDefinedAttributes.insert( mSymbolNameField );
565+
return mOutlineColorExpression;
446566
}
447-
return dataDefinedAttributes;
567+
else if ( property == "symbol_name" )
568+
{
569+
return mSymbolNameExpression;
570+
}
571+
return 0;
448572
}
449573

450-
void QgsEllipseSymbolLayerV2::setOutputUnit( QgsSymbolV2::OutputUnit unit )
574+
QString QgsEllipseSymbolLayerV2::dataDefinedPropertyString( const QString& property ) const
451575
{
452-
mSymbolWidthUnit = unit;
453-
mSymbolHeightUnit = unit;
454-
mOutlineWidthUnit = unit;
576+
const QgsExpression* ex = dataDefinedProperty( property );
577+
return ( ex ? ex->dump() : QString() );
455578
}
456579

457-
QgsSymbolV2::OutputUnit QgsEllipseSymbolLayerV2::outputUnit() const
580+
void QgsEllipseSymbolLayerV2::setDataDefinedProperty( const QString& property, const QString& expressionString )
458581
{
459-
QgsSymbolV2::OutputUnit unit = mSymbolWidthUnit;
460-
if ( mSymbolHeightUnit != unit || mOutlineWidthUnit != unit )
582+
if ( property == "width" )
461583
{
462-
return QgsSymbolV2::Mixed;
584+
delete mWidthExpression; mWidthExpression = new QgsExpression( expressionString );
463585
}
464-
return unit;
586+
else if ( property == "height" )
587+
{
588+
delete mHeightExpression; mHeightExpression = new QgsExpression( expressionString );
589+
}
590+
else if ( property == "rotation" )
591+
{
592+
delete mRotationExpression; mRotationExpression = new QgsExpression( expressionString );
593+
}
594+
else if ( property == "outline_width" )
595+
{
596+
delete mOutlineWidthExpression; mOutlineWidthExpression = new QgsExpression( expressionString );
597+
}
598+
else if ( property == "fill_color" )
599+
{
600+
delete mFillColorExpression; mFillColorExpression = new QgsExpression( expressionString );
601+
}
602+
else if ( property == "outline_color" )
603+
{
604+
delete mOutlineColorExpression; mOutlineColorExpression = new QgsExpression( expressionString );
605+
}
606+
else if ( property == "symbol_name" )
607+
{
608+
delete mSymbolNameExpression; mSymbolNameExpression = new QgsExpression( expressionString );
609+
}
610+
}
611+
612+
void QgsEllipseSymbolLayerV2::removeDataDefinedProperty( const QString& property )
613+
{
614+
if ( property == "width" )
615+
{
616+
delete mWidthExpression; mWidthExpression = 0;
617+
}
618+
else if ( property == "height" )
619+
{
620+
delete mHeightExpression; mHeightExpression = 0;
621+
}
622+
else if ( property == "rotation" )
623+
{
624+
delete mRotationExpression; mRotationExpression = 0;
625+
}
626+
else if ( property == "outline_width" )
627+
{
628+
delete mOutlineWidthExpression; mOutlineWidthExpression = 0;
629+
}
630+
else if ( property == "fill_color" )
631+
{
632+
delete mFillColorExpression; mFillColorExpression = 0;
633+
}
634+
else if ( property == "outline_color" )
635+
{
636+
delete mOutlineColorExpression; mOutlineColorExpression = 0;
637+
}
638+
else if ( property == "symbol_name" )
639+
{
640+
delete mSymbolNameExpression; mSymbolNameExpression = 0;
641+
}
642+
}
643+
644+
void QgsEllipseSymbolLayerV2::removeDataDefinedProperties()
645+
{
646+
delete mWidthExpression; mWidthExpression = 0;
647+
delete mHeightExpression; mHeightExpression = 0;
648+
delete mRotationExpression; mRotationExpression = 0;
649+
delete mOutlineWidthExpression; mOutlineWidthExpression = 0;
650+
delete mFillColorExpression; mFillColorExpression = 0;
651+
delete mOutlineColorExpression; mOutlineColorExpression = 0;
652+
delete mSymbolNameExpression; mSymbolNameExpression = 0;
465653
}

‎src/core/symbology-ng/qgsellipsesymbollayerv2.h

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "qgsmarkersymbollayerv2.h"
1919
#include <QPainterPath>
2020

21+
class QgsExpression;
22+
2123
/**A symbol layer for rendering objects with major and minor axis (e.g. ellipse, rectangle )*/
2224
class CORE_EXPORT QgsEllipseSymbolLayerV2: public QgsMarkerSymbolLayerV2
2325
{
@@ -91,6 +93,12 @@ class CORE_EXPORT QgsEllipseSymbolLayerV2: public QgsMarkerSymbolLayerV2
9193
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
9294
QgsSymbolV2::OutputUnit outputUnit() const;
9395

96+
const QgsExpression* dataDefinedProperty( const QString& property ) const;
97+
QString dataDefinedPropertyString( const QString& property ) const;
98+
void setDataDefinedProperty( const QString& property, const QString& expressionString );
99+
void removeDataDefinedProperty( const QString& property );
100+
void removeDataDefinedProperties();
101+
94102
private:
95103
QString mSymbolName;
96104
double mSymbolWidth;
@@ -102,23 +110,6 @@ class CORE_EXPORT QgsEllipseSymbolLayerV2: public QgsMarkerSymbolLayerV2
102110
double mOutlineWidth;
103111
QgsSymbolV2::OutputUnit mOutlineWidthUnit;
104112

105-
#if 0
106-
/**Take width from attribute (-1 if fixed width)*/
107-
QPair<int, QString> mWidthField;
108-
/**Take height from attribute (-1 if fixed height)*/
109-
QPair<int, QString> mHeightField;
110-
/**Take symbol rotation from attribute (-1 if fixed rotation)*/
111-
QPair<int, QString> mRotationField;
112-
/**Take outline width from attribute (-1 if fixed outline width)*/
113-
QPair<int, QString> mOutlineWidthField;
114-
/**Take fill color from attribute (-1 if fixed fill color)*/
115-
QPair<int, QString> mFillColorField;
116-
/**Take outline color from attribute (-1 if fixed outline color)*/
117-
QPair<int, QString> mOutlineColorField;
118-
/**Take shape name from attribute (-1 if fixed shape type)*/
119-
QPair<int, QString> mSymbolNameField;
120-
#endif //0
121-
122113
//data defined property fields
123114
QString mWidthField;
124115
QString mHeightField;
@@ -128,6 +119,14 @@ class CORE_EXPORT QgsEllipseSymbolLayerV2: public QgsMarkerSymbolLayerV2
128119
QString mOutlineColorField;
129120
QString mSymbolNameField;
130121

122+
QgsExpression* mWidthExpression;
123+
QgsExpression* mHeightExpression;
124+
QgsExpression* mRotationExpression;
125+
QgsExpression* mOutlineWidthExpression;
126+
QgsExpression* mFillColorExpression;
127+
QgsExpression* mOutlineColorExpression;
128+
QgsExpression* mSymbolNameExpression;
129+
131130
//field indices for data defined properties
132131
//resolved in startRender method
133132
int mWidthIndex;
@@ -151,6 +150,8 @@ class CORE_EXPORT QgsEllipseSymbolLayerV2: public QgsMarkerSymbolLayerV2
151150

152151
/**True if this symbol layer uses a data defined property*/
153152
bool hasDataDefinedProperty() const;
153+
154+
void prepareExpressions( const QgsVectorLayer* vl );
154155
};
155156

156157
#endif // QGSELLIPSESYMBOLLAYERV2_H

‎src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp

Lines changed: 36 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* *
1414
***************************************************************************/
1515
#include "qgsellipsesymbollayerv2widget.h"
16+
#include "qgsdatadefinedsymboldialog.h"
1617
#include "qgsellipsesymbollayerv2.h"
1718
#include "qgsmaplayerregistry.h"
1819
#include "qgsvectorlayer.h"
@@ -42,7 +43,6 @@ QgsEllipseSymbolLayerV2Widget::QgsEllipseSymbolLayerV2Widget( const QgsVectorLay
4243
}
4344

4445
blockComboSignals( true );
45-
fillDataDefinedComboBoxes();
4646
blockComboSignals( false );
4747
}
4848

@@ -75,63 +75,6 @@ void QgsEllipseSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
7575
mSymbolWidthUnitComboBox->setCurrentIndex( mLayer->symbolWidthUnit() );
7676
mOutlineWidthUnitComboBox->setCurrentIndex( mLayer->outlineWidthUnit() );
7777
mSymbolHeightUnitComboBox->setCurrentIndex( mLayer->symbolHeightUnit() );
78-
79-
if ( mLayer->widthField().isEmpty() )
80-
{
81-
mDDSymbolWidthComboBox->setCurrentIndex( 0 );
82-
}
83-
else
84-
{
85-
mDDSymbolWidthComboBox->setCurrentIndex( mDDSymbolWidthComboBox->findText( mLayer->widthField() ) );
86-
}
87-
if ( mLayer->heightField().isEmpty() )
88-
{
89-
mDDSymbolHeightComboBox->setCurrentIndex( 0 );
90-
}
91-
else
92-
{
93-
mDDSymbolHeightComboBox->setCurrentIndex( mDDSymbolHeightComboBox->findText( mLayer->heightField() ) );
94-
}
95-
if ( mLayer->rotationField().isEmpty() )
96-
{
97-
mDDRotationComboBox->setCurrentIndex( 0 );
98-
}
99-
else
100-
{
101-
mDDRotationComboBox->setCurrentIndex( mDDRotationComboBox->findText( mLayer->rotationField() ) );
102-
}
103-
if ( mLayer->outlineWidthField().isEmpty() )
104-
{
105-
mDDOutlineWidthComboBox->setCurrentIndex( 0 );
106-
}
107-
else
108-
{
109-
mDDOutlineWidthComboBox->setCurrentIndex( mDDOutlineWidthComboBox->findText( mLayer->outlineWidthField() ) );
110-
}
111-
if ( mLayer->fillColorField().isEmpty() )
112-
{
113-
mDDFillColorComboBox->setCurrentIndex( 0 );
114-
}
115-
else
116-
{
117-
mDDFillColorComboBox->setCurrentIndex( mDDFillColorComboBox->findText( mLayer->fillColorField() ) );
118-
}
119-
if ( mLayer->outlineColorField().isEmpty() )
120-
{
121-
mDDOutlineColorComboBox->setCurrentIndex( 0 );
122-
}
123-
else
124-
{
125-
mDDOutlineColorComboBox->setCurrentIndex( mDDOutlineColorComboBox->findText( mLayer->outlineColorField() ) );
126-
}
127-
if ( mLayer->symbolNameField().isEmpty() )
128-
{
129-
mDDShapeComboBox->setCurrentIndex( 0 );
130-
}
131-
else
132-
{
133-
mDDShapeComboBox->setCurrentIndex( mDDShapeComboBox->findText( mLayer->symbolNameField() ) );
134-
}
13578
}
13679
blockComboSignals( false );
13780
}
@@ -218,103 +161,6 @@ void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_clicked()
218161
}
219162
}
220163

221-
void QgsEllipseSymbolLayerV2Widget::fillDataDefinedComboBoxes()
222-
{
223-
mDDSymbolWidthComboBox->clear();
224-
mDDSymbolWidthComboBox->addItem( "", -1 );
225-
mDDSymbolHeightComboBox->clear();
226-
mDDSymbolHeightComboBox->addItem( "", -1 );
227-
mDDRotationComboBox->clear();
228-
mDDRotationComboBox->addItem( "", -1 );
229-
mDDOutlineWidthComboBox->clear();
230-
mDDOutlineWidthComboBox->addItem( "", -1 );
231-
mDDFillColorComboBox->clear();
232-
mDDFillColorComboBox->addItem( "", -1 );
233-
mDDOutlineColorComboBox->clear();
234-
mDDOutlineColorComboBox->addItem( "", -1 );
235-
mDDShapeComboBox->clear();
236-
mDDShapeComboBox->addItem( "", -1 );
237-
238-
if ( mVectorLayer )
239-
{
240-
const QgsFields& fm = mVectorLayer->pendingFields();
241-
for ( int index = 0; index < fm.count(); ++index )
242-
{
243-
QString fieldName = fm[index].name();
244-
245-
mDDSymbolWidthComboBox->addItem( fieldName, index );
246-
mDDSymbolHeightComboBox->addItem( fieldName, index );
247-
mDDRotationComboBox->addItem( fieldName, index );
248-
mDDOutlineWidthComboBox->addItem( fieldName, index );
249-
mDDFillColorComboBox->addItem( fieldName, index );
250-
mDDOutlineColorComboBox->addItem( fieldName, index );
251-
mDDShapeComboBox->addItem( fieldName, index );
252-
}
253-
}
254-
}
255-
256-
void QgsEllipseSymbolLayerV2Widget::on_mDDSymbolWidthComboBox_currentIndexChanged( int idx )
257-
{
258-
if ( mLayer )
259-
{
260-
mLayer->setWidthField( mDDSymbolWidthComboBox->itemText( idx ) );
261-
emit changed();
262-
}
263-
}
264-
265-
void QgsEllipseSymbolLayerV2Widget::on_mDDSymbolHeightComboBox_currentIndexChanged( int idx )
266-
{
267-
if ( mLayer )
268-
{
269-
mLayer->setHeightField( mDDSymbolHeightComboBox->itemText( idx ) );
270-
emit changed();
271-
}
272-
}
273-
274-
void QgsEllipseSymbolLayerV2Widget::on_mDDRotationComboBox_currentIndexChanged( int idx )
275-
{
276-
if ( mLayer )
277-
{
278-
mLayer->setRotationField( mDDRotationComboBox->itemText( idx ) );
279-
emit changed();
280-
}
281-
}
282-
283-
void QgsEllipseSymbolLayerV2Widget::on_mDDOutlineWidthComboBox_currentIndexChanged( int idx )
284-
{
285-
if ( mLayer )
286-
{
287-
mLayer->setOutlineWidthField( mDDOutlineWidthComboBox->itemText( idx ) );
288-
emit changed();
289-
}
290-
}
291-
292-
void QgsEllipseSymbolLayerV2Widget::on_mDDFillColorComboBox_currentIndexChanged( int idx )
293-
{
294-
if ( mLayer )
295-
{
296-
mLayer->setFillColorField( mDDFillColorComboBox->itemText( idx ) );
297-
emit changed();
298-
}
299-
}
300-
301-
void QgsEllipseSymbolLayerV2Widget::on_mDDOutlineColorComboBox_currentIndexChanged( int idx )
302-
{
303-
if ( mLayer )
304-
{
305-
mLayer->setOutlineColorField( mDDOutlineColorComboBox->itemText( idx ) );
306-
emit changed();
307-
}
308-
}
309-
310-
void QgsEllipseSymbolLayerV2Widget::on_mDDShapeComboBox_currentIndexChanged( int idx )
311-
{
312-
if ( mLayer )
313-
{
314-
mLayer->setSymbolNameField( mDDShapeComboBox->itemText( idx ) );
315-
}
316-
}
317-
318164
void QgsEllipseSymbolLayerV2Widget::on_mSymbolWidthUnitComboBox_currentIndexChanged( int index )
319165
{
320166
if ( mLayer )
@@ -341,14 +187,42 @@ void QgsEllipseSymbolLayerV2Widget::on_mSymbolHeightUnitComboBox_currentIndexCha
341187

342188
void QgsEllipseSymbolLayerV2Widget::blockComboSignals( bool block )
343189
{
344-
mDDSymbolWidthComboBox->blockSignals( block );
345-
mDDSymbolHeightComboBox->blockSignals( block );
346-
mDDRotationComboBox->blockSignals( block );
347-
mDDOutlineWidthComboBox->blockSignals( block );
348-
mDDFillColorComboBox->blockSignals( block );
349-
mDDOutlineColorComboBox->blockSignals( block );
350-
mDDShapeComboBox->blockSignals( block );
351190
mSymbolWidthUnitComboBox->blockSignals( block );
352191
mOutlineWidthUnitComboBox->blockSignals( block );
353192
mSymbolHeightUnitComboBox->blockSignals( block );
354193
}
194+
195+
void QgsEllipseSymbolLayerV2Widget::on_mDataDefinedPropertiesButton_clicked()
196+
{
197+
if ( !mLayer )
198+
{
199+
return;
200+
}
201+
202+
QMap<QString, QPair< QString, QString> > dataDefinedProperties;
203+
dataDefinedProperties.insert( "width", qMakePair( tr( "Symbol width" ), mLayer->dataDefinedPropertyString( "width" ) ) );
204+
dataDefinedProperties.insert( "height", qMakePair( tr( "Symbol height" ), mLayer->dataDefinedPropertyString( "height" ) ) );
205+
dataDefinedProperties.insert( "rotation", qMakePair( tr( "Rotation" ), mLayer->dataDefinedPropertyString( "rotation" ) ) );
206+
dataDefinedProperties.insert( "outline_width", qMakePair( tr( "Outline width" ), mLayer->dataDefinedPropertyString( "outline_width" ) ) );
207+
dataDefinedProperties.insert( "fill_color", qMakePair( tr( "Fill color" ), mLayer->dataDefinedPropertyString( "fill_color" ) ) );
208+
dataDefinedProperties.insert( "outline_color", qMakePair( tr( "Border color" ), mLayer->dataDefinedPropertyString( "outline_color" ) ) );
209+
dataDefinedProperties.insert( "symbol_name", qMakePair( tr( "Symbol name" ), mLayer->dataDefinedPropertyString( "symbol_name" ) ) );
210+
211+
QgsDataDefinedSymbolDialog d( dataDefinedProperties, mVectorLayer );
212+
if ( d.exec() == QDialog::Accepted )
213+
{
214+
//empty all existing properties first
215+
mLayer->removeDataDefinedProperties();
216+
217+
QMap<QString, QString> properties = d.dataDefinedProperties();
218+
QMap<QString, QString>::const_iterator it = properties.constBegin();
219+
for ( ; it != properties.constEnd(); ++it )
220+
{
221+
if ( !it.value().isEmpty() )
222+
{
223+
mLayer->setDataDefinedProperty( it.key(), it.value() );
224+
}
225+
}
226+
emit changed();
227+
}
228+
}

‎src/gui/symbology-ng/qgsellipsesymbollayerv2widget.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class GUI_EXPORT QgsEllipseSymbolLayerV2Widget: public QgsSymbolLayerV2Widget, p
3838

3939
private:
4040
void blockComboSignals( bool block );
41-
//insert available attributes for data defined symbolisation
42-
void fillDataDefinedComboBoxes();
4341

4442
private slots:
4543
void on_mShapeListWidget_itemSelectionChanged();
@@ -50,17 +48,11 @@ class GUI_EXPORT QgsEllipseSymbolLayerV2Widget: public QgsSymbolLayerV2Widget, p
5048
void on_btnChangeColorBorder_clicked();
5149
void on_btnChangeColorFill_clicked();
5250

53-
void on_mDDSymbolWidthComboBox_currentIndexChanged( int idx );
54-
void on_mDDSymbolHeightComboBox_currentIndexChanged( int idx );
55-
void on_mDDRotationComboBox_currentIndexChanged( int idx );
56-
void on_mDDOutlineWidthComboBox_currentIndexChanged( int idx );
57-
void on_mDDFillColorComboBox_currentIndexChanged( int idx );
58-
void on_mDDOutlineColorComboBox_currentIndexChanged( int idx );
59-
void on_mDDShapeComboBox_currentIndexChanged( int idx );
60-
6151
void on_mSymbolWidthUnitComboBox_currentIndexChanged( int index );
6252
void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index );
6353
void on_mSymbolHeightUnitComboBox_currentIndexChanged( int index );
54+
55+
void on_mDataDefinedPropertiesButton_clicked();
6456
};
6557

6658
#endif // QGSELLIPSESYMBOLLAYERV2WIDGET_H

‎src/ui/symbollayer/widget_ellipse.ui

Lines changed: 215 additions & 294 deletions
Original file line numberDiff line numberDiff line change
@@ -7,311 +7,232 @@
77
<x>0</x>
88
<y>0</y>
99
<width>336</width>
10-
<height>357</height>
10+
<height>466</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Form</string>
1515
</property>
1616
<layout class="QGridLayout" name="gridLayout_2">
17-
<property name="margin">
18-
<number>1</number>
19-
</property>
2017
<item row="0" column="0">
21-
<widget class="QTabWidget" name="tabWidget">
22-
<property name="currentIndex">
23-
<number>0</number>
24-
</property>
25-
<widget class="QWidget" name="tab">
26-
<attribute name="title">
27-
<string>Settings</string>
28-
</attribute>
29-
<layout class="QGridLayout" name="gridLayout">
30-
<item row="0" column="0">
31-
<widget class="QLabel" name="label">
32-
<property name="text">
33-
<string>Border color</string>
34-
</property>
35-
</widget>
36-
</item>
37-
<item row="1" column="1">
38-
<widget class="QgsColorButtonV2" name="btnChangeColorFill">
39-
<property name="text">
40-
<string>Change</string>
41-
</property>
42-
</widget>
43-
</item>
44-
<item row="0" column="1">
45-
<widget class="QgsColorButtonV2" name="btnChangeColorBorder">
46-
<property name="text">
47-
<string>Change</string>
48-
</property>
49-
</widget>
50-
</item>
51-
<item row="3" column="0">
52-
<widget class="QLabel" name="mSymbolWidthUnitLabel">
53-
<property name="text">
54-
<string>Symbol width unit</string>
55-
</property>
56-
</widget>
57-
</item>
58-
<item row="5" column="1">
59-
<widget class="QComboBox" name="mOutlineWidthUnitComboBox">
60-
<item>
61-
<property name="text">
62-
<string>Millimeter</string>
63-
</property>
64-
</item>
65-
<item>
66-
<property name="text">
67-
<string>Map unit</string>
68-
</property>
69-
</item>
70-
</widget>
71-
</item>
72-
<item row="4" column="0">
73-
<widget class="QLabel" name="mOutlineWidthLabel">
74-
<property name="text">
75-
<string>Outline width</string>
76-
</property>
77-
</widget>
78-
</item>
79-
<item row="4" column="1">
80-
<widget class="QDoubleSpinBox" name="mOutlineWidthSpinBox">
81-
<property name="decimals">
82-
<number>6</number>
83-
</property>
84-
<property name="maximum">
85-
<double>999999999.000000000000000</double>
86-
</property>
87-
</widget>
88-
</item>
89-
<item row="6" column="1">
90-
<widget class="QDoubleSpinBox" name="mRotationSpinBox"/>
91-
</item>
92-
<item row="6" column="0">
93-
<widget class="QLabel" name="mRotationLabel">
94-
<property name="text">
95-
<string>Rotation</string>
18+
<layout class="QGridLayout" name="gridLayout">
19+
<item row="2" column="1">
20+
<widget class="QDoubleSpinBox" name="mWidthSpinBox">
21+
<property name="decimals">
22+
<number>6</number>
23+
</property>
24+
<property name="maximum">
25+
<double>999999999.000000000000000</double>
26+
</property>
27+
</widget>
28+
</item>
29+
<item row="3" column="1">
30+
<widget class="QComboBox" name="mSymbolWidthUnitComboBox">
31+
<item>
32+
<property name="text">
33+
<string>Millimeter</string>
34+
</property>
35+
</item>
36+
<item>
37+
<property name="text">
38+
<string>Map unit</string>
39+
</property>
40+
</item>
41+
</widget>
42+
</item>
43+
<item row="1" column="0">
44+
<widget class="QLabel" name="label_2">
45+
<property name="text">
46+
<string>Fill color</string>
47+
</property>
48+
</widget>
49+
</item>
50+
<item row="0" column="0">
51+
<widget class="QLabel" name="label">
52+
<property name="text">
53+
<string>Border color</string>
54+
</property>
55+
</widget>
56+
</item>
57+
<item row="4" column="1">
58+
<widget class="QDoubleSpinBox" name="mOutlineWidthSpinBox">
59+
<property name="decimals">
60+
<number>6</number>
61+
</property>
62+
<property name="maximum">
63+
<double>999999999.000000000000000</double>
64+
</property>
65+
</widget>
66+
</item>
67+
<item row="0" column="1">
68+
<widget class="QgsColorButtonV2" name="btnChangeColorBorder">
69+
<property name="text">
70+
<string>Change</string>
71+
</property>
72+
</widget>
73+
</item>
74+
<item row="3" column="0">
75+
<widget class="QLabel" name="mSymbolWidthUnitLabel">
76+
<property name="text">
77+
<string>Symbol width unit</string>
78+
</property>
79+
</widget>
80+
</item>
81+
<item row="4" column="0">
82+
<widget class="QLabel" name="mOutlineWidthLabel">
83+
<property name="text">
84+
<string>Outline width</string>
85+
</property>
86+
</widget>
87+
</item>
88+
<item row="1" column="1">
89+
<widget class="QgsColorButtonV2" name="btnChangeColorFill">
90+
<property name="text">
91+
<string>Change</string>
92+
</property>
93+
</widget>
94+
</item>
95+
<item row="8" column="1">
96+
<widget class="QComboBox" name="mSymbolHeightUnitComboBox">
97+
<item>
98+
<property name="text">
99+
<string>Millimeter</string>
100+
</property>
101+
</item>
102+
<item>
103+
<property name="text">
104+
<string>Map unit</string>
105+
</property>
106+
</item>
107+
</widget>
108+
</item>
109+
<item row="2" column="0">
110+
<widget class="QLabel" name="mSymbolWidthLabel">
111+
<property name="text">
112+
<string>Symbol width</string>
113+
</property>
114+
</widget>
115+
</item>
116+
<item row="6" column="0">
117+
<widget class="QLabel" name="mRotationLabel">
118+
<property name="text">
119+
<string>Rotation</string>
120+
</property>
121+
</widget>
122+
</item>
123+
<item row="10" column="0" colspan="2">
124+
<widget class="QListWidget" name="mShapeListWidget">
125+
<property name="dragDropMode">
126+
<enum>QAbstractItemView::NoDragDrop</enum>
127+
</property>
128+
<property name="iconSize">
129+
<size>
130+
<width>20</width>
131+
<height>20</height>
132+
</size>
133+
</property>
134+
<property name="movement">
135+
<enum>QListView::Static</enum>
136+
</property>
137+
<property name="flow">
138+
<enum>QListView::LeftToRight</enum>
139+
</property>
140+
<property name="resizeMode">
141+
<enum>QListView::Adjust</enum>
142+
</property>
143+
<property name="spacing">
144+
<number>4</number>
145+
</property>
146+
<property name="gridSize">
147+
<size>
148+
<width>30</width>
149+
<height>24</height>
150+
</size>
151+
</property>
152+
<property name="viewMode">
153+
<enum>QListView::IconMode</enum>
154+
</property>
155+
<property name="wordWrap">
156+
<bool>true</bool>
157+
</property>
158+
<property name="selectionRectVisible">
159+
<bool>true</bool>
160+
</property>
161+
</widget>
162+
</item>
163+
<item row="5" column="0">
164+
<widget class="QLabel" name="mOutlineWidthUnitLabel">
165+
<property name="text">
166+
<string>Outline width unit</string>
167+
</property>
168+
</widget>
169+
</item>
170+
<item row="5" column="1">
171+
<widget class="QComboBox" name="mOutlineWidthUnitComboBox">
172+
<item>
173+
<property name="text">
174+
<string>Millimeter</string>
175+
</property>
176+
</item>
177+
<item>
178+
<property name="text">
179+
<string>Map unit</string>
180+
</property>
181+
</item>
182+
</widget>
183+
</item>
184+
<item row="6" column="1">
185+
<widget class="QDoubleSpinBox" name="mRotationSpinBox"/>
186+
</item>
187+
<item row="7" column="0">
188+
<widget class="QLabel" name="mSymbolHeightLabel">
189+
<property name="text">
190+
<string>Symbol height</string>
191+
</property>
192+
</widget>
193+
</item>
194+
<item row="7" column="1">
195+
<widget class="QDoubleSpinBox" name="mHeightSpinBox">
196+
<property name="decimals">
197+
<number>6</number>
198+
</property>
199+
<property name="maximum">
200+
<double>999999999.000000000000000</double>
201+
</property>
202+
</widget>
203+
</item>
204+
<item row="8" column="0">
205+
<widget class="QLabel" name="mSymbolHeightUnitLabel">
206+
<property name="text">
207+
<string>Symbol height unit</string>
208+
</property>
209+
</widget>
210+
</item>
211+
<item row="9" column="0" colspan="2">
212+
<layout class="QHBoxLayout" name="horizontalLayout_3">
213+
<item>
214+
<widget class="QLabel" name="mDataDefinedPropertiesLabel">
215+
<property name="text">
216+
<string>Data defined properties</string>
217+
</property>
218+
</widget>
219+
</item>
220+
<item>
221+
<widget class="QPushButton" name="mDataDefinedPropertiesButton">
222+
<property name="sizePolicy">
223+
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
224+
<horstretch>0</horstretch>
225+
<verstretch>0</verstretch>
226+
</sizepolicy>
227+
</property>
228+
<property name="text">
229+
<string>...</string>
96230
</property>
97231
</widget>
98232
</item>
99-
<item row="3" column="1">
100-
<widget class="QComboBox" name="mSymbolWidthUnitComboBox">
101-
<item>
102-
<property name="text">
103-
<string>Millimeter</string>
104-
</property>
105-
</item>
106-
<item>
107-
<property name="text">
108-
<string>Map unit</string>
109-
</property>
110-
</item>
111-
</widget>
112-
</item>
113-
<item row="7" column="1">
114-
<widget class="QDoubleSpinBox" name="mHeightSpinBox">
115-
<property name="decimals">
116-
<number>6</number>
117-
</property>
118-
<property name="maximum">
119-
<double>999999999.000000000000000</double>
120-
</property>
121-
</widget>
122-
</item>
123-
<item row="5" column="0">
124-
<widget class="QLabel" name="mOutlineWidthUnitLabel">
125-
<property name="text">
126-
<string>Outline width unit</string>
127-
</property>
128-
</widget>
129-
</item>
130-
<item row="9" column="0" colspan="2">
131-
<widget class="QListWidget" name="mShapeListWidget">
132-
<property name="dragDropMode">
133-
<enum>QAbstractItemView::NoDragDrop</enum>
134-
</property>
135-
<property name="iconSize">
136-
<size>
137-
<width>20</width>
138-
<height>20</height>
139-
</size>
140-
</property>
141-
<property name="movement">
142-
<enum>QListView::Static</enum>
143-
</property>
144-
<property name="flow">
145-
<enum>QListView::LeftToRight</enum>
146-
</property>
147-
<property name="resizeMode">
148-
<enum>QListView::Adjust</enum>
149-
</property>
150-
<property name="spacing">
151-
<number>4</number>
152-
</property>
153-
<property name="gridSize">
154-
<size>
155-
<width>30</width>
156-
<height>24</height>
157-
</size>
158-
</property>
159-
<property name="viewMode">
160-
<enum>QListView::IconMode</enum>
161-
</property>
162-
<property name="wordWrap">
163-
<bool>true</bool>
164-
</property>
165-
<property name="selectionRectVisible">
166-
<bool>true</bool>
167-
</property>
168-
</widget>
169-
</item>
170-
<item row="1" column="0">
171-
<widget class="QLabel" name="label_2">
172-
<property name="text">
173-
<string>Fill color</string>
174-
</property>
175-
</widget>
176-
</item>
177-
<item row="2" column="0">
178-
<widget class="QLabel" name="mSymbolWidthLabel">
179-
<property name="text">
180-
<string>Symbol width</string>
181-
</property>
182-
</widget>
183-
</item>
184-
<item row="7" column="0">
185-
<widget class="QLabel" name="mSymbolHeightLabel">
186-
<property name="text">
187-
<string>Symbol height</string>
188-
</property>
189-
</widget>
190-
</item>
191-
<item row="2" column="1">
192-
<widget class="QDoubleSpinBox" name="mWidthSpinBox">
193-
<property name="decimals">
194-
<number>6</number>
195-
</property>
196-
<property name="maximum">
197-
<double>999999999.000000000000000</double>
198-
</property>
199-
</widget>
200-
</item>
201-
<item row="8" column="1">
202-
<widget class="QComboBox" name="mSymbolHeightUnitComboBox">
203-
<item>
204-
<property name="text">
205-
<string>Millimeter</string>
206-
</property>
207-
</item>
208-
<item>
209-
<property name="text">
210-
<string>Map unit</string>
211-
</property>
212-
</item>
213-
</widget>
214-
</item>
215-
<item row="8" column="0">
216-
<widget class="QLabel" name="mSymbolHeightUnitLabel">
217-
<property name="text">
218-
<string>Symbol height unit</string>
219-
</property>
220-
</widget>
221-
</item>
222-
</layout>
223-
</widget>
224-
<widget class="QWidget" name="tab_2">
225-
<attribute name="title">
226-
<string>Data defined settings</string>
227-
</attribute>
228-
<layout class="QGridLayout" name="gridLayout_3">
229-
<item row="0" column="0">
230-
<widget class="QLabel" name="mDdSymbolWidthLabel">
231-
<property name="text">
232-
<string>Symbol width</string>
233-
</property>
234-
</widget>
235-
</item>
236-
<item row="0" column="1">
237-
<widget class="QComboBox" name="mDDSymbolWidthComboBox"/>
238-
</item>
239-
<item row="1" column="0">
240-
<widget class="QLabel" name="mDdSymbolHeightLabel">
241-
<property name="text">
242-
<string>Symbol height</string>
243-
</property>
244-
</widget>
245-
</item>
246-
<item row="1" column="1">
247-
<widget class="QComboBox" name="mDDSymbolHeightComboBox"/>
248-
</item>
249-
<item row="3" column="0">
250-
<widget class="QLabel" name="mDDOutlineWidthLabel">
251-
<property name="text">
252-
<string>Outline width</string>
253-
</property>
254-
</widget>
255-
</item>
256-
<item row="3" column="1">
257-
<widget class="QComboBox" name="mDDOutlineWidthComboBox"/>
258-
</item>
259-
<item row="4" column="0">
260-
<widget class="QLabel" name="mDDFillColorLabel">
261-
<property name="text">
262-
<string>Fill color</string>
263-
</property>
264-
</widget>
265-
</item>
266-
<item row="4" column="1">
267-
<widget class="QComboBox" name="mDDFillColorComboBox"/>
268-
</item>
269-
<item row="5" column="0">
270-
<widget class="QLabel" name="mDDOutlineLabel">
271-
<property name="text">
272-
<string>Outline color</string>
273-
</property>
274-
</widget>
275-
</item>
276-
<item row="5" column="1">
277-
<widget class="QComboBox" name="mDDOutlineColorComboBox"/>
278-
</item>
279-
<item row="6" column="0">
280-
<widget class="QLabel" name="mDDShapeLabel">
281-
<property name="text">
282-
<string>Shape</string>
283-
</property>
284-
</widget>
285-
</item>
286-
<item row="2" column="1">
287-
<widget class="QComboBox" name="mDDRotationComboBox"/>
288-
</item>
289-
<item row="6" column="1">
290-
<widget class="QComboBox" name="mDDShapeComboBox"/>
291-
</item>
292-
<item row="2" column="0">
293-
<widget class="QLabel" name="mDDRotationLabel">
294-
<property name="text">
295-
<string>Rotation</string>
296-
</property>
297-
</widget>
298-
</item>
299-
<item row="7" column="0" colspan="2">
300-
<spacer name="verticalSpacer">
301-
<property name="orientation">
302-
<enum>Qt::Vertical</enum>
303-
</property>
304-
<property name="sizeHint" stdset="0">
305-
<size>
306-
<width>20</width>
307-
<height>40</height>
308-
</size>
309-
</property>
310-
</spacer>
311-
</item>
312233
</layout>
313-
</widget>
314-
</widget>
234+
</item>
235+
</layout>
315236
</item>
316237
</layout>
317238
</widget>

0 commit comments

Comments
 (0)
Please sign in to comment.