Skip to content

Commit 72506fb

Browse files
committed
Fix table view after unlocking view editing
1 parent 6466aac commit 72506fb

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/MainWindow.cpp‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,6 @@ void MainWindow::enableEditing(bool enable_edit, bool enable_insertdelete)
16261626
ui->buttonNewRecord->setEnabled(insertdelete);
16271627
ui->buttonDeleteRecord->setEnabled(insertdelete);
16281628
ui->dataTable->setEditTriggers(edit ? QAbstractItemView::SelectedClicked | QAbstractItemView::AnyKeyPressed | QAbstractItemView::EditKeyPressed : QAbstractItemView::NoEditTriggers);
1629-
16301629
}
16311630

16321631
void MainWindow::browseTableHeaderClicked(int logicalindex)
@@ -1647,7 +1646,7 @@ void MainWindow::browseTableHeaderClicked(int logicalindex)
16471646

16481647
attachPlot(ui->dataTable, m_browseTableModel, &browseTableSettings[currentlyBrowsedTableName()]);
16491648

1650-
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the filters.
1649+
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the data view.
16511650
bool showRowid = browseTableSettings[currentlyBrowsedTableName()].showRowid;
16521651
ui->dataTable->setColumnHidden(0, !showRowid);
16531652
}
@@ -2481,7 +2480,7 @@ void MainWindow::updateFilter(int column, const QString& value)
24812480
browseTableSettings[currentlyBrowsedTableName()].filterValues[column] = value;
24822481
setRecordsetLabel();
24832482

2484-
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the filters.
2483+
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the data view.
24852484
bool showRowid = browseTableSettings[currentlyBrowsedTableName()].showRowid;
24862485
ui->dataTable->setColumnHidden(0, !showRowid);
24872486
}
@@ -2833,6 +2832,10 @@ void MainWindow::unlockViewEditing(bool unlock, QString pk)
28332832

28342833
// Save settings for this table
28352834
browseTableSettings[currentTable].unlockViewPk = pk;
2835+
2836+
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the data view.
2837+
bool showRowid = browseTableSettings[currentlyBrowsedTableName()].showRowid;
2838+
ui->dataTable->setColumnHidden(0, !showRowid);
28362839
}
28372840

28382841
sqlb::ObjectIdentifier MainWindow::currentlyBrowsedTableName() const

0 commit comments

Comments
 (0)