Skip to content

Commit 01734bd

Browse files
committedMar 7, 2013
Separate units for line width, line offset, dash pattern
1 parent 7bc758e commit 01734bd

File tree

10 files changed

+312
-192
lines changed

10 files changed

+312
-192
lines changed
 

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,23 @@ QgsSimpleLineSymbolLayerV2::QgsSimpleLineSymbolLayerV2( QColor color, double wid
3333
mCustomDashVector << 5 << 2;
3434
}
3535

36+
void QgsSimpleLineSymbolLayerV2::setOutputUnit( QgsSymbolV2::OutputUnit unit )
37+
{
38+
mWidthUnit = unit;
39+
mOffsetUnit = unit;
40+
mCustomDashPatternUnit = unit;
41+
}
42+
43+
QgsSymbolV2::OutputUnit QgsSimpleLineSymbolLayerV2::outputUnit() const
44+
{
45+
QgsSymbolV2::OutputUnit unit = mWidthUnit;
46+
if ( mOffsetUnit != unit || mCustomDashPatternUnit != unit )
47+
{
48+
return QgsSymbolV2::Mixed;
49+
}
50+
return unit;
51+
}
52+
3653

3754
QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::create( const QgsStringMap& props )
3855
{
@@ -78,7 +95,7 @@ void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context
7895
QColor penColor = mColor;
7996
penColor.setAlphaF( mColor.alphaF() * context.alpha() );
8097
mPen.setColor( penColor );
81-
double scaledWidth = context.outputLineWidth( mWidth );
98+
double scaledWidth = mWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mWidthUnit );
8299
mPen.setWidthF( scaledWidth );
83100
if ( mUseCustomDashPattern && scaledWidth != 0 )
84101
{
@@ -90,7 +107,7 @@ void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context
90107
for ( ; it != mCustomDashVector.constEnd(); ++it )
91108
{
92109
//the dash is specified in terms of pen widths, therefore the division
93-
scaledVector << context.outputLineWidth(( *it ) / scaledWidth );
110+
scaledVector << ( *it ) * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mCustomDashPatternUnit ) / scaledWidth;
94111
}
95112
mPen.setDashPattern( scaledVector );
96113
}
@@ -123,7 +140,7 @@ void QgsSimpleLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
123140

124141
if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale )
125142
{
126-
double scaledWidth = context.outputLineWidth( mWidth );
143+
double scaledWidth = mWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mWidthUnit );
127144
mPen.setWidthF( scaledWidth );
128145
mSelPen.setWidthF( scaledWidth );
129146
}
@@ -135,7 +152,7 @@ void QgsSimpleLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
135152
}
136153
else
137154
{
138-
double scaledOffset = context.outputLineWidth( mOffset );
155+
double scaledOffset = mOffset * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit );
139156
p->drawPolyline( ::offsetLine( points, scaledOffset ) );
140157
}
141158
}
@@ -157,6 +174,9 @@ QgsStringMap QgsSimpleLineSymbolLayerV2::properties() const
157174
QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::clone() const
158175
{
159176
QgsSimpleLineSymbolLayerV2* l = new QgsSimpleLineSymbolLayerV2( mColor, mWidth, mPenStyle );
177+
l->setWidthUnit( mWidthUnit );
178+
l->setOffsetUnit( mOffsetUnit );
179+
l->setCustomDashPatternUnit( mCustomDashPatternUnit );
160180
l->setOffset( mOffset );
161181
l->setPenJoinStyle( mPenJoinStyle );
162182
l->setPenCapStyle( mPenCapStyle );

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class CORE_EXPORT QgsSimpleLineSymbolLayerV2 : public QgsLineSymbolLayerV2
5858

5959
QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFactor ) const;
6060

61+
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
62+
QgsSymbolV2::OutputUnit outputUnit() const;
63+
6164
// new stuff
6265

