diff options
author | hjk <hjk@theqtcompany.com> | 2015-01-20 08:50:49 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2015-01-21 10:42:06 +0100 |
commit | c47dd737b0e5ab5ea8b4d695fe237df52890d643 (patch) | |
tree | 7730d57719c26368ec8ae5609573a713882ede8e /src/libs/utils/basetreeview.cpp | |
parent | aa5dbe77938cc6db7c4cf9dc84e4e296c4382b82 (diff) |
BaseTreeView: Modernize connections
Change-Id: Ie8de8a5c59f16a22419d1ee8382ef151a65d0b07
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/libs/utils/basetreeview.cpp')
-rw-r--r-- | src/libs/utils/basetreeview.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/libs/utils/basetreeview.cpp b/src/libs/utils/basetreeview.cpp index 98adaf01194..29ba0590f21 100644 --- a/src/libs/utils/basetreeview.cpp +++ b/src/libs/utils/basetreeview.cpp @@ -124,7 +124,7 @@ public: } } - Q_SLOT void handleSectionResized(int logicalIndex, int /*oldSize*/, int newSize) + void handleSectionResized(int logicalIndex, int /*oldSize*/, int newSize) { if (m_expectUserChanges) { m_userHandled[logicalIndex] = newSize; @@ -159,7 +159,7 @@ public: return minimum; } - Q_SLOT void resizeColumns() + Q_SLOT void resizeColumns() // Needs moc, see BaseTreeView::setModel { QHeaderView *h = q->header(); QTC_ASSERT(h, return); @@ -178,17 +178,7 @@ public: } } - Q_SLOT void rowActivatedHelper(const QModelIndex &index) - { - q->rowActivated(index); - } - - Q_SLOT void rowClickedHelper(const QModelIndex &index) - { - q->rowClicked(index); - } - - Q_SLOT void toggleColumnWidth(int logicalIndex) + void toggleColumnWidth(int logicalIndex) { QHeaderView *h = q->header(); const int currentSize = h->sectionSize(logicalIndex); @@ -254,14 +244,15 @@ BaseTreeView::BaseTreeView(QWidget *parent) h->setSectionsClickable(true); h->viewport()->installEventFilter(d); - connect(this, SIGNAL(activated(QModelIndex)), - d, SLOT(rowActivatedHelper(QModelIndex))); - connect(this, SIGNAL(clicked(QModelIndex)), - d, SLOT(rowClickedHelper(QModelIndex))); - connect(h, SIGNAL(sectionClicked(int)), - d, SLOT(toggleColumnWidth(int))); - connect(h, SIGNAL(sectionResized(int,int,int)), - d, SLOT(handleSectionResized(int,int,int))); + connect(this, &QAbstractItemView::activated, + this, &BaseTreeView::rowActivated); + connect(this, &QAbstractItemView::clicked, + this, &BaseTreeView::rowClicked); + + connect(h, &QHeaderView::sectionClicked, + d, &BaseTreeViewPrivate::toggleColumnWidth); + connect(h, &QHeaderView::sectionResized, + d, &BaseTreeViewPrivate::handleSectionResized); } BaseTreeView::~BaseTreeView() |