mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-12 12:46:15 +00:00
Dive list: connect header-signal in constructor
The QHeaderView::sectionPressed() signal was connected everytime the list-view was reset. Likewise, setSectionsClickable() was set to true everythime the list-view was reset. Once in the constructor is enough. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
803111ef02
commit
ade0d8e758
1 changed files with 2 additions and 3 deletions
|
@ -47,6 +47,8 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec
|
||||||
|
|
||||||
header()->setStretchLastSection(true);
|
header()->setStretchLastSection(true);
|
||||||
header()->setSortIndicatorShown(true);
|
header()->setSortIndicatorShown(true);
|
||||||
|
header()->setSectionsClickable(true);
|
||||||
|
connect(header(), &QHeaderView::sectionPressed, this, &DiveListView::headerClicked);
|
||||||
|
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
|
|
||||||
|
@ -495,9 +497,6 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
|
||||||
else
|
else
|
||||||
currentLayout = layout;
|
currentLayout = layout;
|
||||||
|
|
||||||
header()->setSectionsClickable(true);
|
|
||||||
connect(header(), SIGNAL(sectionPressed(int)), this, SLOT(headerClicked(int)), Qt::UniqueConnection);
|
|
||||||
|
|
||||||
MultiFilterSortModel::instance()->setLayout(layout);
|
MultiFilterSortModel::instance()->setLayout(layout);
|
||||||
|
|
||||||
if (!forceSort)
|
if (!forceSort)
|
||||||
|
|
Loading…
Add table
Reference in a new issue