Merge pull request #2749 from pvalsecc/add_selectall

Add select all button to the attribute table dialog
This commit is contained in:
Nyall Dawson 2016-02-01 21:08:31 +11:00
commit ad39ddfdd4
3 changed files with 37 additions and 0 deletions

View File

@ -166,6 +166,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
updateTitle();
mRemoveSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionUnselectAttributes.png" ) );
mSelectAllButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectAll.png" ) );
mSelectedToTopButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectedToTop.png" ) );
mCopySelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionCopySelected.png" ) );
mZoomMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.svg" ) );
@ -626,6 +627,11 @@ void QgsAttributeTableDialog::on_mRemoveSelectionButton_clicked()
mLayer->removeSelection();
}
void QgsAttributeTableDialog::on_mSelectAllButton_clicked()
{
mLayer->selectAll();
}
void QgsAttributeTableDialog::on_mDeleteSelectedButton_clicked()
{
QgisApp::instance()->deleteSelected( mLayer, this );

View File

@ -98,6 +98,10 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
* Clears selection
*/
void on_mRemoveSelectionButton_clicked();
/**
* Select all
*/
void on_mSelectAllButton_clicked();
/**
* Zooms to selected features
*/

View File

@ -232,6 +232,32 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mSelectAllButton">
<property name="toolTip">
<string>Select all (Ctrl+A)</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionSelectAll.png</normaloff>:/images/themes/default/mActionSelectAll.png</iconset>
</property>
<property name="iconSize">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
<property name="shortcut">
<string>Ctrl+A</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mSelectedToTopButton">
<property name="toolTip">
@ -814,6 +840,7 @@
</customwidgets>
<tabstops>
<tabstop>mRemoveSelectionButton</tabstop>
<tabstop>mSelectAllButton</tabstop>
<tabstop>mSelectedToTopButton</tabstop>
<tabstop>mInvertSelectionButton</tabstop>
<tabstop>mCopySelectedRowsButton</tabstop>