Refresh virtual fields editing button state based on field selection

Allows removing virtual fields defined on read-only PostgreSQL tables.
Closes #17593
This commit is contained in:
Sandro Santilli 2017-12-05 18:20:45 +01:00
parent 3d021c44d5
commit f5cd856531
2 changed files with 9 additions and 0 deletions

View File

@ -88,6 +88,10 @@ void QgsSourceFieldsProperties::loadRows()
mFieldsList->resizeColumnsToContents();
connect( mFieldsList, &QTableWidget::cellChanged, this, &QgsSourceFieldsProperties::attributesListCellChanged );
connect( mFieldsList, &QTableWidget::cellPressed, this, &QgsSourceFieldsProperties::attributesListCellPressed );
updateButtons();
updateFieldRenamingStatus();
}
@ -388,6 +392,10 @@ void QgsSourceFieldsProperties::attributesListCellChanged( int row, int column )
}
}
void QgsSourceFieldsProperties::attributesListCellPressed( int /*row*/, int /*column*/ )
{
updateButtons();
}
//NICE FUNCTIONS
void QgsSourceFieldsProperties::updateButtons()

View File

@ -105,6 +105,7 @@ class APP_EXPORT QgsSourceFieldsProperties : public QWidget, private Ui_QgsSourc
void attributeDeleted( int idx );
void attributesListCellChanged( int row, int column );
void attributesListCellPressed( int row, int column );
};