Skip to content

Commit 5d38dcb

Browse files
authoredAug 23, 2016
Merge pull request #3427 from nyalldawson/inline_map_unit
[FEATURE] Make map unit scaling dialog show inline in style dock
2 parents 005147b + 5735be1 commit 5d38dcb

File tree

4 files changed

+359
-137
lines changed

4 files changed

+359
-137
lines changed
 

‎python/gui/qgsunitselectionwidget.sip

Lines changed: 86 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,87 @@
1-
/** Dialog allowing the user to choose the minimum and maximum scale of an object in map units */
1+
/** \class QgsMapUnitScaleWidget
2+
* \ingroup gui
3+
* A widget which allows the user to choose the minimum and maximum scale of an object in map units
4+
* and millimetres. This widget is designed to allow users to edit the properties of a
5+
* QgsMapUnitScale object.
6+
* \note added in QGIS 3.0
7+
* \see QgsMapUnitScaleDialog
8+
* \see QgsUnitSelectionWidget
9+
*/
10+
class QgsMapUnitScaleWidget : QgsPanelWidget
11+
{
12+
%TypeHeaderCode
13+
#include <qgsunitselectionwidget.h>
14+
%End
15+
public:
16+
17+
/** Constructor for QgsMapUnitScaleWidget.
18+
* @param parent parent widget
19+
*/
20+
QgsMapUnitScaleWidget( QWidget* parent /TransferThis/ = nullptr );
21+
22+
/** Returns a QgsMapUnitScale representing the settings shown in the
23+
* widget.
24+
* @see setMapUnitScale()
25+
* @see mapUnitScaleChanged()
26+
*/
27+
QgsMapUnitScale mapUnitScale() const;
28+
29+
/** Updates the widget to reflect the settings from the specified
30+
* QgsMapUnitScale object.
31+
* @param scale map unit scale to show in widget
32+
* @see mapUnitScale()
33+
* @see mapUnitScaleChanged()
34+
*/
35+
void setMapUnitScale( const QgsMapUnitScale& scale );
36+
37+
/** Sets the map canvas associated with the widget. This allows the
38+
* widget to retrieve the current map scale from the canvas.
39+
* @param canvas map canvas
40+
*/
41+
void setMapCanvas( QgsMapCanvas* canvas );
42+
43+
signals:
44+
45+
/** Emitted when the settings in the widget are modified.
46+
* @param scale QgsMapUnitScale reflecting new settings from the widget
47+
*/
48+
void mapUnitScaleChanged( const QgsMapUnitScale& scale );
49+
50+
};
51+
52+
53+
/** \class QgsMapUnitScaleDialog
54+
* \ingroup gui
55+
* A dialog which allows the user to choose the minimum and maximum scale of an object in map units
56+
* and millimetres. This dialog is designed to allow users to edit the properties of a
57+
* QgsMapUnitScale object.
58+
* \see QgsMapUnitScaleWidget
59+
* \see QgsUnitSelectionWidget
60+
*/
261
class QgsMapUnitScaleDialog : QDialog
362
{
463
%TypeHeaderCode
564
#include <qgsunitselectionwidget.h>
665
%End
766

867
public:
68+
69+
/** Constructor for QgsMapUnitScaleDialog.
70+
* @param parent parent widget
71+
*/
972
QgsMapUnitScaleDialog( QWidget* parent /TransferThis/ = 0);
1073

11-
/** Returns the map unit scale */
74+
/** Returns a QgsMapUnitScale representing the settings shown in the
75+
* dialog.
76+
* @see setMapUnitScale()
77+
*/
1278
QgsMapUnitScale getMapUnitScale() const;
13-
/** Sets the map unit scale */
79+
80+
/** Updates the dialog to reflect the settings from the specified
81+
* QgsMapUnitScale object.
82+
* @param scale map unit scale to show in dialog
83+
* @see mapUnitScale()
84+
*/
1485
void setMapUnitScale( const QgsMapUnitScale& scale );
1586

1687
/** Sets the map canvas associated with the dialog. This allows the dialog to retrieve the current
@@ -22,15 +93,25 @@ class QgsMapUnitScaleDialog : QDialog
2293

2394
};
2495

25-
/** Widget displaying a combobox allowing the user to choose between millimeter and map units
26-
* If the user chooses map units, a button appears allowing the specification of minimum and maximum scale */
96+
/** \class QgsUnitSelectionWidget
97+
* \ingroup gui
98+
* A widget displaying a combobox allowing the user to choose between various display units,
99+
* such as millimeters or map unit. If the user chooses map units, a button appears allowing
100+
* adjustment of minimum and maximum scaling.
101+
* \see QgsMapUnitScaleWidget
102+
* \see QgsMapUnitScaleDialog
103+
*/
27104
class QgsUnitSelectionWidget : QWidget
28105
{
29106
%TypeHeaderCode
30107
#include <qgsunitselectionwidget.h>
31108
%End
32109

33110
public:
111+
112+
/** Constructor for QgsUnitSelectionWidget.
113+
* @param parent parent widget
114+
*/
34115
QgsUnitSelectionWidget( QWidget* parent /TransferThis/ = 0 );
35116

36117
/** Sets the units which the user can choose from in the combobox.

‎src/gui/qgsunitselectionwidget.cpp

Lines changed: 90 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
***************************************************************************/
1818

1919
#include "qgsunitselectionwidget.h"
20+
#include <QDialogButtonBox>
2021

21-
QgsMapUnitScaleDialog::QgsMapUnitScaleDialog( QWidget* parent )
22-
: QDialog( parent )
22+
QgsMapUnitScaleWidget::QgsMapUnitScaleWidget( QWidget* parent )
23+
: QgsPanelWidget( parent )
24+
, mBlockSignals( true )
2325
{
2426
setupUi( this );
2527
mComboBoxMinScale->setScale( 0.0000001 );
@@ -34,10 +36,24 @@ QgsMapUnitScaleDialog::QgsMapUnitScaleDialog( QWidget* parent )
3436

3537
connect( mCheckBoxMinSize, SIGNAL( toggled( bool ) ), mSpinBoxMinSize, SLOT( setEnabled( bool ) ) );
3638
connect( mCheckBoxMaxSize, SIGNAL( toggled( bool ) ), mSpinBoxMaxSize, SLOT( setEnabled( bool ) ) );
39+
40+
// notification of setting changes
41+
connect( mCheckBoxMinScale, SIGNAL( toggled( bool ) ), this, SLOT( settingsChanged() ) );
42+
connect( mCheckBoxMaxScale, SIGNAL( toggled( bool ) ), this, SLOT( settingsChanged() ) );
43+
connect( mComboBoxMinScale, SIGNAL( scaleChanged( double ) ), this, SLOT( settingsChanged() ) );
44+
connect( mComboBoxMaxScale, SIGNAL( scaleChanged( double ) ), this, SLOT( settingsChanged() ) );
45+
connect( mCheckBoxMinSize, SIGNAL( toggled( bool ) ), this, SLOT( settingsChanged() ) );
46+
connect( mCheckBoxMaxSize, SIGNAL( toggled( bool ) ), this, SLOT( settingsChanged() ) );
47+
connect( mSpinBoxMinSize, SIGNAL( valueChanged( double ) ), this, SLOT( settingsChanged() ) );
48+
connect( mSpinBoxMaxSize, SIGNAL( valueChanged( double ) ), this, SLOT( settingsChanged() ) );
49+
mBlockSignals = false;
3750
}
3851

39-
void QgsMapUnitScaleDialog::setMapUnitScale( const QgsMapUnitScale &scale )
52+
void QgsMapUnitScaleWidget::setMapUnitScale( const QgsMapUnitScale &scale )
4053
{
54+
// can't block signals on the widgets themselves, some use them to update
55+
// internal states
56+
mBlockSignals = true;
4157
mComboBoxMinScale->setScale( scale.minScale > 0.0 ? scale.minScale : 0.0000001 );
4258
mCheckBoxMinScale->setChecked( scale.minScale > 0.0 );
4359
mComboBoxMinScale->setEnabled( scale.minScale > 0.0 );
@@ -52,17 +68,20 @@ void QgsMapUnitScaleDialog::setMapUnitScale( const QgsMapUnitScale &scale )
5268
mCheckBoxMaxSize->setChecked( scale.maxSizeMMEnabled );
5369
mSpinBoxMaxSize->setEnabled( scale.maxSizeMMEnabled );
5470
mSpinBoxMaxSize->setValue( scale.maxSizeMM );
71+
mBlockSignals = false;
72+
73+
settingsChanged();
5574
}
5675

57-
void QgsMapUnitScaleDialog::setMapCanvas( QgsMapCanvas *canvas )
76+
void QgsMapUnitScaleWidget::setMapCanvas( QgsMapCanvas *canvas )
5877
{
5978
mComboBoxMinScale->setMapCanvas( canvas );
6079
mComboBoxMinScale->setShowCurrentScaleButton( true );
6180
mComboBoxMaxScale->setMapCanvas( canvas );
6281
mComboBoxMaxScale->setShowCurrentScaleButton( true );
6382
}
6483

65-
void QgsMapUnitScaleDialog::configureMinComboBox()
84+
void QgsMapUnitScaleWidget::configureMinComboBox()
6685
{
6786
mComboBoxMinScale->setEnabled( mCheckBoxMinScale->isChecked() );
6887
if ( mCheckBoxMinScale->isChecked() && mComboBoxMinScale->scale() > mComboBoxMaxScale->scale() )
@@ -71,7 +90,7 @@ void QgsMapUnitScaleDialog::configureMinComboBox()
7190
}
7291
}
7392

74-
void QgsMapUnitScaleDialog::configureMaxComboBox()
93+
void QgsMapUnitScaleWidget::configureMaxComboBox()
7594
{
7695
mComboBoxMaxScale->setEnabled( mCheckBoxMaxScale->isChecked() );
7796
if ( mCheckBoxMaxScale->isChecked() && mComboBoxMaxScale->scale() < mComboBoxMinScale->scale() )
@@ -80,7 +99,15 @@ void QgsMapUnitScaleDialog::configureMaxComboBox()
8099
}
81100
}
82101

