Skip to content

Commit f5cd856

Browse files
committed
Refresh virtual fields editing button state based on field selection
Allows removing virtual fields defined on read-only PostgreSQL tables. Closes #17593
1 parent 3d021c4 commit f5cd856

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/app/qgssourcefieldsproperties.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ void QgsSourceFieldsProperties::loadRows()
8888

8989
mFieldsList->resizeColumnsToContents();
9090
connect( mFieldsList, &QTableWidget::cellChanged, this, &QgsSourceFieldsProperties::attributesListCellChanged );
91+
92+
connect( mFieldsList, &QTableWidget::cellPressed, this, &QgsSourceFieldsProperties::attributesListCellPressed );
93+
94+
updateButtons();
9195
updateFieldRenamingStatus();
9296
}
9397

@@ -388,6 +392,10 @@ void QgsSourceFieldsProperties::attributesListCellChanged( int row, int column )
388392
}
389393
}
390394

395+
void QgsSourceFieldsProperties::attributesListCellPressed( int /*row*/, int /*column*/ )
396+
{
397+
updateButtons();
398+
}
391399

392400
//NICE FUNCTIONS
393401
void QgsSourceFieldsProperties::updateButtons()

src/app/qgssourcefieldsproperties.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class APP_EXPORT QgsSourceFieldsProperties : public QWidget, private Ui_QgsSourc
105105
void attributeDeleted( int idx );
106106

107107
void attributesListCellChanged( int row, int column );
108+
void attributesListCellPressed( int row, int column );
108109

109110
};
110111

0 commit comments

Comments
 (0)