summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting/affine/xform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/painting/affine/xform.cpp')
-rw-r--r--examples/widgets/painting/affine/xform.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp
index 4e7cb91ce1..d7ed2125d2 100644
--- a/examples/widgets/painting/affine/xform.cpp
+++ b/examples/widgets/painting/affine/xform.cpp
@@ -787,8 +787,8 @@ XFormWidget::XFormWidget(QWidget *parent)
view = new XFormView(this);
view->setMinimumSize(200, 200);
- QGroupBox *mainGroup = new QGroupBox(this);
- mainGroup->setFixedWidth(180);
+ QWidget *mainContentWidget = new QWidget();
+ QGroupBox *mainGroup = new QGroupBox(mainContentWidget);
mainGroup->setTitle(tr("Affine Transformations"));
QGroupBox *rotateGroup = new QGroupBox(mainGroup);
@@ -837,10 +837,6 @@ XFormWidget::XFormWidget(QWidget *parent)
whatsThisButton->setText(tr("What's This?"));
whatsThisButton->setCheckable(true);
- QHBoxLayout *viewLayout = new QHBoxLayout(this);
- viewLayout->addWidget(view);
- viewLayout->addWidget(mainGroup);
-
QVBoxLayout *rotateGroupLayout = new QVBoxLayout(rotateGroup);
rotateGroupLayout->addWidget(rotateSlider);
@@ -871,6 +867,20 @@ XFormWidget::XFormWidget(QWidget *parent)
#endif
mainGroupLayout->addWidget(whatsThisButton);
+ mainGroup->setLayout(mainGroupLayout);
+
+ QVBoxLayout *mainContentLayout = new QVBoxLayout();
+ mainContentLayout->addWidget(mainGroup);
+ mainContentWidget->setLayout(mainContentLayout);
+
+ QScrollArea *mainScrollArea = new QScrollArea();
+ mainScrollArea->setWidget(mainContentWidget);
+ mainScrollArea->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
+
+ QHBoxLayout *viewLayout = new QHBoxLayout(this);
+ viewLayout->addWidget(view);
+ viewLayout->addWidget(mainScrollArea);
+
connect(rotateSlider, &QSlider::valueChanged, view, &XFormView::changeRotation);
connect(shearSlider, &QSlider::valueChanged, view, &XFormView::changeShear);
connect(scaleSlider, &QSlider::valueChanged, view, &XFormView::changeScale);