From 84cd516bdf92f43870e629c595be9f0a5b0b319f Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Tue, 22 Dec 2015 22:42:00 +0100 Subject: [PATCH] Fix Show Rowid menu item This took me way too long to fix but it feels good that it's working now. See issue #408. --- src/MainWindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index a91d7867..e98b1f29 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -2360,9 +2360,8 @@ void MainWindow::editDataColumnDisplayFormat() void MainWindow::showRowidColumn(bool show) { - // FIXME: Workaround for actually getting the next line to work reliably - //ui->dataTable->setModel(0); - //ui->dataTable->setModel(m_browseTableModel); + // Block all signals from the horizontal header. Otherwise the QHeaderView::sectionResized signal causes us trouble + ui->dataTable->horizontalHeader()->blockSignals(true); // Show/hide rowid column ui->dataTable->setColumnHidden(0, !show); @@ -2376,6 +2375,9 @@ void MainWindow::showRowidColumn(bool show) // Update the filter row qobject_cast(ui->dataTable->horizontalHeader())->generateFilters(m_browseTableModel->columnCount(), show); + + // Re-enable signals + ui->dataTable->horizontalHeader()->blockSignals(false); } void MainWindow::browseDataSetTableEncoding(bool forAllTables)