diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-12-18 16:39:34 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-12-19 06:06:14 +0100 |
commit | f3fb89ba298e1741320d8bfac9cbd0d503373bff (patch) | |
tree | 86d73060497357f6edea58ebcb26a8b74919f4dc /examples/widgets/widgets/sliders/window.h | |
parent | 4a19e97f70994bc8bb67e26533d18266b8a615bc (diff) |
Update Sliders example
Simplify the "responsive layout" implementation. Just use a QBoxLayout
with changing direction instead of repopulating a QGridLayout, and
change the orientation of one set of sliders instead of creating two
sets in a stacked layout.
Simplify the resizeEvent() implementation accordingly.
Update the documentation snippet text to match the code, and document
the resizeEvent() override.
Pick-to: 6.7 6.6
Fixes: QTBUG-119977
Change-Id: I73a1bb215c956fa283291ebf0ea45ff9a975c727
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'examples/widgets/widgets/sliders/window.h')
-rw-r--r-- | examples/widgets/widgets/sliders/window.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/examples/widgets/widgets/sliders/window.h b/examples/widgets/widgets/sliders/window.h index fa627eabd3..8d7338f27c 100644 --- a/examples/widgets/widgets/sliders/window.h +++ b/examples/widgets/widgets/sliders/window.h @@ -29,9 +29,7 @@ private: void createControls(const QString &title); void resizeEvent(QResizeEvent *e); - SlidersGroup *horizontalSliders; - SlidersGroup *verticalSliders; - QStackedWidget *stackedWidget; + SlidersGroup *slidersGroup; QGroupBox *controlsGroup; QLabel *minimumLabel; @@ -42,9 +40,7 @@ private: QSpinBox *minimumSpinBox; QSpinBox *maximumSpinBox; QSpinBox *valueSpinBox; - QComboBox *orientationCombo; - QGridLayout *layout; - double oldAspectRatio; + QBoxLayout *layout; }; //! [0] |