83-
QgsMapUnitScale QgsMapUnitScaleDialog::getMapUnitScale() const
102+
void QgsMapUnitScaleWidget::settingsChanged()
103+
{
104+
if ( mBlockSignals )
105+
return;
106+
107+
emit mapUnitScaleChanged( mapUnitScale() );
108+
}
109+
110+
QgsMapUnitScale QgsMapUnitScaleWidget::mapUnitScale() const
84111
{
85112
QgsMapUnitScale scale;
86113
scale.minScale = mCheckBoxMinScale->isChecked() ? mComboBoxMinScale->scale() : 0;
@@ -92,11 +119,14 @@ QgsMapUnitScale QgsMapUnitScaleDialog::getMapUnitScale() const
92119
return scale;
93120
}
94121

122+
123+
124+
125+
95126
QgsUnitSelectionWidget::QgsUnitSelectionWidget( QWidget *parent )
96127
: QWidget( parent )
97128
{
98129
mMapUnitIdx = -1;
99-
mUnitScaleDialog = new QgsMapUnitScaleDialog( this );
100130

101131
setupUi( this );
102132
mMapScaleButton->setVisible( false );
@@ -175,21 +205,31 @@ void QgsUnitSelectionWidget::setUnit( QgsUnitTypes::RenderUnit unit )
175205

176206
void QgsUnitSelectionWidget::setMapCanvas( QgsMapCanvas *canvas )
177207
{
178-
mUnitScaleDialog->setMapCanvas( canvas );
208+
mCanvas = canvas;
179209
}
180210

181211
void QgsUnitSelectionWidget::showDialog()
182212
{
183-
QgsMapUnitScale scale = mUnitScaleDialog->getMapUnitScale();
184-
if ( mUnitScaleDialog->exec() != QDialog::Accepted )
213+
QgsPanelWidget* panel = QgsPanelWidget::findParentPanel( this );
214+
if ( panel && panel->dockMode() )
185215
{
186-
mUnitScaleDialog->setMapUnitScale( scale );
216+
QgsMapUnitScaleWidget* widget = new QgsMapUnitScaleWidget( panel );
217+
widget->setPanelTitle( tr( "Adjust scaling range" ) );
218+
widget->setMapCanvas( mCanvas );
219+
widget->setMapUnitScale( mMapUnitScale );
220+
connect( widget, SIGNAL( mapUnitScaleChanged( QgsMapUnitScale ) ), this, SLOT( widgetChanged( QgsMapUnitScale ) ) );
221+
panel->openPanel( widget );
222+
return;
187223
}
188-
else
224+
225+
QgsMapUnitScaleDialog dlg( this );
226+
dlg.setMapUnitScale( mMapUnitScale );
227+
dlg.setMapCanvas( mCanvas );
228+
if ( dlg.exec() == QDialog::Accepted )
189229
{
190-
QgsMapUnitScale newScale = mUnitScaleDialog->getMapUnitScale();
191-
if ( scale != newScale )
230+
if ( mMapUnitScale != dlg.getMapUnitScale() )
192231
{
232+
mMapUnitScale = dlg.getMapUnitScale();
193233
emit changed();
194234
}
195235
}
@@ -207,3 +247,38 @@ void QgsUnitSelectionWidget::toggleUnitRangeButton()
207247
}
208248
}
209249