6366
Qt::PenStyle penStyle() const { return mPenStyle; }
@@ -72,9 +75,15 @@ class CORE_EXPORT QgsSimpleLineSymbolLayerV2 : public QgsLineSymbolLayerV2
7275
double offset() const { return mOffset; }
7376
void setOffset( double offset ) { mOffset = offset; }
7477

78+
QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }
79+
void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit; }
80+
7581
bool useCustomDashPattern() const { return mUseCustomDashPattern; }
7682
void setUseCustomDashPattern( bool b ) { mUseCustomDashPattern = b; }
7783

84+
QgsSymbolV2::OutputUnit customDashPatternUnit() const { return mCustomDashPatternUnit; }
85+
void setCustomDashPatternUnit( QgsSymbolV2::OutputUnit unit ) { mCustomDashPatternUnit = unit; }
86+
7887
QVector<qreal> customDashVector() const { return mCustomDashVector; }
7988
void setCustomDashVector( const QVector<qreal>& vector ) { mCustomDashVector = vector; }
8089

@@ -85,8 +94,12 @@ class CORE_EXPORT QgsSimpleLineSymbolLayerV2 : public QgsLineSymbolLayerV2
8594
QPen mPen;
8695
QPen mSelPen;
8796
double mOffset;
97+
QgsSymbolV2::OutputUnit mOffsetUnit;
98+
8899
//use a custom dash dot pattern instead of the predefined ones
89100
bool mUseCustomDashPattern;
101+
QgsSymbolV2::OutputUnit mCustomDashPatternUnit;
102+
90103
/**Vector with an even number of entries for the */
91104
QVector<qreal> mCustomDashVector;
92105
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ QgsMarkerSymbolLayerV2::QgsMarkerSymbolLayerV2( bool locked )
3131
}
3232

3333
QgsLineSymbolLayerV2::QgsLineSymbolLayerV2( bool locked )
34-
: QgsSymbolLayerV2( QgsSymbolV2::Line, locked )
34+
: QgsSymbolLayerV2( QgsSymbolV2::Line, locked ), mWidthUnit( QgsSymbolV2::MM )
3535
{
3636
}
3737

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ class CORE_EXPORT QgsSymbolLayerV2
6969
void setLocked( bool locked ) { mLocked = locked; }
7070
bool isLocked() const { return mLocked; }
7171

72+
virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ) {} //= 0;
73+
virtual QgsSymbolV2::OutputUnit outputUnit() const { return QgsSymbolV2::Mixed; } //= 0;
74+
7275
// used only with rending with symbol levels is turned on (0 = first pass, 1 = second, ...)
7376
void setRenderingPass( int renderingPass ) { mRenderingPass = renderingPass; }
7477
int renderingPass() const { return mRenderingPass; }
@@ -138,12 +141,16 @@ class CORE_EXPORT QgsLineSymbolLayerV2 : public QgsSymbolLayerV2
138141
virtual void setWidth( double width ) { mWidth = width; }
139142
virtual double width() const { return mWidth; }
140143

144+
void setWidthUnit( QgsSymbolV2::OutputUnit unit ) { mWidthUnit = unit; }
145+
QgsSymbolV2::OutputUnit widthUnit() const { return mWidthUnit; }
146+
141147
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size );
142148

143149
protected:
144150
QgsLineSymbolLayerV2( bool locked = false );
145151

146152
double mWidth;
153+
QgsSymbolV2::OutputUnit mWidthUnit;
147154
};
148155

149156
class CORE_EXPORT QgsFillSymbolLayerV2 : public QgsSymbolLayerV2

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

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <cmath>
3636

3737
QgsSymbolV2::QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers )
38-
: mType( type ), mLayers( layers ), mOutputUnit( MM ), mAlpha( 1.0 ), mRenderHints( 0 )
38+
: mType( type ), mLayers( layers ), mAlpha( 1.0 ), mRenderHints( 0 )
3939
{
4040

4141
// check they're all correct symbol layers
@@ -61,6 +61,38 @@ QgsSymbolV2::~QgsSymbolV2()
6161
delete *it;
6262
}
6363

