diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2020-01-25 20:43:13 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2020-01-28 06:24:25 +0100 |
commit | fb7c9dfc060a09b4b1fa6d474f106bb6c1d2d4df (patch) | |
tree | c083bd67b4a1a3abb6e90221cb8a69b4314c1c75 /examples/widgets/animation/easing | |
parent | 4bb897a3841f0f79150787e29fe122e1410bc119 (diff) |
QButtonGroup: deprecate overloaded signals
Deprecate the overloaded signals
buttonClicked/buttonPressed/buttonReleased/buttonToggled taking an int
to avoid to need to use QOverload<> when connecting the signal. The id
of a button in a button group can be easily fetched with
QButtonGroup::id().
Task-number: QTBUG-80906
Change-Id: Idaaab54bbcb25cba543fc99f305b9f4743ee3ed8
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'examples/widgets/animation/easing')
-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); |