Skip to content

Commit 9dccce8

Browse files
committedJan 12, 2016
Followup 3a1d47
- Fix dialog tab order - Avoid use of hardcoded enum int conversion - Remove some unneeded implicit casts - Doc tweaks
1 parent 4af65e6 commit 9dccce8

9 files changed

+326
-318
lines changed
 

‎python/core/symbology-ng/qgssymbolv2.sip‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,38 @@ class QgsSymbolV2
1919

2020
public:
2121

22+
/**
23+
* The unit of the output
24+
*/
2225
enum OutputUnit
2326
{
24-
MM,
25-
MapUnit,
26-
Mixed, //mixed units in symbol layers
27-
Pixel
27+
MM = 0, //!< The output shall be in millimeters
28+
MapUnit, //!< The output shall be in map unitx
29+
Mixed, //!< Mixed units in symbol layers
30+
Pixel, //!< The output shall be in pixels
31+
Percentage, //!< The ouput shall be a percentage of another measurement (eg canvas size, feature size)
2832
};
2933

3034
typedef QList<QgsSymbolV2::OutputUnit> OutputUnitList;
3135

36+
/**
37+
* Type of the symbol
38+
*/
3239
enum SymbolType
3340
{
34-
Marker,
35-
Line,
36-
Fill
41+
Marker, //!< Marker symbol
42+
Line, //!< Line symbol
43+
Fill, //!< Fill symbol
44+
Hybrid //!< Hybrid symbol
3745
};
3846

47+
/**
48+
* Scale method
49+
*/
3950
enum ScaleMethod
4051
{
41-
ScaleArea,
42-
ScaleDiameter
52+
ScaleArea, //!< Calculate scale by the area
53+
ScaleDiameter //!< Calculate scale by the diameter
4354
};
4455

4556
enum RenderHint

‎src/app/qgsdecorationcopyright.cpp‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,25 @@ void QgsDecorationCopyright::render( QPainter * theQPainter )
116116
// Set margin according to selected units
117117
switch ( mMarginUnit )
118118
{
119-
case 0: // Millimetres
119+
case QgsSymbolV2::MM:
120120
{
121121
int myPixelsInchX = theQPainter->device()->logicalDpiX();
122122
int myPixelsInchY = theQPainter->device()->logicalDpiY();
123-
myXOffset = int(( float( myPixelsInchX ) * INCHES_TO_MM ) * float( mMarginHorizontal ) );
124-
myYOffset = int(( float( myPixelsInchY ) * INCHES_TO_MM ) * float( mMarginVertical ) );
123+
myXOffset = myPixelsInchX * INCHES_TO_MM * mMarginHorizontal;
124+
myYOffset = myPixelsInchY * INCHES_TO_MM * mMarginVertical;
125125
break;
126126
}
127-
case 3: // Pixels
127+
128+
case QgsSymbolV2::Pixel:
128129
myXOffset = mMarginHorizontal;
129130
myYOffset = mMarginVertical;
130131
break;
131-
case 4: // Percentage
132-
myXOffset = int(( float( myWidth - size.width() )
133-
/ 100. ) * float( mMarginHorizontal ) );
134-
myYOffset = int(( float( myHeight - size.height() )
135-
/ 100. ) * float( mMarginVertical ) );
132+
133+
case QgsSymbolV2::Percentage:
134+
myXOffset = (( myWidth - size.width() ) / 100. ) * mMarginHorizontal;
135+
myYOffset = (( myHeight - size.height() ) / 100. ) * mMarginVertical;
136136
break;
137+
137138
default: // Use default of top left
138139
break;
139140
}

‎src/app/qgsdecorationitem.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
class QPainter;
2626

