diff options
author | Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> | 2024-01-19 18:06:58 +0100 |
---|---|---|
committer | Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> | 2024-02-21 14:27:54 +0100 |
commit | 8d3ed392bb51dc70c04aa521f1380616a78be7a9 (patch) | |
tree | cbc8915d96f43b3e94e562ba1128b0508dc59d59 /examples | |
parent | 7b4221002e12716868ff21d462bc427795db4e37 (diff) |
Update manual tests and examples for change in default size policy
The size policy of item updated as part of task QTBUG-117597. This
patch update existing examples and manual tests that depends on quick
layout to embrace size policy change.
Task-number: QTBUG-117597
Pick-to: 6.7
Change-Id: I68469a3bba3c4d3e5ed4b6eae0fd765b5206efc0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'examples')
20 files changed, 53 insertions, 0 deletions
diff --git a/examples/core/permissions/Main.qml b/examples/core/permissions/Main.qml index 691af037be..5d2aeaa16f 100644 --- a/examples/core/permissions/Main.qml +++ b/examples/core/permissions/Main.qml @@ -86,6 +86,7 @@ Window { text: qsTr("Request location permissions") enabled: locationPermission.status !== Qt.Denied Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: false onClicked: locationPermission.request() } diff --git a/examples/quick/layouts/layouts.qml b/examples/quick/layouts/layouts.qml index ded8ccbf95..92fe305559 100644 --- a/examples/quick/layouts/layouts.qml +++ b/examples/quick/layouts/layouts.qml @@ -30,6 +30,7 @@ ApplicationWindow { id: rowBox title: qsTr("Row layout") Layout.fillWidth: true + Layout.fillHeight: false Layout.minimumWidth: rowLayout.Layout.minimumWidth + 30 RowLayout { @@ -41,6 +42,7 @@ ApplicationWindow { } Button { text: qsTr("Button") + Layout.fillWidth: false } } } @@ -49,6 +51,7 @@ ApplicationWindow { id: gridBox title: qsTr("Grid layout") Layout.fillWidth: true + Layout.fillHeight: false Layout.minimumWidth: gridLayout.Layout.minimumWidth + 30 GridLayout { diff --git a/examples/quick/localstorage/Header.qml b/examples/quick/localstorage/Header.qml index 047e49a839..a539452844 100644 --- a/examples/quick/localstorage/Header.qml +++ b/examples/quick/localstorage/Header.qml @@ -99,6 +99,7 @@ Item { font.pixelSize: 22 activeFocusOnPress: true activeFocusOnTab: true + Layout.fillWidth: false ToolTip { x: parent.width + 3 @@ -130,6 +131,7 @@ Item { font.pixelSize: 22 activeFocusOnPress: true activeFocusOnTab: true + Layout.fillWidth: false onFocusChanged: if (focus) oldString = descInput.text onEditingFinished: function() { if (descInput.text.length < 8 && descInput.text !== descInput.oldString && root.enabled) @@ -143,6 +145,7 @@ Item { font.pixelSize: 22 activeFocusOnPress: true activeFocusOnTab: true + Layout.fillWidth: false validator: RegularExpressionValidator { regularExpression: /\d{1,3}/ } diff --git a/examples/quick/localstorage/localstorage.qml b/examples/quick/localstorage/localstorage.qml index 77bf63adf0..3bed3e99df 100644 --- a/examples/quick/localstorage/localstorage.qml +++ b/examples/quick/localstorage/localstorage.qml @@ -37,6 +37,7 @@ Window { RowLayout { Button { text: qsTr("New") + Layout.fillWidth: false onClicked: { input.initrec_new() window.creatingNewEntry = true @@ -47,6 +48,7 @@ Window { id: saveButton enabled: (window.creatingNewEntry || window.editingEntry) && listView.currentIndex !== -1 text: qsTr("Save") + Layout.fillWidth: false onClicked: { let insertedRow = false; if (listView.model.get(listView.currentIndex).id < 1) { @@ -80,6 +82,7 @@ Window { id: editButton text: qsTr("Edit") enabled: !window.creatingNewEntry && !window.editingEntry && listView.currentIndex !== -1 + Layout.fillWidth: false onClicked: { input.editrec(listView.model.get(listView.currentIndex).date, listView.model.get(listView.currentIndex).trip_desc, @@ -93,6 +96,7 @@ Window { id: deleteButton text: qsTr("Delete") enabled: !window.creatingNewEntry && listView.currentIndex !== -1 + Layout.fillWidth: false onClicked: { JS.dbDeleteRow(listView.model.get(listView.currentIndex).id) listView.model.remove(listView.currentIndex, 1) @@ -107,6 +111,7 @@ Window { id: cancelButton text: qsTr("Cancel") enabled: (window.creatingNewEntry || window.editingEntry) && listView.currentIndex !== -1 + Layout.fillWidth: false onClicked: { if (listView.model.get(listView.currentIndex).id === 0) { // This entry had an id of 0, which means it was being created and hadn't @@ -121,6 +126,7 @@ Window { } Button { text: qsTr("Exit") + Layout.fillWidth: false onClicked: Qt.quit() } } diff --git a/examples/quick/responsivelayouts/responsivelayouts.qml b/examples/quick/responsivelayouts/responsivelayouts.qml index 4762c2c923..f9ef99612d 100644 --- a/examples/quick/responsivelayouts/responsivelayouts.qml +++ b/examples/quick/responsivelayouts/responsivelayouts.qml @@ -138,6 +138,7 @@ Window { LayoutItemProxy { Layout.fillHeight: true + Layout.fillWidth: false target: contentItem } } diff --git a/examples/quick/scenegraph/rhitextureitem/main.qml b/examples/quick/scenegraph/rhitextureitem/main.qml index 2c7a4fbe0d..dd664eaa57 100644 --- a/examples/quick/scenegraph/rhitextureitem/main.qml +++ b/examples/quick/scenegraph/rhitextureitem/main.qml @@ -172,6 +172,7 @@ Item { from: 8 to: 2048 value: 128 + Layout.fillWidth: false } } @@ -197,6 +198,7 @@ Item { from: 0 to: 1.0 value: 1.0 + Layout.fillWidth: false } } @@ -234,18 +236,22 @@ Item { id: rdFormatRGBA8 text: qsTr("8-bit RGBA") checked: true + Layout.fillWidth: false } RadioButton { id: rdFormatFP16 text: qsTr("Half-float RGBA") + Layout.fillWidth: false } RadioButton { id: rdFormatFP32 text: qsTr("Float RGBA") + Layout.fillWidth: false } RadioButton { id: rdFormatRGB10A2 text: qsTr("10-bit RGB, 2-bit A") + Layout.fillWidth: false } } } diff --git a/examples/quick/tableview/gameoflife/main.qml b/examples/quick/tableview/gameoflife/main.qml index bedb624223..55c5b193f8 100644 --- a/examples/quick/tableview/gameoflife/main.qml +++ b/examples/quick/tableview/gameoflife/main.qml @@ -74,6 +74,7 @@ ApplicationWindow { text: qsTr("Next") onClicked: gameOfLifeModel.nextStep() Layout.rightMargin: 50 + Layout.fillWidth: false } //! [next] @@ -82,10 +83,12 @@ ApplicationWindow { from: 0 to: 1 value: 0.9 + Layout.fillWidth: false } Button { text: timer.running ? "❙❙" : "▶️" + Layout.fillWidth: false onClicked: timer.running = !timer.running } } diff --git a/examples/quickcontrols/attachedstyleproperties/attachedstyleproperties.qml b/examples/quickcontrols/attachedstyleproperties/attachedstyleproperties.qml index d1674d05e8..95ff4418e8 100644 --- a/examples/quickcontrols/attachedstyleproperties/attachedstyleproperties.qml +++ b/examples/quickcontrols/attachedstyleproperties/attachedstyleproperties.qml @@ -32,6 +32,7 @@ ApplicationWindow { Switch { id: darkModeSwitch text: qsTr("Dark mode") + Layout.fillWidth: false } } } @@ -48,11 +49,13 @@ ApplicationWindow { RowLayout { Button { text: qsTr("Open Popup") + Layout.fillWidth: false onClicked: popup.open() } Button { text: qsTr("Open Window") + Layout.fillWidth: false onClicked: { if (!childWindow.active) childWindow.show() @@ -80,6 +83,7 @@ ApplicationWindow { Button { text: qsTr("Close Popup") Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: false onClicked: popup.close() } } @@ -103,6 +107,7 @@ ApplicationWindow { Button { text: qsTr("Close Window") Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: false onClicked: childWindow.close() } } diff --git a/examples/quickcontrols/chattutorial/chapter3/ConversationPage.qml b/examples/quickcontrols/chattutorial/chapter3/ConversationPage.qml index 8f3a64485c..9a4f1861bd 100644 --- a/examples/quickcontrols/chattutorial/chapter3/ConversationPage.qml +++ b/examples/quickcontrols/chattutorial/chapter3/ConversationPage.qml @@ -77,6 +77,7 @@ Page { Pane { id: pane Layout.fillWidth: true + Layout.fillHeight: false RowLayout { width: parent.width @@ -92,6 +93,7 @@ Page { id: sendButton text: qsTr("Send") enabled: messageField.length > 0 + Layout.fillWidth: false } } } diff --git a/examples/quickcontrols/chattutorial/chapter4/ConversationPage.qml b/examples/quickcontrols/chattutorial/chapter4/ConversationPage.qml index 44c39b40bd..87ed487c66 100644 --- a/examples/quickcontrols/chattutorial/chapter4/ConversationPage.qml +++ b/examples/quickcontrols/chattutorial/chapter4/ConversationPage.qml @@ -99,6 +99,7 @@ Page { Pane { id: pane Layout.fillWidth: true + Layout.fillHeight: false RowLayout { width: parent.width @@ -114,6 +115,7 @@ Page { id: sendButton text: qsTr("Send") enabled: messageField.length > 0 + Layout.fillWidth: false onClicked: { listView.model.sendMessage(root.inConversationWith, messageField.text) messageField.text = "" diff --git a/examples/quickcontrols/chattutorial/chapter5/ConversationPage.qml b/examples/quickcontrols/chattutorial/chapter5/ConversationPage.qml index 75129b43d8..db45deac5b 100644 --- a/examples/quickcontrols/chattutorial/chapter5/ConversationPage.qml +++ b/examples/quickcontrols/chattutorial/chapter5/ConversationPage.qml @@ -98,6 +98,7 @@ Page { Pane { id: pane Layout.fillWidth: true + Layout.fillHeight: false RowLayout { width: parent.width @@ -113,6 +114,7 @@ Page { id: sendButton text: qsTr("Send") enabled: messageField.length > 0 + Layout.fillWidth: false onClicked: { listView.model.sendMessage(root.inConversationWith, messageField.text) messageField.text = "" diff --git a/examples/quickcontrols/filesystemexplorer/qml/Editor.qml b/examples/quickcontrols/filesystemexplorer/qml/Editor.qml index 80f7c04c57..2f995c88c9 100644 --- a/examples/quickcontrols/filesystemexplorer/qml/Editor.qml +++ b/examples/quickcontrols/filesystemexplorer/qml/Editor.qml @@ -36,6 +36,7 @@ Rectangle { Layout.preferredWidth: fontMetrics.averageCharacterWidth * (Math.floor(Math.log10(textArea.lineCount)) + 1) + 10 Layout.fillHeight: true + Layout.fillWidth: false interactive: false contentY: editorFlickable.contentY diff --git a/examples/quickcontrols/filesystemexplorer/qml/Sidebar.qml b/examples/quickcontrols/filesystemexplorer/qml/Sidebar.qml index aac5303942..f739e0f930 100644 --- a/examples/quickcontrols/filesystemexplorer/qml/Sidebar.qml +++ b/examples/quickcontrols/filesystemexplorer/qml/Sidebar.qml @@ -50,6 +50,8 @@ Rectangle { id: tabBarComponent Layout.fillWidth: true + Layout.fillHeight: false + // ButtonGroup ensures that only one button can be checked at a time. ButtonGroup { buttons: tabBarComponent.contentChildren diff --git a/examples/quickcontrols/flatstyle/MainForm.ui.qml b/examples/quickcontrols/flatstyle/MainForm.ui.qml index 389ee893c3..ff05a2dcef 100644 --- a/examples/quickcontrols/flatstyle/MainForm.ui.qml +++ b/examples/quickcontrols/flatstyle/MainForm.ui.qml @@ -94,6 +94,7 @@ Item { id: button text: qsTr("Change Color") Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + Layout.fillWidth: false } } } diff --git a/examples/quickcontrols/imagine/automotive/qml/automotive.qml b/examples/quickcontrols/imagine/automotive/qml/automotive.qml index 2f116f0eca..9ed2f5996d 100644 --- a/examples/quickcontrols/imagine/automotive/qml/automotive.qml +++ b/examples/quickcontrols/imagine/automotive/qml/automotive.qml @@ -277,6 +277,7 @@ ApplicationWindow { Frame { Layout.fillWidth: true + Layout.fillHeight: false ColumnLayout { anchors.fill: parent @@ -290,15 +291,18 @@ ApplicationWindow { RadioButton { text: qsTr("Name") font.pixelSize: fontSizeExtraSmall + Layout.fillWidth: false } RadioButton { text: qsTr("Frequency") font.pixelSize: fontSizeExtraSmall + Layout.fillWidth: false } RadioButton { text: qsTr("Favourites") font.pixelSize: fontSizeExtraSmall checked: true + Layout.fillWidth: false } } } @@ -533,6 +537,7 @@ ApplicationWindow { currentIndex: 1 Layout.fillHeight: true + Layout.fillWidth: false ButtonGroup { buttons: rightTabBarContentLayout.children @@ -557,6 +562,7 @@ ApplicationWindow { Layout.maximumHeight: navigationFeatureButton.height Layout.fillHeight: true + Layout.fillWidth: false } FeatureButton { text: qsTr("Air Con.") @@ -565,6 +571,7 @@ ApplicationWindow { Layout.maximumHeight: navigationFeatureButton.height Layout.fillHeight: true + Layout.fillWidth: false } FeatureButton { text: qsTr("Seats") @@ -572,6 +579,7 @@ ApplicationWindow { Layout.maximumHeight: navigationFeatureButton.height Layout.fillHeight: true + Layout.fillWidth: false } FeatureButton { text: qsTr("Statistics") @@ -579,6 +587,7 @@ ApplicationWindow { Layout.maximumHeight: navigationFeatureButton.height Layout.fillHeight: true + Layout.fillWidth: false } } } diff --git a/examples/quickcontrols/ios/todolist/HomePage.qml b/examples/quickcontrols/ios/todolist/HomePage.qml index 7693aab119..39753e0be7 100644 --- a/examples/quickcontrols/ios/todolist/HomePage.qml +++ b/examples/quickcontrols/ios/todolist/HomePage.qml @@ -141,6 +141,7 @@ Page { enabled: newProjectTextField.length > 0 Layout.alignment: Qt.AlignHCenter + Layout.fillWidth: false onClicked: { let results = Database.newProject(newProjectTextField.text) diff --git a/examples/quickcontrols/ios/todolist/MaxTasksPage.qml b/examples/quickcontrols/ios/todolist/MaxTasksPage.qml index 2f4b649ea0..5b1a854617 100644 --- a/examples/quickcontrols/ios/todolist/MaxTasksPage.qml +++ b/examples/quickcontrols/ios/todolist/MaxTasksPage.qml @@ -29,6 +29,7 @@ Page { Layout.alignment: Qt.AlignHCenter Layout.topMargin: 10 + Layout.fillWidth: false onValueModified: AppSettings.maxTasks = maxTasksSpinbox.value } diff --git a/examples/quickcontrols/ios/todolist/ProjectPage.qml b/examples/quickcontrols/ios/todolist/ProjectPage.qml index 9868a97d28..8319206fe9 100644 --- a/examples/quickcontrols/ios/todolist/ProjectPage.qml +++ b/examples/quickcontrols/ios/todolist/ProjectPage.qml @@ -53,6 +53,7 @@ Page { value: root.completedTasks to: root.totalTasks Layout.leftMargin: 20 + Layout.fillWidth: false } } diff --git a/examples/quickcontrols/ios/todolist/ToggleCompletedTasksPage.qml b/examples/quickcontrols/ios/todolist/ToggleCompletedTasksPage.qml index dbe922aa40..7e42eaf8f3 100644 --- a/examples/quickcontrols/ios/todolist/ToggleCompletedTasksPage.qml +++ b/examples/quickcontrols/ios/todolist/ToggleCompletedTasksPage.qml @@ -27,6 +27,7 @@ Page { Layout.alignment: Qt.AlignHCenter Layout.topMargin: 10 + Layout.fillWidth: false onClicked: AppSettings.showDoneTasks = checked } diff --git a/examples/quickcontrols/texteditor/qml/+touch/texteditor.qml b/examples/quickcontrols/texteditor/qml/+touch/texteditor.qml index f0220f97b3..376a8341eb 100644 --- a/examples/quickcontrols/texteditor/qml/+touch/texteditor.qml +++ b/examples/quickcontrols/texteditor/qml/+touch/texteditor.qml @@ -85,6 +85,7 @@ ApplicationWindow { text: "\uE809" // icon-ok opacity: !textArea.readOnly ? 1 : 0 onClicked: textArea.readOnly = true + Layout.fillWidth: false } Label { @@ -99,6 +100,7 @@ ApplicationWindow { font.family: "fontello" text: "\uF142" // icon-ellipsis-vert onClicked: menu.open() + Layout.fillWidth: false Menu { id: menu |