Showing with 17 additions and 1 deletion.
  1. +1 −1 python/core/qgsfield.sip
  2. +7 −0 src/app/qgsattributetabledialog.cpp
  3. +9 −0 src/app/qgsattributetabledialog.h
2 changes: 1 addition & 1 deletion python/core/qgsfield.sip
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public:

QgsField& operator[](int i) /Factory/;
%MethodCode
int idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
if (idx < 0)
sipIsErr = 1;
else
Expand Down
7 changes: 7 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
// info from table to application
connect( this, SIGNAL( saveEdits( QgsMapLayer * ) ), QgisApp::instance(), SLOT( saveEdits( QgsMapLayer * ) ) );

connect( mMainView, SIGNAL( currentChanged( int ) ), mMainViewButtonGroup, SLOT() );

bool myDockFlag = settings.value( "/qgis/dockAttributeTable", false ).toBool();
if ( myDockFlag )
{
Expand Down Expand Up @@ -421,6 +423,11 @@ void QgsAttributeTableDialog::on_mDeleteSelectedButton_clicked()
QgisApp::instance()->deleteSelected( mLayer, this );
}

void QgsAttributeTableDialog::on_mMainView_currentChanged( int viewMode )
{
mMainViewButtonGroup->button( viewMode )->click();
}

void QgsAttributeTableDialog::on_mToggleEditingButton_toggled()
{
if ( !mLayer )
Expand Down
9 changes: 9 additions & 0 deletions src/app/qgsattributetabledialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia
*/
void on_mDeleteSelectedButton_clicked();

/**
* Called when the current index changes in the main view
* i.e. when the view mode is switched from table to form view
* or vice versa.
*
* Will adjust the button state
*/
void on_mMainView_currentChanged( int );

/**
* add feature
*/
Expand Down