64+
QgsSymbolV2::OutputUnit QgsSymbolV2::outputUnit() const
65+
{
66+
QgsSymbolV2::OutputUnit unit;
67+
68+
QgsSymbolLayerV2List::const_iterator it = mLayers.constBegin();
69+
for ( ; it != mLayers.constEnd(); ++it )
70+
{
71+
if ( it == mLayers.constBegin() )
72+
{
73+
unit = ( *it )->outputUnit();
74+
}
75+
else
76+
{
77+
if (( *it )->outputUnit() != unit )
78+
{
79+
return QgsSymbolV2::Mixed;
80+
}
81+
}
82+
}
83+
84+
return unit;
85+
}
86+
87+
void QgsSymbolV2::setOutputUnit( QgsSymbolV2::OutputUnit u )
88+
{
89+
QgsSymbolLayerV2List::iterator it = mLayers.begin();
90+
for ( ; it != mLayers.end(); ++it )
91+
{
92+
( *it )->setOutputUnit( u );
93+
}
94+
}
95+
6496
QgsSymbolV2* QgsSymbolV2::defaultSymbol( QGis::GeometryType geomType )
6597
{
6698
QgsSymbolV2* s = 0;
@@ -184,15 +216,15 @@ bool QgsSymbolV2::changeSymbolLayer( int index, QgsSymbolLayerV2* layer )
184216

185217
void QgsSymbolV2::startRender( QgsRenderContext& context, const QgsVectorLayer* layer )
186218
{
187-
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, false, mRenderHints );
219+
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, false, mRenderHints );
188220
symbolContext.setLayer( layer );
189221
for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it )
190222
( *it )->startRender( symbolContext );
191223
}
192224

