Skip to content
Permalink
Browse files

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
  • Loading branch information
g_j_m
g_j_m committed Nov 24, 2007
1 parent 838fb92 commit ccfed84ec571b8d893a19f1b435f1cd6d49e9ecf
Showing with 131 additions and 99 deletions.
  1. +7 −0 src/app/qgsattributetabledisplay.cpp
  2. +1 −0 src/app/qgsattributetabledisplay.h
  3. +123 −99 src/ui/qgsattributetablebase.ui
@@ -49,6 +49,7 @@ QgsAttributeTableDisplay::QgsAttributeTableDisplay(QgsVectorLayer* layer, QgisAp
connect(mSelectedToTopButton, SIGNAL(clicked()), this, SLOT(selectedToTop()));
connect(mInvertSelectionButton, SIGNAL(clicked()), this, SLOT(invertSelection()));
connect(mCopySelectedRowsButton, SIGNAL(clicked()), this, SLOT(copySelectedRowsToClipboard()));
connect(mZoomMapToSelectedRowsButton, SIGNAL(clicked()), this, SLOT(zoomMapToSelectedRows()));
connect(mAddAttributeButton, SIGNAL(clicked()), this, SLOT(addAttribute()));
connect(mDeleteAttributeButton, SIGNAL(clicked()), this, SLOT(deleteAttributes()));
connect(btnStartEditing, SIGNAL(clicked()), this, SLOT(startEditing()));
@@ -108,6 +109,7 @@ void QgsAttributeTableDisplay::setTheme()
mSelectedToTopButton->setPixmap(QPixmap(myIconPath+"/mActionSelectedToTop.png"));
mInvertSelectionButton->setPixmap(QPixmap(myIconPath+"/mActionInvertSelection.png"));
mCopySelectedRowsButton->setPixmap(QPixmap(myIconPath+"/mActionCopySelected.png"));
mZoomMapToSelectedRowsButton->setPixmap(QPixmap(myIconPath+"/mActionZoomToSelected.png"));
mAddAttributeButton->setPixmap(QPixmap(myIconPath+"/mActionNewAttribute.png"));
mDeleteAttributeButton->setPixmap(QPixmap(myIconPath+"/mActionDeleteAttribute.png"));
}
@@ -243,6 +245,11 @@ void QgsAttributeTableDisplay::copySelectedRowsToClipboard()
mQgisApp->editCopy(mLayer);
}

void QgsAttributeTableDisplay::zoomMapToSelectedRows()
{
mQgisApp->zoomToSelected();
}

void QgsAttributeTableDisplay::search()
{
// if selected field is numeric, numeric comparison will be used
@@ -67,6 +67,7 @@ class QgsAttributeTableDisplay:public QDialog, private Ui::QgsAttributeTableBase
void invertSelection();
void removeSelection();
void copySelectedRowsToClipboard();
void zoomMapToSelectedRows();
void search();
void advancedSearch();
void searchShowResultsChanged(int item);
@@ -22,103 +22,6 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="btnHelp" >
<property name="text" >
<string>&amp;Help</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Search for:</string>
</property>
<property name="buddy" >
<cstring>mSearchText</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="mSearchText" />
</item>
<item>
<widget class="QLabel" name="textLabel2" >
<property name="text" >
<string>in</string>
</property>
<property name="buddy" >
<cstring>mSearchColumns</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSearchColumns" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mSearchButton" >
<property name="text" >
<string>Search</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSearchShowResults" />
</item>
<item>
<widget class="QPushButton" name="btnAdvancedSearch" >
<property name="text" >
<string>Adva&amp;nced...</string>
</property>
<property name="shortcut" >
<string>Alt+N</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnClose" >
<property name="text" >
<string>&amp;Close</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QgsAttributeTable" native="1" name="tblAttributes" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
@@ -194,8 +97,32 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mZoomMapToSelectedRowsButton" >
<property name="toolTip" >
<string>Zoom map to the selected rows (Ctrl-F)</string>
</property>
<property name="whatsThis" >
<string>Zoom map to the selected rows</string>
</property>
<property name="text" >
<string/>
</property>
<property name="shortcut" >
<string>Ctrl+F</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mAddAttributeButton" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>New column</string>
</property>
@@ -236,8 +163,8 @@
</property>
<property name="sizeHint" >
<size>
<width>210</width>
<height>20</height>
<width>271</width>
<height>25</height>
</size>
</property>
</spacer>
@@ -261,6 +188,103 @@
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QgsAttributeTable" native="1" name="tblAttributes" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="btnHelp" >
<property name="text" >
<string>&amp;Help</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Search for:</string>
</property>
<property name="buddy" >
<cstring>mSearchText</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="mSearchText" />
</item>
<item>
<widget class="QLabel" name="textLabel2" >
<property name="text" >
<string>in</string>
</property>
<property name="buddy" >
<cstring>mSearchColumns</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSearchColumns" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mSearchButton" >
<property name="text" >
<string>Search</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSearchShowResults" />
</item>
<item>
<widget class="QPushButton" name="btnAdvancedSearch" >
<property name="text" >
<string>Adva&amp;nced...</string>
</property>
<property name="shortcut" >
<string>Alt+N</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnClose" >
<property name="text" >
<string>&amp;Close</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />

0 comments on commit ccfed84

Please sign in to comment.
You can’t perform that action at this time.