summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets/sliders/window.h
diff options
context:
space:
mode:
authorElias Hautala <Elias.Hautala@qt.io>2022-08-03 11:25:49 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-15 16:19:15 +0000
commit15f15fa8db6cce0ecf64314be9444c3d94c6a9cb (patch)
tree2e6e1f8144d8942a5086229f97f7559fc0b6ba59 /examples/widgets/widgets/sliders/window.h
parent807fd5684a42cefa63319bfe4dde2bbbca8eefa8 (diff)
Sliders: Add function that changes widgets position on layout
Changes the layout to QGridLayout and adds function to change widgets position on the layout depending on the windows aspect ratio. Before this the widgets wouldn't fit on screen when using the example on Android in portrait. Fixes: QTCREATORBUG-27685 Change-Id: I00009cb6c8c250a8333ac3dfa635f70da4576d5e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Jani Korteniemi <jani.korteniemi@qt.io> (cherry picked from commit 1a6019438881b9aa54cfc8dbd3f8fc06ddc35d67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/widgets/widgets/sliders/window.h')
-rw-r--r--examples/widgets/widgets/sliders/window.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/widgets/widgets/sliders/window.h b/examples/widgets/widgets/sliders/window.h
index 8a98fcb2a1..fa627eabd3 100644
--- a/examples/widgets/widgets/sliders/window.h
+++ b/examples/widgets/widgets/sliders/window.h
@@ -5,6 +5,7 @@
#define WINDOW_H
#include <QWidget>
+#include <QGridLayout>
QT_BEGIN_NAMESPACE
class QCheckBox;
@@ -26,6 +27,7 @@ public:
private:
void createControls(const QString &title);
+ void resizeEvent(QResizeEvent *e);
SlidersGroup *horizontalSliders;
SlidersGroup *verticalSliders;
@@ -41,6 +43,8 @@ private:
QSpinBox *maximumSpinBox;
QSpinBox *valueSpinBox;
QComboBox *orientationCombo;
+ QGridLayout *layout;
+ double oldAspectRatio;
};
//! [0]