From 4af5d70f8c6b83018edd744aa14bd2aebc8663fa Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 7 Jun 2016 22:09:05 +0300 Subject: [PATCH] Timeline: Use Qt5-style connects The heavy lifting was done by clazy. Change-Id: I3b911a44d83650901eb486d20453cb079abef629 Reviewed-by: Ulf Hermann --- .../timeline/timelineabstractrenderer.cpp | 4 ++-- src/libs/timeline/timelineabstractrenderer.h | 2 +- src/libs/timeline/timelinemodelaggregator.cpp | 2 +- src/libs/timeline/timelinerenderer.h | 1 - src/libs/timeline/timelinezoomcontrol.h | 21 ++++++++----------- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/libs/timeline/timelineabstractrenderer.cpp b/src/libs/timeline/timelineabstractrenderer.cpp index 28542976585..e1860f6d204 100644 --- a/src/libs/timeline/timelineabstractrenderer.cpp +++ b/src/libs/timeline/timelineabstractrenderer.cpp @@ -161,10 +161,10 @@ void TimelineAbstractRenderer::setZoomer(TimelineZoomControl *zoomer) Q_D(TimelineAbstractRenderer); if (zoomer != d->zoomer) { if (d->zoomer != 0) - disconnect(d->zoomer, SIGNAL(windowChanged(qint64,qint64)), this, SLOT(update())); + disconnect(d->zoomer, &TimelineZoomControl::windowChanged, this, &QQuickItem::update); d->zoomer = zoomer; if (d->zoomer != 0) - connect(d->zoomer, SIGNAL(windowChanged(qint64,qint64)), this, SLOT(update())); + connect(d->zoomer, &TimelineZoomControl::windowChanged, this, &QQuickItem::update); emit zoomerChanged(zoomer); update(); } diff --git a/src/libs/timeline/timelineabstractrenderer.h b/src/libs/timeline/timelineabstractrenderer.h index 8ba388e116a..0412371efa3 100644 --- a/src/libs/timeline/timelineabstractrenderer.h +++ b/src/libs/timeline/timelineabstractrenderer.h @@ -74,7 +74,7 @@ signals: void selectionLockedChanged(bool locked); void selectedItemChanged(int itemIndex); -public slots: +public: void setSelectedItem(int itemIndex); void setSelectionLocked(bool locked); diff --git a/src/libs/timeline/timelinemodelaggregator.cpp b/src/libs/timeline/timelinemodelaggregator.cpp index 7a311a11a4b..0986486af31 100644 --- a/src/libs/timeline/timelinemodelaggregator.cpp +++ b/src/libs/timeline/timelinemodelaggregator.cpp @@ -62,7 +62,7 @@ void TimelineModelAggregator::addModel(TimelineModel *m) { Q_D(TimelineModelAggregator); d->modelList << m; - connect(m,SIGNAL(heightChanged()),this,SIGNAL(heightChanged())); + connect(m, &TimelineModel::heightChanged, this, &TimelineModelAggregator::heightChanged); if (d->notesModel) d->notesModel->addTimelineModel(m); emit modelsChanged(); diff --git a/src/libs/timeline/timelinerenderer.h b/src/libs/timeline/timelinerenderer.h index bd23b30321a..9f7f1f5c107 100644 --- a/src/libs/timeline/timelinerenderer.h +++ b/src/libs/timeline/timelinerenderer.h @@ -51,7 +51,6 @@ public: // TODO: We could add some Q_INVOKABLE functions to enable or disable render passes when the the // need arises. -public slots: void clearData(); protected: diff --git a/src/libs/timeline/timelinezoomcontrol.h b/src/libs/timeline/timelinezoomcontrol.h index 2236e754f35..5ab91a947f9 100644 --- a/src/libs/timeline/timelinezoomcontrol.h +++ b/src/libs/timeline/timelinezoomcontrol.h @@ -81,6 +81,11 @@ public: virtual void clear(); + void setTrace(qint64 start, qint64 end); + void setRange(qint64 start, qint64 end); + void setSelection(qint64 start, qint64 end); + void setWindowLocked(bool windowLocked); + signals: void traceChanged(qint64 start, qint64 end); void windowChanged(qint64 start, qint64 end); @@ -89,16 +94,11 @@ signals: void windowLockedChanged(bool windowLocked); void windowMovingChanged(bool windowMoving); -public slots: - void setTrace(qint64 start, qint64 end); - void setRange(qint64 start, qint64 end); - void setSelection(qint64 start, qint64 end); - void setWindowLocked(bool windowLocked); - -protected slots: - void moveWindow(); - protected: + void moveWindow(); + void rebuildWindow(); + void clampRangeToWindow(); + qint64 m_traceStart; qint64 m_traceEnd; qint64 m_windowStart; @@ -110,9 +110,6 @@ protected: QTimer m_timer; bool m_windowLocked; - - void rebuildWindow(); - void clampRangeToWindow(); }; } // namespace Timeline