250+
void QgsUnitSelectionWidget::widgetChanged( const QgsMapUnitScale& scale )
251+
{
252+
mMapUnitScale = scale;
253+
emit changed();
254+
}
255+
256+
257+
QgsMapUnitScaleDialog::QgsMapUnitScaleDialog( QWidget* parent )
258+
: QDialog( parent )
259+
, mWidget( nullptr )
260+
{
261+
QVBoxLayout* vLayout = new QVBoxLayout();
262+
mWidget = new QgsMapUnitScaleWidget();
263+
vLayout->addWidget( mWidget );
264+
QDialogButtonBox* bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
265+
connect( bbox, SIGNAL( accepted() ), this, SLOT( accept() ) );
266+
connect( bbox, SIGNAL( rejected() ), this, SLOT( reject() ) );
267+
vLayout->addWidget( bbox );
268+
setLayout( vLayout );
269+
}
270+
271+
QgsMapUnitScale QgsMapUnitScaleDialog::getMapUnitScale() const
272+
{
273+
return mWidget->mapUnitScale();
274+
}
275+
276+
void QgsMapUnitScaleDialog::setMapUnitScale( const QgsMapUnitScale& scale )
277+
{
278+
mWidget->setMapUnitScale( scale );
279+
}
280+
281+
void QgsMapUnitScaleDialog::setMapCanvas( QgsMapCanvas* canvas )
282+
{
283+
mWidget->setMapCanvas( canvas );
284+
}

