diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-01-28 18:27:28 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-01-28 18:28:27 +0100 |
commit | 4cbadf699838406d14366ce61deec03cf45113f7 (patch) | |
tree | b4f22e81025a584aaef93f9a0919d7829bd77de2 /examples/widgets/animation | |
parent | 1bd60749d140d14d152b59eccbda4790c517c54e (diff) | |
parent | a4ea0d9eacd574a6a96f70b138dcb111e9d11d21 (diff) |
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
Diffstat (limited to 'examples/widgets/animation')
-rw-r--r-- | examples/widgets/animation/easing/window.cpp | 7 | ||||
-rw-r--r-- | examples/widgets/animation/easing/window.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/examples/widgets/animation/easing/window.cpp b/examples/widgets/animation/easing/window.cpp index d1d6348361..378af07535 100644 --- a/examples/widgets/animation/easing/window.cpp +++ b/examples/widgets/animation/easing/window.cpp @@ -67,7 +67,7 @@ Window::Window(QWidget *parent) connect(m_ui.easingCurvePicker, &QListWidget::currentRowChanged, this, &Window::curveChanged); - connect(m_ui.buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked), + connect(m_ui.buttonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &Window::pathChanged); connect(m_ui.periodSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &Window::periodChanged); @@ -180,9 +180,10 @@ void Window::curveChanged(int row) m_ui.overshootSpinBox->setEnabled(curveType >= QEasingCurve::InBack && curveType <= QEasingCurve::OutInBack); } -void Window::pathChanged(int index) +void Window::pathChanged(QAbstractButton *button) { - m_anim->setPathType((Animation::PathType)index); + const int index = m_ui.buttonGroup->id(button); + m_anim->setPathType(Animation::PathType(index)); } void Window::periodChanged(double value) diff --git a/examples/widgets/animation/easing/window.h b/examples/widgets/animation/easing/window.h index 541377a981..0c49dd6e8a 100644 --- a/examples/widgets/animation/easing/window.h +++ b/examples/widgets/animation/easing/window.h @@ -69,7 +69,7 @@ public: Window(QWidget *parent = nullptr); private slots: void curveChanged(int row); - void pathChanged(int index); + void pathChanged(QAbstractButton *button); void periodChanged(double); void amplitudeChanged(double); void overshootChanged(double); |