27+
#define INCHES_TO_MM 0.0393700787402
28+
2729
class APP_EXPORT QgsDecorationItem: public QObject
2830
{
2931
Q_OBJECT
@@ -85,7 +87,6 @@ class APP_EXPORT QgsDecorationItem: public QObject
8587
Placement mPlacement;
8688
//! Units used for the decoration placement margin
8789
QgsSymbolV2::OutputUnit mMarginUnit;
88-
const double INCHES_TO_MM = 0.0393700787402;
8990

9091
QString mName;
9192
QString mNameConfig;

‎src/app/qgsdecorationnortharrow.cpp‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,24 +145,25 @@ void QgsDecorationNorthArrow::render( QPainter * theQPainter )
145145
int myYOffset = 0;
146146
switch ( mMarginUnit )
147147
{
148-
case 0: // Millimetres
148+
case QgsSymbolV2::MM:
149149
{
150150
int myPixelsInchX = theQPainter->device()->logicalDpiX();
151151
int myPixelsInchY = theQPainter->device()->logicalDpiY();
152-
myXOffset = int(( float( myPixelsInchX ) * INCHES_TO_MM ) * float( mMarginHorizontal ) );
153-
myYOffset = int(( float( myPixelsInchY ) * INCHES_TO_MM ) * float( mMarginVertical ) );
152+
myXOffset = myPixelsInchX * INCHES_TO_MM * mMarginHorizontal;
153+
myYOffset = myPixelsInchY * INCHES_TO_MM * mMarginVertical;
154154
break;
155155
}
156-
case 3: // Pixels
156+
157+
case QgsSymbolV2::Pixel:
157158
myXOffset = mMarginHorizontal - 5; // Minus 5 to shift tight into corner
158159
myYOffset = mMarginVertical - 5;
159160
break;
160-
case 4: // Percentage
161-
myXOffset = int((( float( myWidth ) - float( myQPixmap.width() ) )
162-
/ 100. ) * float( mMarginHorizontal ) );
163-
myYOffset = int((( float( myHeight ) - float( myQPixmap.height() ) )
164-
/ 100. ) * float( mMarginVertical ) );
161+
162+
case QgsSymbolV2::Percentage:
163+
myXOffset = (( myWidth - myQPixmap.width() ) / 100. ) * mMarginHorizontal;
164+
myYOffset = (( myHeight - myQPixmap.height() ) / 100. ) * mMarginVertical;
165165
break;
166+
166167
default: // Use default of top left
167168
break;
168169
}

‎src/app/qgsdecorationscalebar.cpp‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,31 +256,33 @@ void QgsDecorationScaleBar::render( QPainter * theQPainter )
256256
// Set margin according to selected units
257257
switch ( mMarginUnit )
258258
{
259-
case 0: // Millimetres
259+
case QgsSymbolV2::MM:
260260
{
261261
int myPixelsInchX = theQPainter->device()->logicalDpiX();
262262
int myPixelsInchY = theQPainter->device()->logicalDpiY();
263-
myOriginX = int(( float( myPixelsInchX ) * INCHES_TO_MM ) * float( mMarginHorizontal ) );
264-
myOriginY = int(( float( myPixelsInchY ) * INCHES_TO_MM ) * float( mMarginVertical ) );
263+
myOriginX = myPixelsInchX * INCHES_TO_MM * mMarginHorizontal;
264+
myOriginY = myPixelsInchY * INCHES_TO_MM * mMarginVertical;
265265
break;
266266
}
267-
case 3: // Pixels
267+
268+
case QgsSymbolV2::Pixel:
268269
myOriginX = mMarginHorizontal - 5.; // Minus 5 to shift tight into corner
269270
myOriginY = mMarginVertical - 5.;
270271
break;
271-
case 4: // Percentage
272+
273+
case QgsSymbolV2::Percentage:
272274
{
273-
float myMarginDoubledW = float( myMarginW * 2 );
274-
float myMarginDoubledH = float( myMarginH * 2 );
275-
myOriginX = int((( float( myCanvasWidth - myMarginDoubledW ) - myTotalScaleBarWidth )
276-
/ 100. ) * float( mMarginHorizontal ) );
277-
myOriginY = int((( float( myCanvasHeight - myMarginDoubledH ) )
278-
/ 100. ) * float( mMarginVertical ) );
275+
float myMarginDoubledW = myMarginW * 2.0;
276+
float myMarginDoubledH = myMarginH * 2.0;
277+
myOriginX = (( myCanvasWidth - myMarginDoubledW - myTotalScaleBarWidth ) / 100. ) * mMarginHorizontal;
278+
myOriginY = (( myCanvasHeight - myMarginDoubledH ) / 100. ) * mMarginVertical;
279279
break;
280280
}
281+
281282
default: // Use default of top left
282283
break;
283284
}
285+
284286
//Determine the origin of scale bar depending on placement selected
285287
switch ( mPlacement )
286288
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class CORE_EXPORT QgsSymbolV2
6161
MapUnit, //!< The output shall be in map unitx
6262
Mixed, //!< Mixed units in symbol layers
6363
Pixel, //!< The output shall be in pixels
64-
Percentage //!< The ouput shall be in percentage of canvas
64+
Percentage, //!< The ouput shall be a percentage of another measurement (eg canvas size, feature size)
6565
};
6666