‎src/gui/qgsunitselectionwidget.h

Lines changed: 110 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,105 @@
1919
#define QGSUNITSELECTIONWIDGET_H
2020

2121
#include <QWidget>
22+
#include <QDialog>
23+
#include "qgspanelwidget.h"
2224
#include "qgssymbol.h"
2325
#include "ui_qgsunitselectionwidget.h"
24-
#include "ui_qgsmapunitscaledialog.h"
26+
#include "ui_qgsmapunitscalewidgetbase.h"
2527

2628
class QgsMapCanvas;
2729

28-
/** \ingroup gui
29-
* Dialog allowing the user to choose the minimum and maximum scale of an object in map units */
30-
class GUI_EXPORT QgsMapUnitScaleDialog : public QDialog, private Ui::QgsMapUnitScaleDialog
30+
/** \class QgsMapUnitScaleWidget
31+
* \ingroup gui
32+
* A widget which allows the user to choose the minimum and maximum scale of an object in map units
33+
* and millimetres. This widget is designed to allow users to edit the properties of a
34+
* QgsMapUnitScale object.
35+
* \note added in QGIS 3.0
36+
* \see QgsMapUnitScaleDialog
37+
* \see QgsUnitSelectionWidget
38+
*/
39+
class GUI_EXPORT QgsMapUnitScaleWidget : public QgsPanelWidget, private Ui::QgsMapUnitScaleWidgetBase
3140
{
3241
Q_OBJECT
42+
Q_PROPERTY( QgsMapUnitScale mapUnitScale READ mapUnitScale WRITE setMapUnitScale NOTIFY mapUnitScaleChanged )
3343

3444
public:
45+
46+
/** Constructor for QgsMapUnitScaleWidget.
47+
* @param parent parent widget
48+
*/
49+
QgsMapUnitScaleWidget( QWidget* parent = nullptr );
50+
51+
/** Returns a QgsMapUnitScale representing the settings shown in the
52+
* widget.
53+
* @see setMapUnitScale()
54+
* @see mapUnitScaleChanged()
55+
*/
56+
QgsMapUnitScale mapUnitScale() const;
57+
58+
/** Updates the widget to reflect the settings from the specified
59+
* QgsMapUnitScale object.
60+
* @param scale map unit scale to show in widget
61+
* @see mapUnitScale()
62+
* @see mapUnitScaleChanged()
63+
*/
64+
void setMapUnitScale( const QgsMapUnitScale& scale );
65+
66+
/** Sets the map canvas associated with the widget. This allows the
67+
* widget to retrieve the current map scale from the canvas.
68+
* @param canvas map canvas
69+
*/
70+
void setMapCanvas( QgsMapCanvas* canvas );
71+
72+
signals:
73+
74+
/** Emitted when the settings in the widget are modified.
75+
* @param scale QgsMapUnitScale reflecting new settings from the widget
76+
*/
77+
void mapUnitScaleChanged( const QgsMapUnitScale& scale );
78+
79+
private slots:
80+
void configureMinComboBox();
81+
void configureMaxComboBox();
82+
void settingsChanged();
83+
84+
private:
85+
86+
bool mBlockSignals;
87+
88+
};
89+
90+
/** \class QgsMapUnitScaleDialog
91+
* \ingroup gui
92+
* A dialog which allows the user to choose the minimum and maximum scale of an object in map units
93+
* and millimetres. This dialog is designed to allow users to edit the properties of a
94+
* QgsMapUnitScale object.
95+
* \see QgsMapUnitScaleWidget
96+
* \see QgsUnitSelectionWidget
97+
*/
98+
class GUI_EXPORT QgsMapUnitScaleDialog : public QDialog
99+
{
100+
Q_OBJECT
101+
Q_PROPERTY( QgsMapUnitScale mapUnitScale READ getMapUnitScale WRITE setMapUnitScale )
102+
103+
public:
104+
105+
/** Constructor for QgsMapUnitScaleDialog.
106+
* @param parent parent widget
107+
*/
35108
QgsMapUnitScaleDialog( QWidget* parent = nullptr );
36109

37-
/** Returns the map unit scale */
110+
/** Returns a QgsMapUnitScale representing the settings shown in the
111+
* dialog.
112+
* @see setMapUnitScale()
113+
*/
38114
QgsMapUnitScale getMapUnitScale() const;
39-
/** Sets the map unit scale */
115+
116+
/** Updates the dialog to reflect the settings from the specified
117+
* QgsMapUnitScale object.
118+
* @param scale map unit scale to show in dialog
119+
* @see mapUnitScale()
120+
*/
40121
void setMapUnitScale( const QgsMapUnitScale& scale );
41122

42123
/** Sets the map canvas associated with the dialog. This allows the dialog to retrieve the current
@@ -46,24 +127,29 @@ class GUI_EXPORT QgsMapUnitScaleDialog : public QDialog, private Ui::QgsMapUnitS
46127
*/
47128
void setMapCanvas( QgsMapCanvas* canvas );
48129

49-
private slots:
50-
void configureMinComboBox();
51-
void configureMaxComboBox();
130+
private:
131+
132+
QgsMapUnitScaleWidget* mWidget;
52133

53134
};
54135

