Bugfix: Qt: After the first entry was added, the header names would be reset to 1, 2, 3

develop 0.7.7
tastytea 2018-10-14 05:18:44 +02:00
parent 57e37f90c5
commit a444c3b966
No known key found for this signature in database
GPG Key ID: CFC39497F1B26E07
2 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.6) cmake_minimum_required (VERSION 3.6)
project (whyblocked project (whyblocked
VERSION 0.7.6 VERSION 0.7.7
LANGUAGES CXX LANGUAGES CXX
) )

View File

@ -33,6 +33,14 @@ MainWindow::MainWindow(QMainWindow *parent) : QMainWindow(parent)
void MainWindow::populate_tableview() void MainWindow::populate_tableview()
{ {
_model->clear(); _model->clear();
_model->setHorizontalHeaderLabels(
{
tr("User/Instance"),
tr("Blocked/Silenced"),
tr("Reason")
});
tableview->horizontalHeader()->resizeSection(0, 250);
result_view result; result_view result;
if (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.")); statusBar()->showMessage(tr("Database loaded."));
} }