From a444c3b966aea6dd788a4ad02a818d848983fa75 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 14 Oct 2018 05:18:44 +0200 Subject: [PATCH] Bugfix: Qt: After the first entry was added, the header names would be reset to 1, 2, 3 --- CMakeLists.txt | 2 +- src/interface_qt.cpp | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd3ced6..bfa2f47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.6) project (whyblocked - VERSION 0.7.6 + VERSION 0.7.7 LANGUAGES CXX ) diff --git a/src/interface_qt.cpp b/src/interface_qt.cpp index 0a107aa..2a1fb99 100644 --- a/src/interface_qt.cpp +++ b/src/interface_qt.cpp @@ -33,6 +33,14 @@ MainWindow::MainWindow(QMainWindow *parent) : QMainWindow(parent) void MainWindow::populate_tableview() { _model->clear(); + _model->setHorizontalHeaderLabels( + { + tr("User/Instance"), + tr("Blocked/Silenced"), + tr("Reason") + }); + tableview->horizontalHeader()->resizeSection(0, 250); + result_view result; if (view(result)) { @@ -44,11 +52,6 @@ void MainWindow::populate_tableview() } } - _model->setHeaderData(0, Qt::Horizontal, tr("User/Instance")); - _model->setHeaderData(1, Qt::Horizontal, tr("Blocked/Silenced?")); - _model->setHeaderData(2, Qt::Horizontal, tr("Reason")); - tableview->horizontalHeader()->resizeSection(0, 250); - statusBar()->showMessage(tr("Database loaded.")); }