55-
/** \ingroup gui
56-
* Widget displaying a combobox allowing the user to choose between millimeter and map units
57-
* If the user chooses map units, a button appears allowing the specification of minimum and maximum scale */
136+
/** \class QgsUnitSelectionWidget
137+
* \ingroup gui
138+
* A widget displaying a combobox allowing the user to choose between various display units,
139+
* such as millimeters or map unit. If the user chooses map units, a button appears allowing
140+
* adjustment of minimum and maximum scaling.
141+
* \see QgsMapUnitScaleWidget
142+
* \see QgsMapUnitScaleDialog
143+
*/
58144
class GUI_EXPORT QgsUnitSelectionWidget : public QWidget, private Ui::QgsUnitSelectionWidget
59145
{
60146
Q_OBJECT
61147

62-
private:
63-
QgsMapUnitScaleDialog* mUnitScaleDialog;
64-
int mMapUnitIdx;
65-
66148
public:
149+
150+
/** Constructor for QgsUnitSelectionWidget.
151+
* @param parent parent widget
152+
*/
67153
QgsUnitSelectionWidget( QWidget* parent = nullptr );
68154

69155
/** Sets the units which the user can choose from in the combobox.
@@ -99,10 +185,10 @@ class GUI_EXPORT QgsUnitSelectionWidget : public QWidget, private Ui::QgsUnitSel
99185
void setUnit( QgsUnitTypes::RenderUnit unit );
100186

101187
/** Returns the map unit scale */
102-
QgsMapUnitScale getMapUnitScale() const { return mUnitScaleDialog->getMapUnitScale(); }
188+
QgsMapUnitScale getMapUnitScale() const { return mMapUnitScale; }
103189

104190
/** Sets the map unit scale */
105-
void setMapUnitScale( const QgsMapUnitScale& scale ) { mUnitScaleDialog->setMapUnitScale( scale ); }
191+
void setMapUnitScale( const QgsMapUnitScale& scale ) { mMapUnitScale = scale; }
106192

107193
/** Sets the map canvas associated with the widget. This allows the widget to retrieve the current
108194
* map scale from the canvas.
@@ -117,6 +203,12 @@ class GUI_EXPORT QgsUnitSelectionWidget : public QWidget, private Ui::QgsUnitSel
117203
private slots:
118204
void showDialog();
119205
void toggleUnitRangeButton();
206+
void widgetChanged( const QgsMapUnitScale& scale );
207+
208+
private:
209+
QgsMapUnitScale mMapUnitScale;
210+
int mMapUnitIdx;
211+
QgsMapCanvas* mCanvas;
120212

121213
};
122214

Lines changed: 73 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ui version="4.0">
3-
<class>QgsMapUnitScaleDialog</class>
4-
<widget class="QDialog" name="QgsMapUnitScaleDialog">
3+
<class>QgsMapUnitScaleWidgetBase</class>
4+
<widget class="QgsPanelWidget" name="QgsMapUnitScaleWidgetBase">
55
<property name="geometry">
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>443</width>
10-
<height>291</height>
9+
<width>316</width>
10+
<height>276</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -18,67 +18,19 @@
1818
<normaloff>:/images/themes/default/mActionOptions.png</normaloff>:/images/themes/default/mActionOptions.png</iconset>
1919
</property>
2020
<layout class="QGridLayout" name="gridLayout">
21-
<item row="3" column="0" colspan="3">
22-
<widget class="QGroupBox" name="groupBox_2">
23-
<property name="title">
24-
<string>Size range</string>
25-
</property>
26-
<layout class="QGridLayout" name="gridLayout_3">
27-
<item row="1" column="0">
28-
<widget class="QCheckBox" name="mCheckBoxMinSize">
29-
<property name="text">
30-
<string>Minimum size:</string>
31-
</property>
32-
</widget>
33-
</item>
34-
<item row="2" column="0">
35-
<widget class="QCheckBox" name="mCheckBoxMaxSize">
36-
<property name="text">
37-
<string>Maximum size:</string>
38-
</property>
39-
</widget>
40-
</item>
41-
<item row="1" column="1">
42-
<widget class="QgsDoubleSpinBox" name="mSpinBoxMinSize">
43-
<property name="suffix">
44-
<string> mm</string>
45-
</property>
46-
<property name="maximum">
47-
<double>9999999.000000000000000</double>
48-
</property>
49-
</widget>
50-
</item>
51-
<item row="2" column="1">
52-
<widget class="QgsDoubleSpinBox" name="mSpinBoxMaxSize">
53-
<property name="suffix">
54-
<string> mm</string>
55-
</property>
56-
<property name="maximum">
57-
<double>999999.000000000000000</double>
58-
</property>
59-
</widget>
60-
</item>
61-
<item row="0" column="0" colspan="2">
62-
<widget class="QLabel" name="label_2">
63-
<property name="text">
64-
<string>Scale only within the following size range:</string>
65-
</property>
66-
</widget>
67-
</item>
68-
</layout>
69-
</widget>
70-
</item>
71-
<item row="5" column="0" colspan="3">
72-
<widget class="QDialogButtonBox" name="mButtonBox">
73-
<property name="orientation">
74-
<enum>Qt::Horizontal</enum>
75-
</property>
76-
<property name="standardButtons">
77-
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
78-
</property>
79-
</widget>
80-
</item>
81-
<item row="0" column="0" colspan="3">
21+
<property name="leftMargin">
22+
<number>3</number>
23+
</property>
24+
<property name="topMargin">
25+
<number>3</number>
26+
</property>
27+
<property name="rightMargin">
28+
<number>3</number>
29+
</property>
30+
<property name="bottomMargin">
31+
<number>3</number>
32+
</property>
33+
<item row="0" column="0" colspan="2">
8234
<widget class="QGroupBox" name="groupBox">
8335
<property name="title">
8436
<string>Scale range</string>
@@ -138,6 +90,56 @@
13890
</property>
13991
</spacer>
14092
</item>
93+
<item row="3" column="0" colspan="2">
94+
<widget class="QGroupBox" name="groupBox_2">
95+
<property name="title">
96+
<string>Size range</string>
97+
</property>
98+
<layout class="QGridLayout" name="gridLayout_3">
99+
<item row="1" column="0">
100+
<widget class="QCheckBox" name="mCheckBoxMinSize">
101+
<property name="text">
102+
<string>Minimum size:</string>
103+
</property>
104+
</widget>
105+
</item>
106+
<item row="2" column="0">
107+
<widget class="QCheckBox" name="mCheckBoxMaxSize">
108+
<property name="text">
109+
<string>Maximum size:</string>
110+
</property>
111+
</widget>
112+
</item>
113+
<item row="1" column="1">
114+
<widget class="QgsDoubleSpinBox" name="mSpinBoxMinSize">
115+
<property name="suffix">
116+
<string> mm</string>
117+
</property>
118+
<property name="maximum">
119+
<double>9999999.000000000000000</double>
120+
</property>
121+
</widget>
122+
</item>
123+
<item row="2" column="1">
124+
<widget class="QgsDoubleSpinBox" name="mSpinBoxMaxSize">
125+
<property name="suffix">
126+
<string> mm</string>
127+
</property>
128+
<property name="maximum">
129+
<double>999999.000000000000000</double>
130+
</property>
131+
</widget>
132+
</item>
133+
<item row="0" column="0" colspan="2">
134+
<widget class="QLabel" name="label_2">
135+
<property name="text">
136+
<string>Scale only within the following size range:</string>
137+
</property>
138+
</widget>
139+
</item>
140+
</layout>
141+
</widget>
142+
</item>
141143
</layout>
142144
</widget>
143145
<customwidgets>
@@ -151,6 +153,11 @@
151153
<extends>QDoubleSpinBox</extends>
152154
<header>qgsdoublespinbox.h</header>
153155
</customwidget>
156+
<customwidget>
157+
<class>QgsPanelWidget</class>
158+
<extends>QWidget</extends>
159+
<header>qgspanelwidget.h</header>
160+
</customwidget>
154161
</customwidgets>
155162
<tabstops>
156163
<tabstop>mCheckBoxMinScale</tabstop>
@@ -163,38 +170,5 @@
163170
<tabstop>mSpinBoxMaxSize</tabstop>
164171
</tabstops>
165172
<resources/>
166-
<connections>
167-
<connection>
168-
<sender>mButtonBox</sender>
169-
<signal>accepted()</signal>
170-
<receiver>QgsMapUnitScaleDialog</receiver>
171-
<slot>accept()</slot>
172-
<hints>
173-
<hint type="sourcelabel">
174-
<x>248</x>
175-
<y>254</y>
176-
</hint>
177-
<hint type="destinationlabel">
178-
<x>157</x>
179-
<y>274</y>
180-
</hint>
181-
</hints>
182-
</connection>
183-
<connection>
184-
<sender>mButtonBox</sender>
185-
<signal>rejected()</signal>
186-
<receiver>QgsMapUnitScaleDialog</receiver>
187-
<slot>reject()</slot>
188-
<hints>
189-
<hint type="sourcelabel">
190-
<x>316</x>
191-
<y>260</y>
192-
</hint>
193-
<hint type="destinationlabel">
194-
<x>286</x>
195-
<y>274</y>
196-
</hint>
197-
</hints>
198-
</connection>
199-
</connections>
173+
<connections/>
200174
</ui>

0 commit comments

Comments
 (0)
Please sign in to comment.