From f8a50b510e3f13f3fcca6095acc317249b03b7f7 Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi Date: Mon, 1 Feb 2016 08:14:45 +0100 Subject: [PATCH] Add select all button to the attribute table dialog As suggested by @nyalldawson in qgis/QGIS#2727. --- src/app/qgsattributetabledialog.cpp | 6 ++++++ src/app/qgsattributetabledialog.h | 4 ++++ src/ui/qgsattributetabledialog.ui | 27 +++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/src/app/qgsattributetabledialog.cpp b/src/app/qgsattributetabledialog.cpp index 783b1d019d48..e8262375c9f0 100644 --- a/src/app/qgsattributetabledialog.cpp +++ b/src/app/qgsattributetabledialog.cpp @@ -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 ); diff --git a/src/app/qgsattributetabledialog.h b/src/app/qgsattributetabledialog.h index b33c3ebdbc59..a4794ac98dfb 100644 --- a/src/app/qgsattributetabledialog.h +++ b/src/app/qgsattributetabledialog.h @@ -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 */ diff --git a/src/ui/qgsattributetabledialog.ui b/src/ui/qgsattributetabledialog.ui index d0da0d460c1f..74674a2c9384 100644 --- a/src/ui/qgsattributetabledialog.ui +++ b/src/ui/qgsattributetabledialog.ui @@ -232,6 +232,32 @@ + + + + Select all (Ctrl+A) + + + + + + + :/images/themes/default/mActionSelectAll.png:/images/themes/default/mActionSelectAll.png + + + + 18 + 18 + + + + Ctrl+A + + + true + + + @@ -814,6 +840,7 @@ mRemoveSelectionButton + mSelectAllButton mSelectedToTopButton mInvertSelectionButton mCopySelectedRowsButton