Timeline: Use Qt5-style connects

The heavy lifting was done by clazy.

Change-Id: I3b911a44d83650901eb486d20453cb079abef629
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Orgad Shaneh
2016-06-07 22:09:05 +03:00
committed by Orgad Shaneh
parent 172ea7aa6d
commit 4af5d70f8c
5 changed files with 13 additions and 17 deletions

View File

@@ -161,10 +161,10 @@ void TimelineAbstractRenderer::setZoomer(TimelineZoomControl *zoomer)
Q_D(TimelineAbstractRenderer); Q_D(TimelineAbstractRenderer);
if (zoomer != d->zoomer) { if (zoomer != d->zoomer) {
if (d->zoomer != 0) 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; d->zoomer = zoomer;
if (d->zoomer != 0) 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); emit zoomerChanged(zoomer);
update(); update();
} }

View File

@@ -74,7 +74,7 @@ signals:
void selectionLockedChanged(bool locked); void selectionLockedChanged(bool locked);
void selectedItemChanged(int itemIndex); void selectedItemChanged(int itemIndex);
public slots: public:
void setSelectedItem(int itemIndex); void setSelectedItem(int itemIndex);
void setSelectionLocked(bool locked); void setSelectionLocked(bool locked);

View File

@@ -62,7 +62,7 @@ void TimelineModelAggregator::addModel(TimelineModel *m)
{ {
Q_D(TimelineModelAggregator); Q_D(TimelineModelAggregator);
d->modelList << m; d->modelList << m;
connect(m,SIGNAL(heightChanged()),this,SIGNAL(heightChanged())); connect(m, &TimelineModel::heightChanged, this, &TimelineModelAggregator::heightChanged);
if (d->notesModel) if (d->notesModel)
d->notesModel->addTimelineModel(m); d->notesModel->addTimelineModel(m);
emit modelsChanged(); emit modelsChanged();

View File

@@ -51,7 +51,6 @@ public:
// TODO: We could add some Q_INVOKABLE functions to enable or disable render passes when the the // TODO: We could add some Q_INVOKABLE functions to enable or disable render passes when the the
// need arises. // need arises.
public slots:
void clearData(); void clearData();
protected: protected:

View File

@@ -81,6 +81,11 @@ public:
virtual void clear(); 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: signals:
void traceChanged(qint64 start, qint64 end); void traceChanged(qint64 start, qint64 end);
void windowChanged(qint64 start, qint64 end); void windowChanged(qint64 start, qint64 end);
@@ -89,16 +94,11 @@ signals:
void windowLockedChanged(bool windowLocked); void windowLockedChanged(bool windowLocked);
void windowMovingChanged(bool windowMoving); 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: protected:
void moveWindow();
void rebuildWindow();
void clampRangeToWindow();
qint64 m_traceStart; qint64 m_traceStart;
qint64 m_traceEnd; qint64 m_traceEnd;
qint64 m_windowStart; qint64 m_windowStart;
@@ -110,9 +110,6 @@ protected:
QTimer m_timer; QTimer m_timer;
bool m_windowLocked; bool m_windowLocked;
void rebuildWindow();
void clampRangeToWindow();
}; };
} // namespace Timeline } // namespace Timeline