mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Fix table view after unlocking view editing
This commit is contained in:
@@ -1626,7 +1626,6 @@ void MainWindow::enableEditing(bool enable_edit, bool enable_insertdelete)
|
||||
ui->buttonNewRecord->setEnabled(insertdelete);
|
||||
ui->buttonDeleteRecord->setEnabled(insertdelete);
|
||||
ui->dataTable->setEditTriggers(edit ? QAbstractItemView::SelectedClicked | QAbstractItemView::AnyKeyPressed | QAbstractItemView::EditKeyPressed : QAbstractItemView::NoEditTriggers);
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::browseTableHeaderClicked(int logicalindex)
|
||||
@@ -1647,7 +1646,7 @@ void MainWindow::browseTableHeaderClicked(int logicalindex)
|
||||
|
||||
attachPlot(ui->dataTable, m_browseTableModel, &browseTableSettings[currentlyBrowsedTableName()]);
|
||||
|
||||
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the filters.
|
||||
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the data view.
|
||||
bool showRowid = browseTableSettings[currentlyBrowsedTableName()].showRowid;
|
||||
ui->dataTable->setColumnHidden(0, !showRowid);
|
||||
}
|
||||
@@ -2481,7 +2480,7 @@ void MainWindow::updateFilter(int column, const QString& value)
|
||||
browseTableSettings[currentlyBrowsedTableName()].filterValues[column] = value;
|
||||
setRecordsetLabel();
|
||||
|
||||
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the filters.
|
||||
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the data view.
|
||||
bool showRowid = browseTableSettings[currentlyBrowsedTableName()].showRowid;
|
||||
ui->dataTable->setColumnHidden(0, !showRowid);
|
||||
}
|
||||
@@ -2833,6 +2832,10 @@ void MainWindow::unlockViewEditing(bool unlock, QString pk)
|
||||
|
||||
// Save settings for this table
|
||||
browseTableSettings[currentTable].unlockViewPk = pk;
|
||||
|
||||
// This seems to be necessary as a workaround for newer Qt versions. Otherwise the rowid column is always shown after changing the data view.
|
||||
bool showRowid = browseTableSettings[currentlyBrowsedTableName()].showRowid;
|
||||
ui->dataTable->setColumnHidden(0, !showRowid);
|
||||
}
|
||||
|
||||
sqlb::ObjectIdentifier MainWindow::currentlyBrowsedTableName() const
|
||||
|
||||
Reference in New Issue
Block a user