6767
typedef QList<OutputUnit> OutputUnitList;

‎src/ui/qgsdecorationcopyrightdialog.ui‎

Lines changed: 130 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>542</width>
9+
<width>543</width>
1010
<height>291</height>
1111
</rect>
1212
</property>
@@ -15,8 +15,7 @@
1515
</property>
1616
<property name="windowIcon">
1717
<iconset>
18-
<normaloff/>
19-
</iconset>
18+
<normaloff>.</normaloff>.</iconset>
2019
</property>
2120
<layout class="QGridLayout" name="gridLayout">
2221
<item row="0" column="0" colspan="2">
@@ -47,22 +46,6 @@
4746
</property>
4847
</widget>
4948
</item>
50-
<item row="2" column="0">
51-
<widget class="QLabel" name="textLabel16">
52-
<property name="maximumSize">
53-
<size>
54-
<width>100</width>
55-
<height>16777215</height>
56-
</size>
57-
</property>
58-
<property name="text">
59-
<string>&amp;Placement</string>
60-
</property>
61-
<property name="buddy">
62-
<cstring>cboPlacement</cstring>
63-
</property>
64-
</widget>
65-
</item>
6649
<item row="3" column="0">
6750
<widget class="QLabel" name="lblMargin">
6851
<property name="minimumSize">
@@ -76,74 +59,51 @@
7659
</property>
7760
</widget>
7861
</item>
79-
<item row="3" column="1">
80-
<widget class="QLabel" name="textLabel1_4">
81-
<property name="text">
82-
<string>Horizontal</string>
83-
</property>
84-
</widget>
85-
</item>
86-
<item row="3" column="2">
87-
<widget class="QgsSpinBox" name="spnHorizontal">
88-
<property name="minimumSize">
89-
<size>
90-
<width>90</width>
91-
<height>0</height>
92-
</size>
93-
</property>
94-
<property name="maximumSize">
95-
<size>
96-
<width>16777215</width>
97-
<height>16777215</height>
98-
</size>
99-
</property>
100-
<property name="minimum">
101-
<number>0</number>
102-
</property>
103-
<property name="maximum">
104-
<number>100</number>
105-
</property>
106-
</widget>
107-
</item>
108-
<item row="3" column="3">
109-
<widget class="QLabel" name="textLabel1_5">
110-
<property name="text">
111-
<string>Vertical</string>
112-
</property>
113-
</widget>
114-
</item>
115-
<item row="3" column="4">
116-
<widget class="QgsSpinBox" name="spnVertical">
117-
<property name="minimumSize">
118-
<size>
119-
<width>90</width>
120-
<height>0</height>
121-
</size>
122-
</property>
123-
<property name="maximumSize">
124-
<size>
125-
<width>16777215</width>
126-
<height>16777215</height>
127-
</size>
128-
</property>
129-
<property name="maximum">
130-
<number>100</number>
131-
</property>
132-
</widget>
133-
</item>
134-
<item row="3" column="5">
135-
<widget class="QgsUnitSelectionWidget" name="wgtUnitSelection" native="true"/>
62+
<item row="5" column="1" colspan="2">
63+
<layout class="QHBoxLayout" name="horizontalLayout_3">
64+
<item>
65+
<widget class="QComboBox" name="cboOrientation">
66+
<property name="minimumSize">
67+
<size>
68+
<width>150</width>
69+
<height>0</height>
70+
</size>
71+
</property>
72+
<item>
73+
<property name="text">
74+
<string>Horizontal</string>
75+
</property>
76+
</item>
77+
<item>
78+
<property name="text">
79+
<string>Vertical</string>
80+
</property>
81+
</item>
82+
</widget>
83+
</item>
84+
<item>
85+
<spacer name="horizontalSpacer_2">
86+
<property name="orientation">
87+
<enum>Qt::Horizontal</enum>
88+
</property>
89+
<property name="sizeHint" stdset="0">
90+
<size>
91+
<width>40</width>
92+
<height>20</height>
93+
</size>
94+
</property>
95+
</spacer>
96+
</item>
97+
</layout>
13698
</item>
137-
<item row="4" column="0">
138-
<widget class="QLabel" name="label">
139-
<property name="maximumSize">
140-
<size>
141-
<width>100</width>
142-
<height>16777215</height>
143-
</size>
144-
</property>
145-
<property name="text">
146-
<string>Color</string>
99+
<item row="1" column="0" colspan="3">
100+
<widget class="QTextEdit" name="txtCopyrightText">
101+
<property name="html">
102+
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
103+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
104+
p, li { white-space: pre-wrap; }
105+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
106+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Verdana'; font-size:10pt;&quot;&gt;© QGIS 2013&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
147107
</property>
148108
</widget>
149109
</item>
@@ -163,21 +123,7 @@
163123
</property>
164124
</widget>
165125
</item>
166-
<item row="2" column="1" colspan="4">
167-
<widget class="QComboBox" name="cboPlacement"/>
168-
</item>
169-
<item row="1" column="0" colspan="5">
170-
<widget class="QTextEdit" name="txtCopyrightText">
171-
<property name="html">
172-
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
173-
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
174-
p, li { white-space: pre-wrap; }
175-
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
176-
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Verdana'; font-size:10pt;&quot;&gt;© QGIS 2013&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
177-
</property>
178-
</widget>
179-
</item>
180-
<item row="4" column="1" colspan="4">
126+
<item row="4" column="1" colspan="2">
181127
<layout class="QHBoxLayout" name="horizontalLayout">
182128
<item>
183129
<widget class="QgsColorButtonV2" name="pbnColorChooser">
@@ -213,43 +159,104 @@ p, li { white-space: pre-wrap; }
213159
</item>
214160
</layout>
215161
</item>
216-
<item row="5" column="1" colspan="4">
217-
<layout class="QHBoxLayout" name="horizontalLayout_3">
162+
<item row="3" column="1" colspan="2">
163+
<layout class="QHBoxLayout" name="horizontalLayout_2">
218164
<item>
219-
<widget class="QComboBox" name="cboOrientation">
165+
<widget class="QLabel" name="textLabel1_4">
166+
<property name="text">
167+
<string>Horizontal</string>
168+
</property>
169+
</widget>
170+
</item>
171+
<item>
172+
<widget class="QgsSpinBox" name="spnHorizontal">
220173
<property name="minimumSize">
221174
<size>
222-
<width>150</width>
175+
<width>90</width>
223176
<height>0</height>
224177
</size>
225178
</property>
226-
<item>
227-
<property name="text">
228-
<string>Horizontal</string>
229-
</property>
230-
</item>
231-
<item>
232-
<property name="text">
233-
<string>Vertical</string>
234-
</property>
235-
</item>
179+
<property name="maximumSize">
180+
<size>
181+
<width>16777215</width>
182+
<height>16777215</height>
183+
</size>
184+
</property>
185+
<property name="minimum">
186+
<number>0</number>
187+
</property>
188+
<property name="maximum">
189+
<number>100</number>
190+
</property>
236191
</widget>
237192
</item>
238193
<item>
239-
<spacer name="horizontalSpacer_2">
240-
<property name="orientation">
241-
<enum>Qt::Horizontal</enum>
194+
<widget class="QLabel" name="textLabel1_5">
195+
<property name="text">
196+
<string>Vertical</string>
242197
</property>
243-
<property name="sizeHint" stdset="0">
198+
</widget>
199+
</item>
200+
<item>
201+
<widget class="QgsSpinBox" name="spnVertical">
202+
<property name="minimumSize">
244203
<size>
245-
<width>40</width>
246-
<height>20</height>
204+
<width>90</width>
205+
<height>0</height>
247206
</size>
248207
</property>
249-
</spacer>
208+
<property name="maximumSize">
209+
<size>
210+
<width>16777215</width>
211+
<height>16777215</height>
212+
</size>
213+
</property>
214+
<property name="maximum">
215+
<number>100</number>
216+
</property>
217+
</widget>
218+
</item>
219+
<item>
220+
<widget class="QgsUnitSelectionWidget" name="wgtUnitSelection" native="true">
221+
<property name="focusPolicy">
222+
<enum>Qt::StrongFocus</enum>
223+
</property>
224+
</widget>
250225
</item>
251226
</layout>
252227
</item>
228+
<item row="2" column="1" colspan="2">
229+
<widget class="QComboBox" name="cboPlacement"/>
230+
</item>
231+
<item row="4" column="0">
232+
<widget class="QLabel" name="label">
233+
<property name="maximumSize">
234+
<size>
235+
<width>100</width>
236+
<height>16777215</height>
237+
</size>
238+
</property>
239+
<property name="text">
240+
<string>Color</string>
241+
</property>
242+
</widget>
243+
</item>
244+
<item row="2" column="0">
245+
<widget class="QLabel" name="textLabel16">
246+
<property name="maximumSize">
247+
<size>
248+
<width>100</width>
249+
<height>16777215</height>
250+
</size>
251+
</property>
252+
<property name="text">
253+
<string>&amp;Placement</string>
254+
</property>
255+
<property name="buddy">
256+
<cstring>cboPlacement</cstring>
257+
</property>
258+
</widget>
259+
</item>
253260
</layout>
254261
</widget>
255262
</item>
@@ -291,9 +298,9 @@ p, li { white-space: pre-wrap; }
291298
<tabstop>cboPlacement</tabstop>
292299
<tabstop>spnHorizontal</tabstop>
293300
<tabstop>spnVertical</tabstop>
301+
<tabstop>wgtUnitSelection</tabstop>
294302
<tabstop>pbnColorChooser</tabstop>
295303
<tabstop>cboOrientation</tabstop>
296-
<tabstop>buttonBox</tabstop>
297304
</tabstops>
298305
<resources/>
299306
<connections/>

