Skip to content

Commit ad39ddf

Browse files
committed
Merge pull request #2749 from pvalsecc/add_selectall
Add select all button to the attribute table dialog
2 parents 2797ed7 + f8a50b5 commit ad39ddf

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

src/app/qgsattributetabledialog.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
166166
updateTitle();
167167

168168
mRemoveSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionUnselectAttributes.png" ) );
169+
mSelectAllButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectAll.png" ) );
169170
mSelectedToTopButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectedToTop.png" ) );
170171
mCopySelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionCopySelected.png" ) );
171172
mZoomMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.svg" ) );
@@ -626,6 +627,11 @@ void QgsAttributeTableDialog::on_mRemoveSelectionButton_clicked()
626627
mLayer->removeSelection();
627628
}
628629

630+
void QgsAttributeTableDialog::on_mSelectAllButton_clicked()
631+
{
632+
mLayer->selectAll();
633+
}
634+
629635
void QgsAttributeTableDialog::on_mDeleteSelectedButton_clicked()
630636
{
631637
QgisApp::instance()->deleteSelected( mLayer, this );

src/app/qgsattributetabledialog.h

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
9898
* Clears selection
9999
*/
100100
void on_mRemoveSelectionButton_clicked();
101+
/**
102+
* Select all
103+
*/
104+
void on_mSelectAllButton_clicked();
101105
/**
102106
* Zooms to selected features
103107
*/

src/ui/qgsattributetabledialog.ui

+27
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,32 @@
232232
</property>
233233
</widget>
234234
</item>
235+
<item>
236+
<widget class="QToolButton" name="mSelectAllButton">
237+
<property name="toolTip">
238+
<string>Select all (Ctrl+A)</string>
239+
</property>
240+
<property name="text">
241+
<string/>
242+
</property>
243+
<property name="icon">
244+
<iconset resource="../../images/images.qrc">
245+
<normaloff>:/images/themes/default/mActionSelectAll.png</normaloff>:/images/themes/default/mActionSelectAll.png</iconset>
246+
</property>
247+
<property name="iconSize">
248+
<size>
249+
<width>18</width>
250+
<height>18</height>
251+
</size>
252+
</property>
253+
<property name="shortcut">
254+
<string>Ctrl+A</string>
255+
</property>
256+
<property name="autoRaise">
257+
<bool>true</bool>
258+
</property>
259+
</widget>
260+
</item>
235261
<item>
236262
<widget class="QToolButton" name="mSelectedToTopButton">
237263
<property name="toolTip">
@@ -814,6 +840,7 @@
814840
</customwidgets>
815841
<tabstops>
816842
<tabstop>mRemoveSelectionButton</tabstop>
843+
<tabstop>mSelectAllButton</tabstop>
817844
<tabstop>mSelectedToTopButton</tabstop>
818845
<tabstop>mInvertSelectionButton</tabstop>
819846
<tabstop>mCopySelectedRowsButton</tabstop>

0 commit comments

Comments
 (0)