193225
void QgsSymbolV2::stopRender( QgsRenderContext& context )
194226
{
195-
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, false, mRenderHints );
227+
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, false, mRenderHints );
196228
for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it )
197229
( *it )->stopRender( symbolContext );
198230
}
@@ -220,7 +252,7 @@ QColor QgsSymbolV2::color()
220252
void QgsSymbolV2::drawPreviewIcon( QPainter* painter, QSize size )
221253
{
222254
QgsRenderContext context = QgsSymbolLayerV2Utils::createRenderContext( painter );
223-
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, false, mRenderHints );
255+
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, false, mRenderHints );
224256
for ( QgsSymbolLayerV2List::iterator it = mLayers.begin(); it != mLayers.end(); ++it )
225257
{
226258
if ( mType == Fill && ( *it )->type() == Line )
@@ -504,7 +536,7 @@ QgsSymbolV2::ScaleMethod QgsMarkerSymbolV2::scaleMethod()
504536

505537
void QgsMarkerSymbolV2::renderPoint( const QPointF& point, const QgsFeature* f, QgsRenderContext& context, int layer, bool selected )
506538
{
507-
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, selected, mRenderHints, f );
539+
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, selected, mRenderHints, f );
508540
if ( layer != -1 )
509541
{
510542
if ( layer >= 0 && layer < mLayers.count() )
@@ -522,7 +554,7 @@ void QgsMarkerSymbolV2::renderPoint( const QPointF& point, const QgsFeature* f,
522554
QgsSymbolV2* QgsMarkerSymbolV2::clone() const
523555
{
524556
QgsSymbolV2* cloneSymbol = new QgsMarkerSymbolV2( cloneLayers() );
525-
cloneSymbol->setOutputUnit( mOutputUnit );
557+
cloneSymbol->setOutputUnit( outputUnit() );
526558
cloneSymbol->setAlpha( mAlpha );
527559
return cloneSymbol;
528560
}
@@ -573,7 +605,7 @@ double QgsLineSymbolV2::width()
573605

574606
void QgsLineSymbolV2::renderPolyline( const QPolygonF& points, const QgsFeature* f, QgsRenderContext& context, int layer, bool selected )
575607
{
576-
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, selected, mRenderHints, f );
608+
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, selected, mRenderHints, f );
577609
if ( layer != -1 )
578610
{
579611
if ( layer >= 0 && layer < mLayers.count() )
@@ -592,7 +624,6 @@ void QgsLineSymbolV2::renderPolyline( const QPolygonF& points, const QgsFeature*
592624
QgsSymbolV2* QgsLineSymbolV2::clone() const
593625
{
594626
QgsSymbolV2* cloneSymbol = new QgsLineSymbolV2( cloneLayers() );
595-
cloneSymbol->setOutputUnit( mOutputUnit );
596627
cloneSymbol->setAlpha( mAlpha );
597628
return cloneSymbol;
598629
}
@@ -609,7 +640,7 @@ QgsFillSymbolV2::QgsFillSymbolV2( QgsSymbolLayerV2List layers )
609640

610641
void QgsFillSymbolV2::renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, const QgsFeature* f, QgsRenderContext& context, int layer, bool selected )
611642
{
612-
QgsSymbolV2RenderContext symbolContext( context, mOutputUnit, mAlpha, selected, mRenderHints, f );
643+
QgsSymbolV2RenderContext symbolContext( context, outputUnit(), mAlpha, selected, mRenderHints, f );
613644
if ( layer != -1 )
614645
{
615646
if ( layer >= 0 && layer < mLayers.count() )
@@ -643,7 +674,7 @@ void QgsFillSymbolV2::renderPolygon( const QPolygonF& points, QList<QPolygonF>*
643674
QgsSymbolV2* QgsFillSymbolV2::clone() const
644675
{
645676
QgsSymbolV2* cloneSymbol = new QgsFillSymbolV2( cloneLayers() );
646-
cloneSymbol->setOutputUnit( mOutputUnit );
677+
cloneSymbol->setOutputUnit( outputUnit() );
647678
cloneSymbol->setAlpha( mAlpha );
648679
return cloneSymbol;
649680
}

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ class CORE_EXPORT QgsSymbolV2
4444

4545
enum OutputUnit
4646
{
47-
MM,
48-
MapUnit
47+
MM = 0,
48+
MapUnit,
49+
Mixed //mixed units in symbol layers
4950
};
5051

5152
enum SymbolType
@@ -112,8 +113,8 @@ class CORE_EXPORT QgsSymbolV2
112113

113114
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const;
114115

115-
OutputUnit outputUnit() const { return mOutputUnit; }
116-
void setOutputUnit( OutputUnit u ) { mOutputUnit = u; }
116+
QgsSymbolV2::OutputUnit outputUnit() const;
117+
void setOutputUnit( QgsSymbolV2::OutputUnit u );
117118

118119
//! Get alpha transparency 1 for opaque, 0 for invisible
119120
qreal alpha() const { return mAlpha; }
@@ -140,8 +141,6 @@ class CORE_EXPORT QgsSymbolV2
140141
SymbolType mType;
141142
QgsSymbolLayerV2List mLayers;
142143

143-
OutputUnit mOutputUnit;
144-
145144
/**Symbol opacity (in the range 0 - 1)*/
146145
qreal mAlpha;
147146

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,20 @@ QgsSimpleLineSymbolLayerV2Widget::QgsSimpleLineSymbolLayerV2Widget( const QgsVec
6363

6464
void QgsSimpleLineSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
6565
{
66-
if ( layer->layerType() != "SimpleLine" )
66+
if ( !layer || layer->layerType() != "SimpleLine" )
6767
return;
6868

6969
// layer type is correct, we can do the cast
7070
mLayer = static_cast<QgsSimpleLineSymbolLayerV2*>( layer );
7171

72+
// set units
73+
mPenWidthUnitComboBox->blockSignals( true );
74+
mPenWidthUnitComboBox->setCurrentIndex( mLayer->widthUnit() );
75+
mPenWidthUnitComboBox->blockSignals( false );
76+
mOffsetUnitComboBox->blockSignals( true );
77+
mOffsetUnitComboBox->setCurrentIndex( mLayer->offsetUnit() );
78+
mOffsetUnitComboBox->blockSignals( false );
79+
7280
// set values
7381
spinWidth->setValue( mLayer->width() );
7482
btnChangeColor->setColor( mLayer->color() );
@@ -161,6 +169,22 @@ void QgsSimpleLineSymbolLayerV2Widget::on_mChangePatternButton_clicked()
161169
}
162170
}
163171

172+
void QgsSimpleLineSymbolLayerV2Widget::on_mPenWidthUnitComboBox_currentIndexChanged( int index )
173+
{
174+
if ( mLayer )
175+
{
176+
mLayer->setWidthUnit(( QgsSymbolV2::OutputUnit )index );
177+
}
178+
}
179+
180+
void QgsSimpleLineSymbolLayerV2Widget::on_mOffsetUnitComboBox_currentIndexChanged( int index )
181+
{
182+
if ( mLayer )
183+
{
184+
mLayer->setOffsetUnit(( QgsSymbolV2::OutputUnit )index );
185+
}
186+
}
187+
164188
void QgsSimpleLineSymbolLayerV2Widget::updatePatternIcon()
165189
{
166190
if ( !mLayer )

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widge
6767
void offsetChanged();
6868
void on_mCustomCheckBox_stateChanged( int state );
6969
void on_mChangePatternButton_clicked();
70+
void on_mPenWidthUnitComboBox_currentIndexChanged( int index );
71+
void on_mOffsetUnitComboBox_currentIndexChanged( int index );
7072

7173

7274
protected:

‎src/ui/symbollayer/widget_simpleline.ui

Lines changed: 140 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -6,169 +6,172 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>368</width>
10-
<height>296</height>
9+
<width>278</width>
10+
<height>195</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Form</string>
1515
</property>
16-
<layout class="QGridLayout" name="gridLayout_2">
16+
<layout class="QGridLayout" name="gridLayout">
1717
<item row="0" column="0">
18-
<layout class="QGridLayout" name="gridLayout">
19-
<item row="0" column="0">
20-
<widget class="QLabel" name="label">
21-
<property name="text">
22-
<string>Color</string>
23-
</property>
24-
</widget>
25-
</item>
26-
<item row="0" column="1">
27-
<widget class="QgsColorButtonV2" name="btnChangeColor">
28-
<property name="sizePolicy">
29-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
30-
<horstretch>0</horstretch>
31-
<verstretch>0</verstretch>
32-
</sizepolicy>
33-
</property>
34-
<property name="text">
35-
<string>Change</string>
36-
</property>
37-
</widget>
38-
</item>
39-
<item row="1" column="0">
40-
<widget class="QLabel" name="label_2">
41-
<property name="text">
42-
<string>Pen width</string>
43-
</property>
44-
</widget>
45-
</item>
46-
<item row="1" column="1">
47-
<widget class="QDoubleSpinBox" name="spinWidth">
48-
<property name="sizePolicy">
49-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
50-
<horstretch>0</horstretch>
51-
<verstretch>0</verstretch>
52-
</sizepolicy>
53-
</property>
54-
<property name="alignment">
55-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
56-
</property>
57-
<property name="decimals">
58-
<number>5</number>
59-
</property>
60-
<property name="maximum">
61-
<double>100000.000000000000000</double>
62-
</property>
63-
<property name="value">
64-
<double>1.000000000000000</double>
65-
</property>
66-
</widget>
67-
</item>
68-
<item row="2" column="0">
69-
<widget class="QLabel" name="label_4">
70-
<property name="text">
71-
<string>Offset</string>
72-
</property>
73-
</widget>
74-
</item>
75-
<item row="2" column="1">
76-
<widget class="QDoubleSpinBox" name="spinOffset">
77-
<property name="alignment">
78-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
79-
</property>
80-
<property name="decimals">
81-
<number>5</number>
82-
</property>
83-
<property name="minimum">
84-
<double>-100000.000000000000000</double>
85-
</property>
86-
<property name="maximum">
87-
<double>100000.000000000000000</double>
88-
</property>
89-
</widget>
90-
</item>
91-
<item row="3" column="0">
92-
<widget class="QLabel" name="label_3">
93-
<property name="text">
94-
<string>Pen style</string>
95-
</property>
96-
</widget>
97-
</item>
98-
<item row="3" column="1">
99-
<widget class="QgsPenStyleComboBox" name="cboPenStyle"/>
100-
</item>
101-
</layout>
18+
<widget class="QLabel" name="label">
19+
<property name="text">
20+
<string>Color</string>
21+
</property>
22+
</widget>
23+
</item>
24+
<item row="0" column="1" colspan="2">
25+
<widget class="QgsColorButtonV2" name="btnChangeColor">
26+
<property name="sizePolicy">
27+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
28+
<horstretch>0</horstretch>
29+
<verstretch>0</verstretch>
30+
</sizepolicy>
31+
</property>
32+
<property name="text">
33+
<string>Change</string>
34+
</property>
35+
</widget>
10236
</item>
10337
<item row="1" column="0">
104-
<layout class="QHBoxLayout" name="horizontalLayout">
38+
<widget class="QLabel" name="label_2">
39+
<property name="text">
40+
<string>Pen width</string>
41+
</property>
42+
</widget>
43+
</item>
44+
<item row="1" column="1">
45+
<widget class="QDoubleSpinBox" name="spinWidth">
46+
<property name="sizePolicy">
47+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
48+
<horstretch>0</horstretch>
49+
<verstretch>0</verstretch>
50+
</sizepolicy>
51+
</property>
52+
<property name="alignment">
53+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
54+
</property>
55+
<property name="decimals">
56+
<number>5</number>
57+
</property>
58+
<property name="maximum">
59+
<double>100000.000000000000000</double>
60+
</property>
61+
<property name="value">
62+
<double>1.000000000000000</double>
63+
</property>
64+
</widget>
65+
</item>
66+
<item row="1" column="2">
67+
<widget class="QComboBox" name="mPenWidthUnitComboBox">
68+
<property name="sizePolicy">
69+
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
70+
<horstretch>0</horstretch>
71+
<verstretch>0</verstretch>
72+
</sizepolicy>
73+
</property>
10574
<item>
106-
<widget class="QCheckBox" name="mCustomCheckBox">
107-
<property name="text">
108-
<string>Use custom dash pattern</string>
109-
</property>
110-
</widget>
75+
<property name="text">
76+
<string>Millimeter</string>
77+
</property>
11178
</item>
11279
<item>
113-
<widget class="QPushButton" name="mChangePatternButton">
114-
<property name="text">
115-
<string>Change</string>
116-
</property>
117-
</widget>
80+
<property name="text">
81+
<string>Map unit</string>
82+
</property>
11883
</item>
119-
</layout>
84+
</widget>
12085
</item>
12186
<item row="2" column="0">
122-
<spacer>
123-
<property name="orientation">
124-
<enum>Qt::Vertical</enum>
87+
<widget class="QLabel" name="label_4">
88+
<property name="text">
89+
<string>Offset</string>
90+
</property>
91+
</widget>
92+
</item>
93+
<item row="2" column="1">
94+
<widget class="QDoubleSpinBox" name="spinOffset">
95+
<property name="alignment">
96+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
97+
</property>
98+
<property name="decimals">
99+
<number>5</number>
125100
</property>
126-
<property name="sizeHint" stdset="0">
127-
<size>
128-
<width>350</width>
129-
<height>81</height>
130-
</size>
101+
<property name="minimum">
102+
<double>-100000.000000000000000</double>
131103
</property>
132-
</spacer>
104+
<property name="maximum">
105+
<double>100000.000000000000000</double>
106+
</property>
107+
</widget>
108+
</item>
109+
<item row="2" column="2">
110+
<widget class="QComboBox" name="mOffsetUnitComboBox">
111+
<property name="sizePolicy">
112+
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
113+
<horstretch>0</horstretch>
114+
<verstretch>0</verstretch>
115+
</sizepolicy>
116+
</property>
117+
<item>
118+
<property name="text">
119+
<string>Millimeter</string>
120+
</property>
121+
</item>
122+
<item>
123+
<property name="text">
124+
<string>Map unit</string>
125+
</property>
126+
</item>
127+
</widget>
133128
</item>
134129
<item row="3" column="0">
135-
<layout class="QGridLayout" name="gridLayout_1">
136-
<item row="0" column="0">
137-
<widget class="QLabel" name="label_5">
130+
<widget class="QLabel" name="label_3">
131+
<property name="text">
132+
<string>Pen style</string>
133+
</property>
134+
</widget>
135+
</item>
136+
<item row="3" column="1" colspan="2">
137+
<widget class="QgsPenStyleComboBox" name="cboPenStyle"/>
138+
</item>
139+
<item row="4" column="0">
140+
<widget class="QLabel" name="label_5">
141+
<property name="text">
142+
<string>Join style</string>
143+
</property>
144+
</widget>
145+
</item>
146+
<item row="4" column="1" rowspan="2" colspan="2">
147+
<widget class="QgsPenJoinStyleComboBox" name="cboJoinStyle"/>
148+
</item>
149+
<item row="5" column="0" rowspan="2">
150+
<widget class="QLabel" name="label_6">
151+
<property name="text">
152+
<string>Cap style</string>
153+
</property>
154+
</widget>
155+
</item>
156+
<item row="6" column="1" colspan="2">
157+
<widget class="QgsPenCapStyleComboBox" name="cboCapStyle"/>
158+
</item>
159+
<item row="7" column="0" colspan="3">
160+
<layout class="QHBoxLayout" name="horizontalLayout">
161+
<item>
162+
<widget class="QCheckBox" name="mCustomCheckBox">
138163
<property name="text">
139-
<string>Join style</string>
164+
<string>Use custom dash pattern</string>
140165
</property>
141166
</widget>
142167
</item>
143-
<item row="0" column="1">
144-
<widget class="QgsPenJoinStyleComboBox" name="cboJoinStyle"/>
145-
</item>
146-
<item row="0" column="2" rowspan="2">
147-
<spacer name="horizontalSpacer">
148-
<property name="orientation">
149-
<enum>Qt::Horizontal</enum>
150-
</property>
151-
<property name="sizeType">
152-
<enum>QSizePolicy::Preferred</enum>
153-
</property>
154-
<property name="sizeHint" stdset="0">
155-
<size>
156-
<width>40</width>
157-
<height>38</height>
158-
</size>
159-
</property>
160-
</spacer>
161-
</item>
162-
<item row="1" column="0">
163-
<widget class="QLabel" name="label_6">
168+
<item>
169+
<widget class="QPushButton" name="mChangePatternButton">
164170
<property name="text">
165-
<string>Cap style</string>
171+
<string>Change</string>
166172
</property>
167173
</widget>
168174
</item>
169-
<item row="1" column="1">
170-
<widget class="QgsPenCapStyleComboBox" name="cboCapStyle"/>
171-
</item>
172175
</layout>
173176
</item>
174177
</layout>

‎src/ui/symbollayer/widget_simplemarker.ui

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,7 @@
1919
</property>
2020
<item>
2121
<layout class="QGridLayout" name="gridLayout">
22-
<item row="3" column="0">
23-
<widget class="QLabel" name="label_4">
24-
<property name="text">
25-
<string>Angle</string>
26-
</property>
27-
</widget>
28-
</item>
29-
<item row="3" column="1">
22+
<item row="4" column="1">
3023
<widget class="QDoubleSpinBox" name="spinAngle">
3124
<property name="decimals">
3225
<number>2</number>
@@ -39,55 +32,69 @@
3932
</property>
4033
</widget>
4134
</item>
42-
<item row="0" column="1">
43-
<widget class="QgsColorButtonV2" name="btnChangeColorBorder">
44-
<property name="text">
45-
<string>Change</string>
35+
<item row="3" column="1">
36+
<widget class="QDoubleSpinBox" name="spinSize">
37+
<property name="decimals">
38+
<number>5</number>
39+
</property>
40+
<property name="maximum">
41+
<double>100000.000000000000000</double>
42+
</property>
43+
<property name="value">
44+
<double>1.000000000000000</double>
4645
</property>
4746
</widget>
4847
</item>
49-
<item row="1" column="1">
50-
<widget class="QgsColorButtonV2" name="btnChangeColorFill">
48+
<item row="0" column="1">
49+
<widget class="QgsColorButtonV2" name="btnChangeColorBorder">
5150
<property name="text">
5251
<string>Change</string>
5352
</property>
5453
</widget>
5554
</item>
56-
<item row="0" column="0">
57-
<widget class="QLabel" name="label">
55+
<item row="1" column="0">
56+
<widget class="QLabel" name="label_2">
5857
<property name="text">
59-
<string>Border color</string>
58+
<string>Fill color</string>
6059
</property>
6160
</widget>
6261
</item>
63-
<item row="2" column="0">
62+
<item row="3" column="0">
6463
<widget class="QLabel" name="label_3">
6564
<property name="text">
6665
<string>Size</string>
6766
</property>
6867
</widget>
6968
</item>
70-
<item row="1" column="0">
71-
<widget class="QLabel" name="label_2">
69+
<item row="5" column="0">
70+
<widget class="QLabel" name="label_5">
7271
<property name="text">
73-
<string>Fill color</string>
72+
<string>Offset X,Y</string>
7473
</property>
7574
</widget>
7675
</item>
77-
<item row="2" column="1">
78-
<widget class="QDoubleSpinBox" name="spinSize">
79-
<property name="decimals">
80-
<number>5</number>
76+
<item row="1" column="1">
77+
<widget class="QgsColorButtonV2" name="btnChangeColorFill">
78+
<property name="text">
79+
<string>Change</string>
8180
</property>
82-
<property name="maximum">
83-
<double>100000.000000000000000</double>
81+
</widget>
82+
</item>
83+
<item row="4" column="0">
84+
<widget class="QLabel" name="label_4">
85+
<property name="text">
86+
<string>Angle</string>
8487
</property>
85-
<property name="value">
86-
<double>1.000000000000000</double>
88+
</widget>
89+
</item>
90+
<item row="0" column="0">
91+
<widget class="QLabel" name="label">
92+
<property name="text">
93+
<string>Border color</string>
8794
</property>
8895
</widget>
8996
</item>
90-
<item row="4" column="1">
97+
<item row="5" column="1">
9198
<layout class="QHBoxLayout" name="horizontalLayout">
9299
<item>
93100
<widget class="QDoubleSpinBox" name="spinOffsetX">
@@ -111,10 +118,24 @@
111118
</item>
112119
</layout>
113120
</item>
114-
<item row="4" column="0">
115-
<widget class="QLabel" name="label_5">
121+
<item row="2" column="1">
122+
<widget class="QComboBox" name="mUnitComboBox">
123+
<item>
124+
<property name="text">
125+
<string>Millimeter</string>
126+
</property>
127+
</item>
128+
<item>
129+
<property name="text">
130+
<string>Map unit</string>
131+
</property>
132+
</item>
133+
</widget>
134+
</item>
135+
<item row="2" column="0">
136+
<widget class="QLabel" name="mOutputUnitLabel">
116137
<property name="text">
117-
<string>Offset X,Y</string>
138+
<string>Unit</string>
118139
</property>
119140
</widget>
120141
</item>

0 commit comments

Comments
 (0)
Please sign in to comment.