summaryrefslogtreecommitdiffstats
path: root/examples/widgets/animation
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/animation')
-rw-r--r--examples/widgets/animation/easing/window.cpp7
-rw-r--r--examples/widgets/animation/easing/window.h2
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);