From 7fbd25514f3b666b79bef54bf3423c93107aa3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 15 Jun 2024 16:29:52 +0200 Subject: [PATCH] Fix headers in the table view getting stuck in a non moveable state The state can be saved with "sections moveable = false", so when it's restored the headers become non moveable, setting the property to true later should prevent this from happening. --- CHANGELOG.md | 3 +++ YACReaderLibrary/classic_comics_view.cpp | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8b1094f..046df566 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ Version counting is based on semantic versioning (Major.Feature.Patch) * Save magnifying glass size and zoom level. * Add shortcut to reset the magnifying glass to its defaults (size and zoom), it is `slash` by default but it can be reasigned. +### +* Fix headers in the table view getting stuck in a non moveable state. + ## 9.14.2 ### YACReaderLibrary diff --git a/YACReaderLibrary/classic_comics_view.cpp b/YACReaderLibrary/classic_comics_view.cpp index 5af869a2..82494b0e 100644 --- a/YACReaderLibrary/classic_comics_view.cpp +++ b/YACReaderLibrary/classic_comics_view.cpp @@ -147,12 +147,6 @@ void ClassicComicsView::setModel(ComicModel *model) if (model->rowCount() > 0) tableView->setCurrentIndex(model->index(0, 0)); - tableView->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); -#if QT_VERSION >= 0x050000 - tableView->horizontalHeader()->setSectionsMovable(true); -#else - tableView->horizontalHeader()->setMovable(true); -#endif QStringList paths = model->getPaths(model->getCurrentPath()); // TODO ComicsView: get currentpath from somewhere currentPath()); comicFlow->setImagePaths(paths); comicFlow->setMarks(model->getReadList()); @@ -197,7 +191,8 @@ void ClassicComicsView::setModel(ComicModel *model) } tableView->resizeColumnsToContents(); - + tableView->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); + tableView->horizontalHeader()->setSectionsMovable(true); tableView->horizontalHeader()->setStretchLastSection(true); } }