Skip to content

Commit ccfed84

Browse files
author
g_j_m
committedNov 24, 2007
Fix for ticket #402 (add a zoom to selected button to the attribute
table). git-svn-id: http://svn.osgeo.org/qgis/trunk@7654 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 838fb92 commit ccfed84

File tree

3 files changed

+131
-99
lines changed

3 files changed

+131
-99
lines changed
 

‎src/app/qgsattributetabledisplay.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ QgsAttributeTableDisplay::QgsAttributeTableDisplay(QgsVectorLayer* layer, QgisAp
4949
connect(mSelectedToTopButton, SIGNAL(clicked()), this, SLOT(selectedToTop()));
5050
connect(mInvertSelectionButton, SIGNAL(clicked()), this, SLOT(invertSelection()));
5151
connect(mCopySelectedRowsButton, SIGNAL(clicked()), this, SLOT(copySelectedRowsToClipboard()));
52+
connect(mZoomMapToSelectedRowsButton, SIGNAL(clicked()), this, SLOT(zoomMapToSelectedRows()));
5253
connect(mAddAttributeButton, SIGNAL(clicked()), this, SLOT(addAttribute()));
5354
connect(mDeleteAttributeButton, SIGNAL(clicked()), this, SLOT(deleteAttributes()));
5455
connect(btnStartEditing, SIGNAL(clicked()), this, SLOT(startEditing()));
@@ -108,6 +109,7 @@ void QgsAttributeTableDisplay::setTheme()
108109
mSelectedToTopButton->setPixmap(QPixmap(myIconPath+"/mActionSelectedToTop.png"));
109110
mInvertSelectionButton->setPixmap(QPixmap(myIconPath+"/mActionInvertSelection.png"));
110111
mCopySelectedRowsButton->setPixmap(QPixmap(myIconPath+"/mActionCopySelected.png"));
112+
mZoomMapToSelectedRowsButton->setPixmap(QPixmap(myIconPath+"/mActionZoomToSelected.png"));
111113
mAddAttributeButton->setPixmap(QPixmap(myIconPath+"/mActionNewAttribute.png"));
112114
mDeleteAttributeButton->setPixmap(QPixmap(myIconPath+"/mActionDeleteAttribute.png"));
113115
}
@@ -243,6 +245,11 @@ void QgsAttributeTableDisplay::copySelectedRowsToClipboard()
243245
mQgisApp->editCopy(mLayer);
244246
}
245247

