Skip to content

Commit d002423

Browse files
committed
[attrtable] Fix button checked state
The wrong button was checked, when the view mode was not changed with a button click but another event.
1 parent d0d381a commit d002423

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/app/qgsattributetabledialog.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
119119
// info from table to application
120120
connect( this, SIGNAL( saveEdits( QgsMapLayer * ) ), QgisApp::instance(), SLOT( saveEdits( QgsMapLayer * ) ) );
121121

122+
connect( mMainView, SIGNAL( currentChanged( int ) ), mMainViewButtonGroup, SLOT() );
123+
122124
bool myDockFlag = settings.value( "/qgis/dockAttributeTable", false ).toBool();
123125
if ( myDockFlag )
124126
{
@@ -421,6 +423,11 @@ void QgsAttributeTableDialog::on_mDeleteSelectedButton_clicked()
421423
QgisApp::instance()->deleteSelected( mLayer, this );
422424
}
423425

426+
void QgsAttributeTableDialog::on_mMainView_currentChanged( int viewMode )
427+
{
428+
mMainViewButtonGroup->button( viewMode )->click();
429+
}
430+
424431
void QgsAttributeTableDialog::on_mToggleEditingButton_toggled()
425432
{
426433
if ( !mLayer )

src/app/qgsattributetabledialog.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,15 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia
121121
*/
122122
void on_mDeleteSelectedButton_clicked();
123123

124+
/**
125+
* Called when the current index changes in the main view
126+
* i.e. when the view mode is switched from table to form view
127+
* or vice versa.
128+
*
129+
* Will adjust the button state
130+
*/
131+
void on_mMainView_currentChanged( int );
132+
124133
/**
125134
* add feature
126135
*/

0 commit comments

Comments
 (0)