diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-11-17 11:40:48 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-11-17 12:45:48 +0000 |
commit | 96ed848bf490d6a4ef70243117f24dbc397e5ed5 (patch) | |
tree | 334ce3525fe92e3fe2772d496d48ff4d8c442e20 | |
parent | 83187ba54fd63b9d9985d5f7fcddc7d8d3463c28 (diff) |
Drop autoconnections
Use typed connections instead.
Change-Id: I5ef7d0fc4abbe687eeb49571ce13e73c7c6d50e0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp | 29 | ||||
-rw-r--r-- | src/libs/qmleditorwidgets/easingpane/easingcontextpane.h | 14 |
2 files changed, 28 insertions, 15 deletions
diff --git a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp index 7f7c4684dd..1a1ee9bba9 100644 --- a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp +++ b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp @@ -130,7 +130,20 @@ EasingContextPane::EasingContextPane(QWidget *parent) : setGraphDisplayMode(GraphMode); - connect(m_simulation,&EasingSimulation::finished,this,&EasingContextPane::switchToGraph); + connect(m_simulation, &EasingSimulation::finished, this, &EasingContextPane::switchToGraph); + connect(ui->playButton, &QPushButton::clicked, this, &EasingContextPane::playClicked); + connect(ui->overshootSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), + this, &EasingContextPane::overshootChanged); + connect(ui->periodSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), + this, &EasingContextPane::periodChanged); + connect(ui->amplitudeSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), + this, &EasingContextPane::amplitudeChanged); + connect(ui->easingExtremesComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), + this, &EasingContextPane::easingExtremesChanged); + connect(ui->easingShapeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), + this, &EasingContextPane::easingShapeChanged); + connect(ui->durationSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), + this, &EasingContextPane::durationChanged); } EasingContextPane::~EasingContextPane() @@ -282,13 +295,13 @@ void EasingContextPane::setBounce() } //QmlDesigner -void QmlEditorWidgets::EasingContextPane::on_durationSpinBox_valueChanged(int newValue) +void QmlEditorWidgets::EasingContextPane::durationChanged(int newValue) { m_simulation->updateCurve(m_easingGraph->easingCurve(),ui->durationSpinBox->value()); emit propertyChanged(QLatin1String("duration"), newValue); } -void QmlEditorWidgets::EasingContextPane::on_easingShapeComboBox_currentIndexChanged(int newIndex) +void QmlEditorWidgets::EasingContextPane::easingShapeChanged(int newIndex) { QTC_ASSERT(newIndex >= 0, return); const QString newShape = ui->easingShapeComboBox->itemText(newIndex); @@ -314,7 +327,7 @@ void QmlEditorWidgets::EasingContextPane::on_easingShapeComboBox_currentIndexCha } } -void QmlEditorWidgets::EasingContextPane::on_easingExtremesComboBox_currentIndexChanged(int newIndex) +void QmlEditorWidgets::EasingContextPane::easingExtremesChanged(int newIndex) { QTC_ASSERT(newIndex >= 0, return); const QString newExtremes = ui->easingExtremesComboBox->itemText(newIndex); @@ -328,7 +341,7 @@ void QmlEditorWidgets::EasingContextPane::on_easingExtremesComboBox_currentIndex } } -void QmlEditorWidgets::EasingContextPane::on_amplitudeSpinBox_valueChanged(double newAmplitude) +void QmlEditorWidgets::EasingContextPane::amplitudeChanged(double newAmplitude) { if ((newAmplitude != m_easingGraph->amplitude()) && (m_easingGraph->easingShape()==QLatin1String("Bounce") @@ -339,7 +352,7 @@ void QmlEditorWidgets::EasingContextPane::on_amplitudeSpinBox_valueChanged(doubl } } -void QmlEditorWidgets::EasingContextPane::on_periodSpinBox_valueChanged(double newPeriod) +void QmlEditorWidgets::EasingContextPane::periodChanged(double newPeriod) { if ((newPeriod != m_easingGraph->period()) && (m_easingGraph->easingShape()==QLatin1String("Elastic"))) { m_easingGraph->setPeriod(newPeriod); @@ -349,7 +362,7 @@ void QmlEditorWidgets::EasingContextPane::on_periodSpinBox_valueChanged(double n } -void QmlEditorWidgets::EasingContextPane::on_overshootSpinBox_valueChanged(double newOvershoot) +void QmlEditorWidgets::EasingContextPane::overshootChanged(double newOvershoot) { if ((newOvershoot != m_easingGraph->overshoot()) && (m_easingGraph->easingShape()==QLatin1String("Back"))) { m_easingGraph->setOvershoot(newOvershoot); @@ -358,7 +371,7 @@ void QmlEditorWidgets::EasingContextPane::on_overshootSpinBox_valueChanged(doubl } } -void QmlEditorWidgets::EasingContextPane::on_playButton_clicked() +void QmlEditorWidgets::EasingContextPane::playClicked() { setGraphDisplayMode(SimulationMode); startAnimation(); diff --git a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h index 4c50bf08b3..bb9dcb35ea 100644 --- a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h +++ b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.h @@ -73,13 +73,13 @@ private: EasingSimulation *m_simulation; private slots: - void on_playButton_clicked(); - void on_overshootSpinBox_valueChanged(double); - void on_periodSpinBox_valueChanged(double); - void on_amplitudeSpinBox_valueChanged(double); - void on_easingExtremesComboBox_currentIndexChanged(int); - void on_easingShapeComboBox_currentIndexChanged(int); - void on_durationSpinBox_valueChanged(int); + void playClicked(); + void overshootChanged(double); + void periodChanged(double); + void amplitudeChanged(double); + void easingExtremesChanged(int); + void easingShapeChanged(int); + void durationChanged(int); void switchToGraph(); }; |