‎src/ui/qgsdecorationnortharrowdialog.ui‎

Lines changed: 79 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>559</width>
9+
<width>560</width>
1010
<height>234</height>
1111
</rect>
1212
</property>
@@ -15,8 +15,7 @@
1515
</property>
1616
<property name="windowIcon">
1717
<iconset>
18-
<normaloff/>
19-
</iconset>
18+
<normaloff>.</normaloff>.</iconset>
2019
</property>
2120
<layout class="QVBoxLayout" name="verticalLayout">
2221
<item>
@@ -31,6 +30,75 @@
3130
<bool>false</bool>
3231
</property>
3332
<layout class="QGridLayout" name="gridLayout">
33+
<item row="2" column="2" colspan="3">
34+
<layout class="QHBoxLayout" name="horizontalLayout">
35+
<item>
36+
<widget class="QLabel" name="labelHorizontal">
37+
<property name="text">
38+
<string>Horizontal</string>
39+
</property>
40+
</widget>
41+
</item>
42+
<item>
43+
<widget class="QgsSpinBox" name="spinVertical">
44+
<property name="minimumSize">
45+
<size>
46+
<width>90</width>
47+
<height>0</height>
48+
</size>
49+
</property>
50+
<property name="whatsThis">
51+
<string extracomment="Distance from the top of the canvas as a percentage of page height"/>
52+
</property>
53+
<property name="minimum">
54+
<number>0</number>
55+
</property>
56+
<property name="maximum">
57+
<number>100</number>
58+
</property>
59+
<property name="value">
60+
<number>0</number>
61+
</property>
62+
</widget>
63+
</item>
64+
<item>
65+
<widget class="QLabel" name="labelVertical">
66+
<property name="text">
67+
<string>Vertical</string>
68+
</property>
69+
</widget>
70+
</item>
71+
<item>
72+
<widget class="QgsSpinBox" name="spinHorizontal">
73+
<property name="minimumSize">
74+
<size>
75+
<width>90</width>
76+
<height>0</height>
77+
</size>
78+
</property>
79+
<property name="whatsThis">
80+
<string extracomment="Distance from the left of the canvas as a percentage of page width"/>
81+
</property>
82+
<property name="minimum">
83+
<number>0</number>
84+
</property>
85+
<property name="maximum">
86+
<number>100</number>
87+
</property>
88+
<property name="value">
89+
<number>0</number>
90+
</property>
91+
</widget>
92+
</item>
93+
<item>
94+
<widget class="QgsUnitSelectionWidget" name="wgtUnitSelection" native="true">
95+
<property name="focusPolicy">
96+
<enum>Qt::StrongFocus</enum>
97+
</property>
98+
</widget>
99+
</item>
100+
</layout>
101+
</item>
34102
<item row="0" column="1">
35103
<widget class="QLabel" name="textLabel6">
36104
<property name="sizePolicy">
@@ -53,7 +121,7 @@
53121
</property>
54122
</widget>
55123
</item>
56-
<item row="0" column="5">
124+
<item row="0" column="4">
57125
<widget class="QSpinBox" name="spinAngle">
58126
<property name="maximum">
59127
<number>360</number>
@@ -89,67 +157,13 @@
89157
</property>
90158
</widget>
91159
</item>
92-
<item row="2" column="2">
93-
<widget class="QLabel" name="labelHorizontal">
94-
<property name="text">
95-
<string>Horizontal</string>
96-
</property>
97-
</widget>
98-
</item>
99-
<item row="2" column="3">
100-
<widget class="QgsSpinBox" name="spinHorizontal">
101-
<property name="minimumSize">
102-
<size>
103-
<width>90</width>
104-
<height>0</height>
105-
</size>
106-
</property>
107-
<property name="whatsThis">
108-
<string extracomment="Distance from the left of the canvas as a percentage of page width"/>
109-
</property>
110-
<property name="minimum">
111-
<number>0</number>
112-
</property>
113-
<property name="maximum">
114-
<number>100</number>
115-
</property>
116-
<property name="value">
117-
<number>0</number>
118-
</property>
119-
</widget>
120-
</item>
121-
<item row="2" column="4">
122-
<widget class="QLabel" name="labelVertical">
123-
<property name="text">
124-
<string>Vertical</string>
125-
</property>
126-
</widget>
127-
</item>
128-
<item row="2" column="5">
129-
<widget class="QgsSpinBox" name="spinVertical">
130-
<property name="minimumSize">
131-
<size>
132-
<width>90</width>
133-
<height>0</height>
134-
</size>
135-
</property>
136-
<property name="whatsThis">
137-
<string extracomment="Distance from the top of the canvas as a percentage of page height"/>
138-
</property>
139-
<property name="minimum">
140-
<number>0</number>
141-
</property>
142-
<property name="maximum">
143-
<number>100</number>
144-
</property>
145-
<property name="value">
146-
<number>0</number>
160+
<item row="1" column="2" colspan="3">
161+
<widget class="QComboBox" name="cboPlacement">
162+
<property name="toolTip">
163+
<string>Placement on screen</string>
147164
</property>
148165
</widget>
149166
</item>
150-
<item row="2" column="6">
151-
<widget class="QgsUnitSelectionWidget" name="wgtUnitSelection" native="true"/>
152-
</item>
153167
<item row="3" column="1" colspan="2">
154168
<widget class="QCheckBox" name="cboxAutomatic">
155169
<property name="sizePolicy">
@@ -191,14 +205,7 @@
191205
</property>
192206
</spacer>
193207
</item>
194-
<item row="1" column="2" colspan="4">
195-
<widget class="QComboBox" name="cboPlacement">
196-
<property name="toolTip">
197-
<string>Placement on screen</string>
198-
</property>
199-
</widget>
200-
</item>
201-
<item row="0" column="2" colspan="3">
208+
<item row="0" column="2" colspan="2">
202209
<widget class="QSlider" name="sliderRotation">
203210
<property name="toolTip">
204211
<string/>
@@ -273,10 +280,10 @@
273280
<tabstop>sliderRotation</tabstop>
274281
<tabstop>spinAngle</tabstop>
275282
<tabstop>cboPlacement</tabstop>
276-
<tabstop>spinHorizontal</tabstop>
277283
<tabstop>spinVertical</tabstop>
284+
<tabstop>spinHorizontal</tabstop>
285+
<tabstop>wgtUnitSelection</tabstop>
278286
<tabstop>cboxAutomatic</tabstop>
279-
<tabstop>buttonBox</tabstop>
280287
</tabstops>
281288
<resources/>
282289
<connections>

