Skip to content

Commit 39e1c46

Browse files
authored
Merge pull request #6167 from DelazJ/DBManagerQueryDialog
[DB Manager]Allow preset query combobox to expand
2 parents 89259e8 + 3e0b6a3 commit 39e1c46

File tree

3 files changed

+300
-286
lines changed

3 files changed

+300
-286
lines changed

python/plugins/db_manager/ui/DlgQueryBuilder.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
14-
<string>SQL query builder</string>
14+
<string>SQL Query Builder</string>
1515
</property>
1616
<layout class="QVBoxLayout" name="verticalLayout_7">
1717
<item>

python/plugins/db_manager/ui/DlgSqlLayerWindow.ui

+145-142
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,58 @@
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
14-
<string>SQL window</string>
14+
<string>SQL Window</string>
1515
</property>
1616
<layout class="QGridLayout" name="gridLayout_2">
17+
<item row="1" column="3">
18+
<widget class="QPushButton" name="getColumnsBtn">
19+
<property name="text">
20+
<string>Retrieve
21+
columns</string>
22+
</property>
23+
</widget>
24+
</item>
25+
<item row="3" column="3">
26+
<widget class="QPushButton" name="updateLayerBtn">
27+
<property name="text">
28+
<string>Update</string>
29+
</property>
30+
</widget>
31+
</item>
32+
<item row="2" column="3">
33+
<widget class="QPushButton" name="btnSetFilter">
34+
<property name="text">
35+
<string>Set filter</string>
36+
</property>
37+
<property name="autoDefault">
38+
<bool>false</bool>
39+
</property>
40+
</widget>
41+
</item>
42+
<item row="3" column="2">
43+
<spacer name="horizontalSpacer_2">
44+
<property name="orientation">
45+
<enum>Qt::Horizontal</enum>
46+
</property>
47+
<property name="sizeHint" stdset="0">
48+
<size>
49+
<width>40</width>
50+
<height>20</height>
51+
</size>
52+
</property>
53+
</spacer>
54+
</item>
1755
<item row="3" column="0">
18-
<layout class="QHBoxLayout" name="horizontalLayout_2">
19-
<item>
20-
<widget class="QCheckBox" name="avoidSelectById">
21-
<property name="toolTip">
22-
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Avoid selecting feature by id. Sometimes - especially when running expensive queries/views - fetching the data sequentially instead of fetching features by id can be much quicker.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
23-
</property>
24-
<property name="text">
25-
<string>Avoid selecting by feature id</string>
26-
</property>
27-
</widget>
28-
</item>
29-
<item>
30-
<spacer name="horizontalSpacer_2">
31-
<property name="orientation">
32-
<enum>Qt::Horizontal</enum>
33-
</property>
34-
<property name="sizeHint" stdset="0">
35-
<size>
36-
<width>40</width>
37-
<height>20</height>
38-
</size>
39-
</property>
40-
</spacer>
41-
</item>
42-
<item>
43-
<widget class="QPushButton" name="updateLayerBtn">
44-
<property name="text">
45-
<string>Update</string>
46-
</property>
47-
</widget>
48-
</item>
49-
</layout>
56+
<widget class="QCheckBox" name="avoidSelectById">
57+
<property name="toolTip">
58+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Avoid selecting feature by id. Sometimes - especially when running expensive queries/views - fetching the data sequentially instead of fetching features by id can be much quicker.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
59+
</property>
60+
<property name="text">
61+
<string>Avoid selecting by feature id</string>
62+
</property>
63+
</widget>
5064
</item>
51-
<item row="0" column="0">
65+
<item row="0" column="0" colspan="4">
5266
<widget class="QSplitter" name="splitter">
5367
<property name="orientation">
5468
<enum>Qt::Vertical</enum>
@@ -80,12 +94,19 @@
8094
<item>
8195
<widget class="QLabel" name="label">
8296
<property name="text">
83-
<string>Saved query:</string>
97+
<string>Saved query</string>
8498
</property>
8599
</widget>
86100
</item>
87101
<item>
88-
<widget class="QComboBox" name="presetCombo"/>
102+
<widget class="QComboBox" name="presetCombo">
103+
<property name="sizePolicy">
104+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
105+
<horstretch>1</horstretch>
106+
<verstretch>0</verstretch>
107+
</sizepolicy>
108+
</property>
109+
</widget>
89110
</item>
90111
<item>
91112
<widget class="QLabel" name="label_2">
@@ -96,6 +117,12 @@
96117
</item>
97118
<item>
98119
<widget class="QLineEdit" name="presetName">
120+
<property name="sizePolicy">
121+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
122+
<horstretch>1</horstretch>
123+
<verstretch>0</verstretch>
124+
</sizepolicy>
125+
</property>
99126
<property name="text">
100127
<string notr="true"/>
101128
</property>
@@ -104,7 +131,7 @@
104131
<item>
105132
<widget class="QPushButton" name="presetStore">
106133
<property name="text">
107-
<string>Store</string>
134+
<string>Save</string>
108135
</property>
109136
</widget>
110137
</item>
@@ -185,91 +212,7 @@
185212
</widget>
186213
</widget>
187214
</item>
188-
<item row="1" column="0">
189-
<layout class="QHBoxLayout" name="horizontalLayout_6">
190-
<item>
191-
<widget class="QCheckBox" name="uniqueColumnCheck">
192-
<property name="text">
193-
<string>Column(s) with
194-
unique values</string>
195-
</property>
196-
</widget>
197-
</item>
198-
<item>
199-
<widget class="QComboBox" name="uniqueCombo">
200-
<property name="enabled">
201-
<bool>false</bool>
202-
</property>
203-
<property name="sizePolicy">
204-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
205-
<horstretch>0</horstretch>
206-
<verstretch>0</verstretch>
207-
</sizepolicy>
208-
</property>
209-
<property name="editable">
210-
<bool>true</bool>
211-
</property>
212-
<property name="insertPolicy">
213-
<enum>QComboBox::NoInsert</enum>
214-
</property>
215-
</widget>
216-
</item>
217-
<item>
218-
<widget class="QCheckBox" name="hasGeometryCol">
219-
<property name="text">
220-
<string>Geometry column</string>
221-
</property>
222-
<property name="checked">
223-
<bool>true</bool>
224-
</property>
225-
<property name="tristate">
226-
<bool>false</bool>
227-
</property>
228-
</widget>
229-
</item>
230-
<item>
231-
<widget class="QComboBox" name="geomCombo">
232-
<property name="sizePolicy">
233-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
234-
<horstretch>0</horstretch>
235-
<verstretch>0</verstretch>
236-
</sizepolicy>
237-
</property>
238-
<property name="editable">
239-
<bool>true</bool>
240-
</property>
241-
<property name="insertPolicy">
242-
<enum>QComboBox::NoInsert</enum>
243-
</property>
244-
</widget>
245-
</item>
246-
<item>
247-
<spacer name="horizontalSpacer_5">
248-
<property name="orientation">
249-
<enum>Qt::Horizontal</enum>
250-
</property>
251-
<property name="sizeType">
252-
<enum>QSizePolicy::Fixed</enum>
253-
</property>
254-
<property name="sizeHint" stdset="0">
255-
<size>
256-
<width>40</width>
257-
<height>20</height>
258-
</size>
259-
</property>
260-
</spacer>
261-
</item>
262-
<item>
263-
<widget class="QPushButton" name="getColumnsBtn">
264-
<property name="text">
265-
<string>Retrieve
266-
columns</string>
267-
</property>
268-
</widget>
269-
</item>
270-
</layout>
271-
</item>
272-
<item row="2" column="0">
215+
<item row="2" column="0" colspan="3">
273216
<layout class="QHBoxLayout" name="horizontalLayout_7">
274217
<item>
275218
<widget class="QLabel" name="label_5">
@@ -294,7 +237,16 @@ columns</string>
294237
<item>
295238
<widget class="QWidget" name="layerTypeWidget" native="true">
296239
<layout class="QHBoxLayout" name="horizontalLayout_3">
297-
<property name="margin">
240+
<property name="leftMargin">
241+
<number>0</number>
242+
</property>
243+
<property name="topMargin">
244+
<number>0</number>
245+
</property>
246+
<property name="rightMargin">
247+
<number>0</number>
248+
</property>
249+
<property name="bottomMargin">
298250
<number>0</number>
299251
</property>
300252
<item>
@@ -324,35 +276,69 @@ columns</string>
324276
</property>
325277
</widget>
326278
</item>
327-
<item>
328-
<spacer name="horizontalSpacer_6">
329-
<property name="orientation">
330-
<enum>Qt::Horizontal</enum>
331-
</property>
332-
<property name="sizeType">
333-
<enum>QSizePolicy::Fixed</enum>
334-
</property>
335-
<property name="sizeHint" stdset="0">
336-
<size>
337-
<width>40</width>
338-
<height>20</height>
339-
</size>
340-
</property>
341-
</spacer>
342-
</item>
343279
</layout>
344280
</widget>
345281
</item>
282+
</layout>
283+
</item>
284+
<item row="1" column="0" colspan="3">
285+
<layout class="QHBoxLayout" name="horizontalLayout_6">
346286
<item>
347-
<widget class="QPushButton" name="btnSetFilter">
287+
<widget class="QCheckBox" name="uniqueColumnCheck">
348288
<property name="text">
349-
<string>Set filter</string>
289+
<string>Column(s) with
290+
unique values</string>
350291
</property>
351-
<property name="autoDefault">
292+
</widget>
293+
</item>
294+
<item>
295+
<widget class="QComboBox" name="uniqueCombo">
296+
<property name="enabled">
297+
<bool>false</bool>
298+
</property>
299+
<property name="sizePolicy">
300+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
301+
<horstretch>0</horstretch>
302+
<verstretch>0</verstretch>
303+
</sizepolicy>
304+
</property>
305+
<property name="editable">
306+
<bool>true</bool>
307+
</property>
308+
<property name="insertPolicy">
309+
<enum>QComboBox::NoInsert</enum>
310+
</property>
311+
</widget>
312+
</item>
313+
<item>
314+
<widget class="QCheckBox" name="hasGeometryCol">
315+
<property name="text">
316+
<string>Geometry column</string>
317+
</property>
318+
<property name="checked">
319+
<bool>true</bool>
320+
</property>
321+
<property name="tristate">
352322
<bool>false</bool>
353323
</property>
354324
</widget>
355325
</item>
326+
<item>
327+
<widget class="QComboBox" name="geomCombo">
328+
<property name="sizePolicy">
329+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
330+
<horstretch>0</horstretch>
331+
<verstretch>0</verstretch>
332+
</sizepolicy>
333+
</property>
334+
<property name="editable">
335+
<bool>true</bool>
336+
</property>
337+
<property name="insertPolicy">
338+
<enum>QComboBox::NoInsert</enum>
339+
</property>
340+
</widget>
341+
</item>
356342
</layout>
357343
</item>
358344
</layout>
@@ -365,9 +351,26 @@ columns</string>
365351
</customwidget>
366352
</customwidgets>
367353
<tabstops>
354+
<tabstop>queryBuilderBtn</tabstop>
355+
<tabstop>presetCombo</tabstop>
356+
<tabstop>presetName</tabstop>
357+
<tabstop>presetStore</tabstop>
358+
<tabstop>presetDelete</tabstop>
359+
<tabstop>editSql</tabstop>
368360
<tabstop>btnExecute</tabstop>
369361
<tabstop>btnClear</tabstop>
370362
<tabstop>viewResult</tabstop>
363+
<tabstop>uniqueColumnCheck</tabstop>
364+
<tabstop>uniqueCombo</tabstop>
365+
<tabstop>hasGeometryCol</tabstop>
366+
<tabstop>geomCombo</tabstop>
367+
<tabstop>getColumnsBtn</tabstop>
368+
<tabstop>layerNameEdit</tabstop>
369+
<tabstop>vectorRadio</tabstop>
370+
<tabstop>rasterRadio</tabstop>
371+
<tabstop>btnSetFilter</tabstop>
372+
<tabstop>avoidSelectById</tabstop>
373+
<tabstop>updateLayerBtn</tabstop>
371374
</tabstops>
372375
<resources/>
373376
<connections>

0 commit comments

Comments
 (0)