aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets/layouts/responsiveDeclarative.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/doc/snippets/layouts/responsiveDeclarative.qml')
-rw-r--r--src/quick/doc/snippets/layouts/responsiveDeclarative.qml33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/quick/doc/snippets/layouts/responsiveDeclarative.qml b/src/quick/doc/snippets/layouts/responsiveDeclarative.qml
new file mode 100644
index 0000000000..e5a0c6c4f4
--- /dev/null
+++ b/src/quick/doc/snippets/layouts/responsiveDeclarative.qml
@@ -0,0 +1,33 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Window
+import QtQuick.Controls
+
+Window {
+ visible: true
+ width: 350
+ height: 250
+ //! [document]
+ GridLayout {
+ columns: width < 300 ? 1 : 2
+ anchors.fill: parent
+
+ Rectangle {
+ id: rectangle1
+ color: "tomato"
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ }
+
+ Rectangle {
+ id: rectangle2
+ color: "lightskyblue"
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ }
+ }
+ //! [document]
+}