‎src/ui/qgsdecorationscalebardialog.ui‎

Lines changed: 61 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -104,57 +104,61 @@
104104
</property>
105105
</widget>
106106
</item>
107-
<item row="4" column="0">
108-
<widget class="QLabel" name="textLabel1_3">
107+
<item row="0" column="1">
108+
<widget class="QComboBox" name="cboPlacement">
109+
<property name="sizePolicy">
110+
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
111+
<horstretch>0</horstretch>
112+
<verstretch>0</verstretch>
113+
</sizepolicy>
114+
</property>
115+
</widget>
116+
</item>
117+
<item row="2" column="0">
118+
<widget class="QLabel" name="textLabel1">
109119
<property name="sizePolicy">
110120
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
111121
<horstretch>0</horstretch>
112122
<verstretch>0</verstretch>
113123
</sizepolicy>
114124
</property>
115125
<property name="text">
116-
<string>Size of bar</string>
126+
<string>Scale bar style</string>
117127
</property>
118128
<property name="buddy">
119-
<cstring>spnSize</cstring>
129+
<cstring>cboStyle</cstring>
120130
</property>
121131
</widget>
122132
</item>
123-
<item row="0" column="1">
124-
<widget class="QComboBox" name="cboPlacement">
133+
<item row="0" column="0">
134+
<widget class="QLabel" name="lblLocation">
125135
<property name="sizePolicy">
126-
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
136+
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
127137
<horstretch>0</horstretch>
128138
<verstretch>0</verstretch>
129139
</sizepolicy>
130140
</property>
131-
<property name="minimumSize">
132-
<size>
133-
<width>333</width>
134-
<height>0</height>
135-
</size>
141+
<property name="text">
142+
<string>Location</string>
136143
</property>
137-
<property name="maximumSize">
138-
<size>
139-
<width>333</width>
140-
<height>16777215</height>
141-
</size>
144+
<property name="buddy">
145+
<cstring>cboPlacement</cstring>
142146
</property>
143147
</widget>
144148
</item>
145-
<item row="2" column="0">
146-
<widget class="QLabel" name="textLabel1">
149+
<item row="4" column="0">
150+
<widget class="QLabel" name="textLabel1_3">
147151
<property name="sizePolicy">
148152
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
149153
<horstretch>0</horstretch>
150154
<verstretch>0</verstretch>
151155
</sizepolicy>
152156
</property>
153157
<property name="text">
154-
<string>Scale bar style</string>
158+
<string>Size of bar</string>
155159
</property>
156160
<property name="buddy">
157-
<cstring>cboStyle</cstring>
161+
<cstring>spnSize</cstring>
158162
</property>
159163
</widget>
160164
</item>
@@ -179,18 +183,6 @@
179183
<verstretch>0</verstretch>
180184
</sizepolicy>
181185
</property>
182-
<property name="minimumSize">
183-
<size>
184-
<width>333</width>
185-
<height>0</height>
186-
</size>
187-
</property>
188-
<property name="maximumSize">
189-
<size>
190-
<width>333</width>
191-
<height>16777215</height>
192-
</size>
193-
</property>
194186
<property name="toolTip">
195187
<string>Select the style of the scale bar</string>
196188
</property>
@@ -229,46 +221,38 @@
229221
</property>
230222
</widget>
231223
</item>
232-
<item row="0" column="0">
233-
<widget class="QLabel" name="lblLocation">
234-
<property name="sizePolicy">
235-
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
236-
<horstretch>0</horstretch>
237-
<verstretch>0</verstretch>
238-
</sizepolicy>
239-
</property>
240-
<property name="text">
241-
<string>Location</string>
242-
</property>
243-
<property name="buddy">
244-
<cstring>cboPlacement</cstring>
245-
</property>
246-
</widget>
247-
</item>
248224
<item row="4" column="1">
249-
<widget class="QgsSpinBox" name="spnSize">
250-
<property name="sizePolicy">
251-
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
252-
<horstretch>0</horstretch>
253-
<verstretch>0</verstretch>
254-
</sizepolicy>
255-
</property>
256-
<property name="minimumSize">
257-
<size>
258-
<width>333</width>
259-
<height>0</height>
260-
</size>
261-
</property>
262-
<property name="maximumSize">
263-
<size>
264-
<width>333</width>
265-
<height>16777215</height>
266-
</size>
267-
</property>
268-
</widget>
269-
</item>
270-
<item row="1" column="2">
271-
<widget class="QgsUnitSelectionWidget" name="wgtUnitSelection" native="true"/>
225+
<layout class="QHBoxLayout" name="horizontalLayout_3">
226+
<item>
227+
<widget class="QgsSpinBox" name="spnSize">
228+
<property name="sizePolicy">
229+
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
230+
<horstretch>0</horstretch>
231+
<verstretch>0</verstretch>
232+
</sizepolicy>
233+
</property>
234+
<property name="minimumSize">
235+
<size>
236+
<width>150</width>
237+
<height>0</height>
238+
</size>
239+
</property>
240+
</widget>
241+
</item>
242+
<item>
243+
<spacer name="horizontalSpacer">
244+
<property name="orientation">
245+
<enum>Qt::Horizontal</enum>
246+
</property>
247+
<property name="sizeHint" stdset="0">
248+
<size>
249+
<width>40</width>
250+
<height>20</height>
251+
</size>
252+
</property>
253+
</spacer>
254+
</item>
255+
</layout>
272256
</item>
273257
<item row="1" column="1">
274258
<layout class="QHBoxLayout" name="hlytMargin" stretch="0,0,0,0,0">
@@ -379,17 +363,11 @@
379363
</widget>
380364
</item>
381365
<item>
382-
<spacer name="horizontalSpacer_5">
383-
<property name="orientation">
384-
<enum>Qt::Horizontal</enum>
366+
<widget class="QgsUnitSelectionWidget" name="wgtUnitSelection" native="true">
367+
<property name="focusPolicy">
368+
<enum>Qt::StrongFocus</enum>
385369
</property>
386-
<property name="sizeHint" stdset="0">
387-
<size>
388-
<width>40</width>
389-
<height>20</height>
390-
</size>
391-
</property>
392-
</spacer>
370+
</widget>
393371
</item>
394372
</layout>
395373
</item>
@@ -423,11 +401,11 @@
423401
<tabstop>cboPlacement</tabstop>
424402
<tabstop>spnHorizontal</tabstop>
425403
<tabstop>spnVertical</tabstop>
404+
<tabstop>wgtUnitSelection</tabstop>
426405
<tabstop>cboStyle</tabstop>
427406
<tabstop>pbnChangeColor</tabstop>
428407
<tabstop>spnSize</tabstop>
429408
<tabstop>chkSnapping</tabstop>
430-
<tabstop>buttonBox</tabstop>
431409
</tabstops>
432410
<resources/>
433411
<connections/>

0 commit comments

Comments
 (0)
Please sign in to comment.