From 3122236e7bcd035b9a388cc4ab6aa91d1541ef29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Tue, 2 Jun 2020 16:29:04 +0200 Subject: Fix some bugs in the example that was introduced by moving over to QQC2 Most of the bugs was due to moving over to Qt Quick Controls 2, except from the binding we had to explicitly break now. That should probably have been done when we used Qt Quick Controls too. Change-Id: Ic558679802ea35e727eadc570cf299f9da4a3604 Reviewed-by: Mitch Curtis --- examples/quick/layouts/layouts.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/quick/layouts/layouts.qml b/examples/quick/layouts/layouts.qml index 76afa02e4a..8a1cb20d22 100644 --- a/examples/quick/layouts/layouts.qml +++ b/examples/quick/layouts/layouts.qml @@ -58,8 +58,12 @@ ApplicationWindow { visible: true title: "Basic layouts" property int margin: 11 - width: mainLayout.implicitWidth + 2 * margin - height: mainLayout.implicitHeight + 2 * margin + + Component.onCompleted: { + width = mainLayout.implicitWidth + 2 * margin + height = mainLayout.implicitHeight + 2 * margin + } + minimumWidth: mainLayout.Layout.minimumWidth + 2 * margin minimumHeight: mainLayout.Layout.minimumHeight + 2 * margin @@ -71,6 +75,7 @@ ApplicationWindow { id: rowBox title: "Row layout" Layout.fillWidth: true + Layout.minimumWidth: rowLayout.Layout.minimumWidth + 30 RowLayout { id: rowLayout @@ -89,6 +94,7 @@ ApplicationWindow { id: gridBox title: "Grid layout" Layout.fillWidth: true + Layout.minimumWidth: gridLayout.Layout.minimumWidth + 30 GridLayout { id: gridLayout @@ -107,9 +113,12 @@ ApplicationWindow { TextArea { text: "This widget spans over three rows in the GridLayout.\n" + "All items in the GridLayout are implicitly positioned from top to bottom." + wrapMode: TextArea.WordWrap Layout.rowSpan: 3 Layout.fillHeight: true Layout.fillWidth: true + Layout.minimumHeight: implicitHeight + Layout.minimumWidth: 100 // guesstimate, should be size of largest word } } } @@ -125,6 +134,7 @@ ApplicationWindow { title: "Stack layout" implicitWidth: 200 implicitHeight: 60 + Layout.minimumHeight: 60 Layout.fillWidth: true Layout.fillHeight: true StackLayout { -- cgit v1.2.3