248+
void QgsAttributeTableDisplay::zoomMapToSelectedRows()
249+
{
250+
mQgisApp->zoomToSelected();
251+
}
252+
246253
void QgsAttributeTableDisplay::search()
247254
{
248255
// if selected field is numeric, numeric comparison will be used

‎src/app/qgsattributetabledisplay.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class QgsAttributeTableDisplay:public QDialog, private Ui::QgsAttributeTableBase
6767
void invertSelection();
6868
void removeSelection();
6969
void copySelectedRowsToClipboard();
70+
void zoomMapToSelectedRows();
7071
void search();
7172
void advancedSearch();
7273
void searchShowResultsChanged(int item);

‎src/ui/qgsattributetablebase.ui

Lines changed: 123 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -22,103 +22,6 @@
2222
<property name="spacing" >
2323
<number>6</number>
2424
</property>
25-
<item row="2" column="0" >
26-
<layout class="QHBoxLayout" >
27-
<property name="margin" >
28-
<number>0</number>
29-
</property>
30-
<property name="spacing" >
31-
<number>6</number>
32-
</property>
33-
<item>
34-
<widget class="QPushButton" name="btnHelp" >
35-
<property name="text" >
36-
<string>&amp;Help</string>
37-
</property>
38-
<property name="shortcut" >
39-
<string>Alt+C</string>
40-
</property>
41-
</widget>
42-
</item>
43-
<item>
44-
<widget class="QLabel" name="textLabel1" >
45-
<property name="text" >
46-
<string>Search for:</string>
47-
</property>
48-
<property name="buddy" >
49-
<cstring>mSearchText</cstring>
50-
</property>
51-
</widget>
52-
</item>
53-
<item>
54-
<widget class="QLineEdit" name="mSearchText" />
55-
</item>
56-
<item>
57-
<widget class="QLabel" name="textLabel2" >
58-
<property name="text" >
59-
<string>in</string>
60-
</property>
61-
<property name="buddy" >
62-
<cstring>mSearchColumns</cstring>
63-
</property>
64-
</widget>
65-
</item>
66-
<item>
67-
<widget class="QComboBox" name="mSearchColumns" >
68-
<property name="sizePolicy" >
69-
<sizepolicy>
70-
<hsizetype>7</hsizetype>
71-
<vsizetype>0</vsizetype>
72-
<horstretch>0</horstretch>
73-
<verstretch>0</verstretch>
74-
</sizepolicy>
75-
</property>
76-
</widget>
77-
</item>
78-
<item>
79-
<widget class="QPushButton" name="mSearchButton" >
80-
<property name="text" >
81-
<string>Search</string>
82-
</property>
83-
</widget>
84-
</item>
85-
<item>
86-
<widget class="QComboBox" name="mSearchShowResults" />
87-
</item>
88-
<item>
89-
<widget class="QPushButton" name="btnAdvancedSearch" >
90-
<property name="text" >
91-
<string>Adva&amp;nced...</string>
92-
</property>
93-
<property name="shortcut" >
94-
<string>Alt+N</string>
95-
</property>
96-
</widget>
97-
</item>
98-
<item>
99-
<widget class="QPushButton" name="btnClose" >
100-
<property name="text" >
101-
<string>&amp;Close</string>
102-
</property>
103-
<property name="shortcut" >
104-
<string>Alt+C</string>
105-
</property>
106-
</widget>
107-
</item>
108-
</layout>
109-
</item>
110-
<item row="1" column="0" >
111-
<widget class="QgsAttributeTable" native="1" name="tblAttributes" >
112-
<property name="sizePolicy" >
113-
<sizepolicy>
114-
<hsizetype>7</hsizetype>
115-
<vsizetype>7</vsizetype>
116-
<horstretch>0</horstretch>
117-
<verstretch>0</verstretch>
118-
</sizepolicy>
119-
</property>
120-
</widget>
121-
</item>
12225
<item row="0" column="0" >
12326
<layout class="QHBoxLayout" >
12427
<property name="margin" >
@@ -194,8 +97,32 @@
19497
</property>
19598
</widget>
19699
</item>
100+
<item>
101+
<widget class="QToolButton" name="mZoomMapToSelectedRowsButton" >
102+
<property name="toolTip" >
103+
<string>Zoom map to the selected rows (Ctrl-F)</string>
104+
</property>
105+
<property name="whatsThis" >
106+
<string>Zoom map to the selected rows</string>
107+
</property>
108+
<property name="text" >
109+
<string/>
110+
</property>
111+
<property name="shortcut" >
112+
<string>Ctrl+F</string>
113+
</property>
114+
</widget>
115+
</item>
197116
<item>
198117
<widget class="QToolButton" name="mAddAttributeButton" >
118+
<property name="sizePolicy" >
119+
<sizepolicy>
120+
<hsizetype>0</hsizetype>
121+
<vsizetype>0</vsizetype>
122+
<horstretch>0</horstretch>
123+
<verstretch>0</verstretch>
124+
</sizepolicy>
125+
</property>
199126
<property name="toolTip" >
200127
<string>New column</string>
201128
</property>
@@ -236,8 +163,8 @@
236163
</property>
237164
<property name="sizeHint" >
238165
<size>
239-
<width>210</width>
240-
<height>20</height>
166+
<width>271</width>
167+
<height>25</height>
241168
</size>
242169
</property>
243170
</spacer>
@@ -261,6 +188,103 @@
261188
</item>
262189
</layout>
263190
</item>
191+
<item row="1" column="0" >
192+
<widget class="QgsAttributeTable" native="1" name="tblAttributes" >
193+
<property name="sizePolicy" >
194+
<sizepolicy>
195+
<hsizetype>7</hsizetype>
196+
<vsizetype>7</vsizetype>
197+
<horstretch>0</horstretch>
198+
<verstretch>0</verstretch>
199+
</sizepolicy>
200+
</property>
201+
</widget>
202+
</item>
203+
<item row="2" column="0" >
204+
<layout class="QHBoxLayout" >
205+
<property name="margin" >
206+
<number>0</number>
207+
</property>
208+
<property name="spacing" >
209+
<number>6</number>
210+
</property>
211+
<item>
212+
<widget class="QPushButton" name="btnHelp" >
213+
<property name="text" >
214+
<string>&amp;Help</string>
215+
</property>
216+
<property name="shortcut" >
217+
<string>Alt+C</string>
218+
</property>
219+
</widget>
220+
</item>
221+
<item>
222+
<widget class="QLabel" name="textLabel1" >
223+
<property name="text" >
224+
<string>Search for:</string>
225+
</property>
226+
<property name="buddy" >
227+
<cstring>mSearchText</cstring>
228+
</property>
229+
</widget>
230+
</item>
231+
<item>
232+
<widget class="QLineEdit" name="mSearchText" />
233+
</item>
234+
<item>
235+
<widget class="QLabel" name="textLabel2" >
236+
<property name="text" >
237+
<string>in</string>
238+
</property>
239+
<property name="buddy" >
240+
<cstring>mSearchColumns</cstring>
241+
</property>
242+
</widget>
243+
</item>
244+
<item>
245+
<widget class="QComboBox" name="mSearchColumns" >
246+
<property name="sizePolicy" >
247+
<sizepolicy>
248+
<hsizetype>7</hsizetype>
249+
<vsizetype>0</vsizetype>
250+
<horstretch>0</horstretch>
251+
<verstretch>0</verstretch>
252+
</sizepolicy>
253+
</property>
254+
</widget>
255+
</item>
256+
<item>
257+
<widget class="QPushButton" name="mSearchButton" >
258+
<property name="text" >
259+
<string>Search</string>
260+
</property>
261+
</widget>
262+
</item>
263+
<item>
264+
<widget class="QComboBox" name="mSearchShowResults" />
265+
</item>
266+
<item>
267+
<widget class="QPushButton" name="btnAdvancedSearch" >
268+
<property name="text" >
269+
<string>Adva&amp;nced...</string>
270+
</property>
271+
<property name="shortcut" >
272+
<string>Alt+N</string>
273+
</property>
274+
</widget>
275+
</item>
276+
<item>
277+
<widget class="QPushButton" name="btnClose" >
278+
<property name="text" >
279+
<string>&amp;Close</string>
280+
</property>
281+
<property name="shortcut" >
282+
<string>Alt+C</string>
283+
</property>
284+
</widget>
285+
</item>
286+
</layout>
287+
</item>
264288
</layout>
265289
</widget>
266290
<layoutdefault spacing="6" margin="11" />

0 commit comments

Comments
 (0)
Please sign in to comment.