Skip to content

Commit

Permalink
Refresh virtual fields editing button state based on field selection
Browse files Browse the repository at this point in the history
Allows removing virtual fields defined on read-only PostgreSQL tables.
Closes #17593
  • Loading branch information
strk committed Dec 12, 2017
1 parent 3d021c4 commit f5cd856
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/qgssourcefieldsproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -388,6 +392,10 @@ void QgsSourceFieldsProperties::attributesListCellChanged( int row, int column )
}
}

void QgsSourceFieldsProperties::attributesListCellPressed( int /*row*/, int /*column*/ )
{
updateButtons();
}

//NICE FUNCTIONS
void QgsSourceFieldsProperties::updateButtons()
Expand Down
1 change: 1 addition & 0 deletions src/app/qgssourcefieldsproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

};

Expand Down

0 comments on commit f5cd856

Please sign in to comment.