Skip to content

Commit 43b5ea1

Browse files
committed
Update UI for XYZ Connection.
1 parent 7293c05 commit 43b5ea1

File tree

3 files changed

+76
-16
lines changed

3 files changed

+76
-16
lines changed

src/providers/wms/qgsxyzconnectiondialog.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,27 @@ QgsXyzConnection QgsXyzConnectionDialog::connection() const
4444
conn.zMax = mSpinZMax->value();
4545
return conn;
4646
}
47+
48+
void QgsXyzConnectionDialog::on_mCheckBoxZMin_stateChanged( int state )
49+
{
50+
if ( state == Qt::Checked )
51+
{
52+
mSpinZMin->setEnabled( true );
53+
}
54+
else
55+
{
56+
mSpinZMin->setEnabled( false );
57+
}
58+
}
59+
60+
void QgsXyzConnectionDialog::on_mCheckBoxZMax_stateChanged( int state )
61+
{
62+
if ( state == Qt::Checked )
63+
{
64+
mSpinZMax->setEnabled( true );
65+
}
66+
else
67+
{
68+
mSpinZMax->setEnabled( false );
69+
}
70+
}

src/providers/wms/qgsxyzconnectiondialog.h

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class QgsXyzConnectionDialog : public QDialog, public Ui::QgsXyzConnectionDialog
3333

3434
QgsXyzConnection connection() const;
3535

36+
public slots:
37+
void on_mCheckBoxZMin_stateChanged( int state );
38+
void on_mCheckBoxZMax_stateChanged( int state );
39+
3640
};
3741

3842
#endif // QGSXYZCONNECTIONDIALOG_H

src/ui/qgsxyzconnectiondialog.ui

+48-16
Original file line numberDiff line numberDiff line change
@@ -15,57 +15,89 @@
1515
</property>
1616
<layout class="QVBoxLayout" name="verticalLayout">
1717
<item>
18-
<layout class="QFormLayout" name="formLayout">
19-
<item row="0" column="0">
20-
<widget class="QLabel" name="label">
21-
<property name="text">
22-
<string>Name</string>
18+
<layout class="QGridLayout" name="gridLayout">
19+
<item row="1" column="1">
20+
<widget class="QLineEdit" name="mEditUrl">
21+
<property name="placeholderText">
22+
<string>http://example.com/{z}/{x}/{y}.png</string>
2323
</property>
2424
</widget>
2525
</item>
26-
<item row="0" column="1">
27-
<widget class="QLineEdit" name="mEditName"/>
28-
</item>
2926
<item row="1" column="0">
3027
<widget class="QLabel" name="label_2">
3128
<property name="text">
3229
<string>URL</string>
3330
</property>
3431
</widget>
3532
</item>
36-
<item row="1" column="1">
37-
<widget class="QLineEdit" name="mEditUrl">
38-
<property name="placeholderText">
39-
<string>http://example.com/{z}/{x}/{y}.png</string>
40-
</property>
41-
</widget>
42-
</item>
4333
<item row="2" column="0">
4434
<widget class="QCheckBox" name="mCheckBoxZMin">
4535
<property name="text">
4636
<string>Min. Zoom Level</string>
4737
</property>
38+
<property name="checked">
39+
<bool>true</bool>
40+
</property>
41+
</widget>
42+
</item>
43+
<item row="0" column="0">
44+
<widget class="QLabel" name="label">
45+
<property name="text">
46+
<string>Name</string>
47+
</property>
4848
</widget>
4949
</item>
5050
<item row="2" column="1">
51-
<widget class="QSpinBox" name="mSpinZMin"/>
51+
<widget class="QSpinBox" name="mSpinZMin">
52+
<property name="sizePolicy">
53+
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
54+
<horstretch>0</horstretch>
55+
<verstretch>0</verstretch>
56+
</sizepolicy>
57+
</property>
58+
</widget>
5259
</item>
5360
<item row="3" column="0">
5461
<widget class="QCheckBox" name="mCheckBoxZMax">
5562
<property name="text">
5663
<string>Max. Zoom Level</string>
5764
</property>
65+
<property name="checked">
66+
<bool>true</bool>
67+
</property>
5868
</widget>
5969
</item>
6070
<item row="3" column="1">
6171
<widget class="QSpinBox" name="mSpinZMax">
72+
<property name="sizePolicy">
73+
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
74+
<horstretch>0</horstretch>
75+
<verstretch>0</verstretch>
76+
</sizepolicy>
77+
</property>
6278
<property name="value">
6379
<number>18</number>
6480
</property>
6581
</widget>
6682
</item>
83+
<item row="0" column="1">
84+
<widget class="QLineEdit" name="mEditName"/>
85+
</item>
6786
</layout>
6887
</item>
88+
<item>
89+
<spacer name="verticalSpacer">
90+
<property name="orientation">
91+
<enum>Qt::Vertical</enum>
92+
</property>
93+
<property name="sizeHint" stdset="0">
94+
<size>
95+
<width>20</width>
96+
<height>40</height>
97+
</size>
98+
</property>
99+
</spacer>
100+
</item>
69101
<item>
70102
<widget class="QDialogButtonBox" name="buttonBox">
71103
<property name="orientation">

0 commit comments

Comments
 (0)