diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-29 15:06:23 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-11-01 07:28:15 -0700 |
commit | ade0d8e758bd925f919d172c0293eb160502e0fd (patch) | |
tree | 61ceda715482208d5826799bf24a1c4247520653 /desktop-widgets | |
parent | 803111ef02f84119f762ce495710edb2e7f40bdb (diff) | |
download | subsurface-ade0d8e758bd925f919d172c0293eb160502e0fd.tar.gz |
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>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/divelistview.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 30364a8eb..9c5ea8b1c 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -47,6 +47,8 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec header()->setStretchLastSection(true); header()->setSortIndicatorShown(true); + header()->setSectionsClickable(true); + connect(header(), &QHeaderView::sectionPressed, this, &DiveListView::headerClicked); installEventFilter(this); @@ -495,9 +497,6 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort) else currentLayout = layout; - header()->setSectionsClickable(true); - connect(header(), SIGNAL(sectionPressed(int)), this, SLOT(headerClicked(int)), Qt::UniqueConnection); - MultiFilterSortModel::instance()->setLayout(layout); if (!forceSort) |