aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/doc/snippets/qml')
-rw-r--r--src/quick/doc/snippets/qml/anchoranimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/anchorchanges.qml2
-rw-r--r--src/quick/doc/snippets/qml/animatedimage.qml2
-rw-r--r--src/quick/doc/snippets/qml/animation.qml2
-rw-r--r--src/quick/doc/snippets/qml/animators.qml2
-rw-r--r--src/quick/doc/snippets/qml/behavior.qml2
-rw-r--r--src/quick/doc/snippets/qml/borderimage/borderimage-rounded.qml124
-rw-r--r--src/quick/doc/snippets/qml/borderimage/borderimage-scaled.qml92
-rw-r--r--src/quick/doc/snippets/qml/borderimage/borderimage-tiled.qml92
-rw-r--r--src/quick/doc/snippets/qml/borderimage/normal-image.qml48
-rw-r--r--src/quick/doc/snippets/qml/borderimage/pics/borderframe.pngbin0 -> 3411 bytes
-rw-r--r--src/quick/doc/snippets/qml/borderimage/pics/borderframe.svg91
-rw-r--r--src/quick/doc/snippets/qml/boundaryRule.qml4
-rw-r--r--src/quick/doc/snippets/qml/coloranimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/colors.qml2
-rw-r--r--src/quick/doc/snippets/qml/column/column-transitions.qml2
-rw-r--r--src/quick/doc/snippets/qml/column/column.qml2
-rw-r--r--src/quick/doc/snippets/qml/column/vertical-positioner.qml2
-rw-r--r--src/quick/doc/snippets/qml/drag.qml2
-rw-r--r--src/quick/doc/snippets/qml/example.md146
-rw-r--r--src/quick/doc/snippets/qml/externalDragScaledImage.qml28
-rw-r--r--src/quick/doc/snippets/qml/externaldrag.qml8
-rw-r--r--src/quick/doc/snippets/qml/flickable.qml2
-rw-r--r--src/quick/doc/snippets/qml/flickableScrollbar.qml2
-rw-r--r--src/quick/doc/snippets/qml/flipable/flipable.qml2
-rw-r--r--src/quick/doc/snippets/qml/flow.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/MyClickableWidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/MyWidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/advancedFocus.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/basicwidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/clickablewidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/rectangle.qml2
-rw-r--r--src/quick/doc/snippets/qml/focus/widget.qml2
-rw-r--r--src/quick/doc/snippets/qml/font.qml22
-rw-r--r--src/quick/doc/snippets/qml/gradient.qml2
-rw-r--r--src/quick/doc/snippets/qml/grid-spacing.qml2
-rw-r--r--src/quick/doc/snippets/qml/grid/grid.qml2
-rw-r--r--src/quick/doc/snippets/qml/gridview/ContactModel.qml2
-rw-r--r--src/quick/doc/snippets/qml/gridview/gridview.qml2
-rw-r--r--src/quick/doc/snippets/qml/image.qml2
-rw-r--r--src/quick/doc/snippets/qml/images/qt-logo.pngbin0 -> 6208 bytes
-rw-r--r--src/quick/doc/snippets/qml/images/qt_logo.svg26
-rw-r--r--src/quick/doc/snippets/qml/images/red.pngbin0 -> 130 bytes
-rw-r--r--src/quick/doc/snippets/qml/item/childrenRect.qml2
-rw-r--r--src/quick/doc/snippets/qml/item/containmentMask-circle-js.qml4
-rw-r--r--src/quick/doc/snippets/qml/item/containmentMask-shape.qml4
-rw-r--r--src/quick/doc/snippets/qml/item/itemGrab.qml7
-rw-r--r--src/quick/doc/snippets/qml/keynavigation.qml2
-rw-r--r--src/quick/doc/snippets/qml/keys/keys-handler.qml2
-rw-r--r--src/quick/doc/snippets/qml/keys/keys-pressed.qml2
-rw-r--r--src/quick/doc/snippets/qml/layerblending.qml2
-rw-r--r--src/quick/doc/snippets/qml/layout-simple.qml6
-rw-r--r--src/quick/doc/snippets/qml/layoutmirroring.qml2
-rw-r--r--src/quick/doc/snippets/qml/listview-decorations.qml5
-rw-r--r--src/quick/doc/snippets/qml/listview-sections.qml2
-rw-r--r--src/quick/doc/snippets/qml/listview.qml2
-rw-r--r--src/quick/doc/snippets/qml/listview/ContactModel.qml2
-rw-r--r--src/quick/doc/snippets/qml/listview/ReusableDelegate.qml2
-rw-r--r--src/quick/doc/snippets/qml/listview/listview.qml2
-rw-r--r--src/quick/doc/snippets/qml/loader/KeyReader.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/MyComponent.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/MyItem.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/connections.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/creationContext1.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/creationContext2.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/creationContext3.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/creationContext4.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/focus.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/simple.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/sizeitem.qml4
-rw-r--r--src/quick/doc/snippets/qml/loader/sizeloader.qml4
-rw-r--r--src/quick/doc/snippets/qml/localstorage/hello.qml2
-rw-r--r--src/quick/doc/snippets/qml/models/views-models-delegates.qml2
-rw-r--r--src/quick/doc/snippets/qml/mousearea/mousearea-snippet.qml2
-rw-r--r--src/quick/doc/snippets/qml/mousearea/mousearea.qml2
-rw-r--r--src/quick/doc/snippets/qml/mousearea/mouseareadragfilter.qml2
-rw-r--r--src/quick/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml2
-rw-r--r--src/quick/doc/snippets/qml/nestedWindowTransientParent.qml23
-rw-r--r--src/quick/doc/snippets/qml/numberanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/parallelanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/parentanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/parentchange.qml2
-rw-r--r--src/quick/doc/snippets/qml/path/arcdirection.qml2
-rw-r--r--src/quick/doc/snippets/qml/path/arcradius.qml2
-rw-r--r--src/quick/doc/snippets/qml/path/arcrotation.qml2
-rw-r--r--src/quick/doc/snippets/qml/path/basicarc.qml2
-rw-r--r--src/quick/doc/snippets/qml/path/basiccurve.qml2
-rw-r--r--src/quick/doc/snippets/qml/path/largearc.qml2
-rw-r--r--src/quick/doc/snippets/qml/pathinterpolator.qml2
-rw-r--r--src/quick/doc/snippets/qml/pathview/ContactModel.qml2
-rw-r--r--src/quick/doc/snippets/qml/pathview/pathattributes.qml2
-rw-r--r--src/quick/doc/snippets/qml/pathview/pathview.qml11
-rw-r--r--src/quick/doc/snippets/qml/propertyaction-sequential.qml2
-rw-r--r--src/quick/doc/snippets/qml/propertyaction.qml2
-rw-r--r--src/quick/doc/snippets/qml/propertyanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/propertychanges.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-data-models/dynamic-listmodel.qml10
-rw-r--r--src/quick/doc/snippets/qml/qml-data-models/listelements.qml10
-rw-r--r--src/quick/doc/snippets/qml/qml-data-models/listmodel-listview-required.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-data-models/listmodel-listview.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/components/application.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/alias-override.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/alias.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/application.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/connectslots.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/no-parameters.qml2
-rw-r--r--src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml2
-rw-r--r--src/quick/doc/snippets/qml/rectangle/rectangle-colors.qml2
-rw-r--r--src/quick/doc/snippets/qml/rectangle/rectangle-gradient.qml2
-rw-r--r--src/quick/doc/snippets/qml/rectangle/rectangle.qml2
-rw-r--r--src/quick/doc/snippets/qml/regularexpression.qml2
-rw-r--r--src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml2
-rw-r--r--src/quick/doc/snippets/qml/repeaters/repeater.qml12
-rw-r--r--src/quick/doc/snippets/qml/righttoleft.qml2
-rw-r--r--src/quick/doc/snippets/qml/righttoleft/Child.qml2
-rw-r--r--src/quick/doc/snippets/qml/rotation.qml2
-rw-r--r--src/quick/doc/snippets/qml/rotationanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/row.qml2
-rw-r--r--src/quick/doc/snippets/qml/row/row.qml2
-rw-r--r--src/quick/doc/snippets/qml/sequentialanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/smoothedanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/splashWindow.qml57
-rw-r--r--src/quick/doc/snippets/qml/springanimation.qml2
-rw-r--r--src/quick/doc/snippets/qml/state-when.qml2
-rw-r--r--src/quick/doc/snippets/qml/state.qml2
-rw-r--r--src/quick/doc/snippets/qml/states.qml2
-rw-r--r--src/quick/doc/snippets/qml/states/statechangescript.qml2
-rw-r--r--src/quick/doc/snippets/qml/systempalette.qml2
-rw-r--r--src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h2
-rw-r--r--src/quick/doc/snippets/qml/tableview/cpp-tablemodel.qml2
-rw-r--r--src/quick/doc/snippets/qml/tableview/editdelegate.qml6
-rw-r--r--src/quick/doc/snippets/qml/tableview/keyboard-navigation.qml2
-rw-r--r--src/quick/doc/snippets/qml/tableview/qml-tablemodel.qml4
-rw-r--r--src/quick/doc/snippets/qml/tableview/reusabledelegate.qml2
-rw-r--r--src/quick/doc/snippets/qml/tableview/tableviewwithheader.qml2
-rw-r--r--src/quick/doc/snippets/qml/tableview/tableviewwithprovider.qml2
-rw-r--r--src/quick/doc/snippets/qml/text/onLinkActivated.qml2
-rw-r--r--src/quick/doc/snippets/qml/text/textEditFormats.qml2
-rw-r--r--src/quick/doc/snippets/qml/text/textFormats.qml2
-rw-r--r--src/quick/doc/snippets/qml/textEditStatusSwitch.qml31
-rw-r--r--src/quick/doc/snippets/qml/texteditor.qml2
-rw-r--r--src/quick/doc/snippets/qml/texthandling.qml2
-rw-r--r--src/quick/doc/snippets/qml/transition-animation.qml13
-rw-r--r--src/quick/doc/snippets/qml/transition-from-to-modified.qml2
-rw-r--r--src/quick/doc/snippets/qml/transition-from-to.qml2
-rw-r--r--src/quick/doc/snippets/qml/transition-reversible.qml2
-rw-r--r--src/quick/doc/snippets/qml/transition.qml2
-rw-r--r--src/quick/doc/snippets/qml/transitions-list.qml2
-rw-r--r--src/quick/doc/snippets/qml/treeview/qml-customdelegate.qml71
-rw-r--r--src/quick/doc/snippets/qml/viewtransitions/viewtransitions-basic.qml2
-rw-r--r--src/quick/doc/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml2
-rw-r--r--src/quick/doc/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml2
-rw-r--r--src/quick/doc/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml2
-rw-r--r--src/quick/doc/snippets/qml/viewtransitions/viewtransitions-pathanim.qml2
-rw-r--r--src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml2
-rw-r--r--src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml2
-rw-r--r--src/quick/doc/snippets/qml/visualparent.qml2
-rw-r--r--src/quick/doc/snippets/qml/visualparent2.qml2
-rw-r--r--src/quick/doc/snippets/qml/windowActiveAttached.qml10
-rw-r--r--src/quick/doc/snippets/qml/windowPalette.qml40
-rw-r--r--src/quick/doc/snippets/qml/windowVisibility.qml29
-rw-r--r--src/quick/doc/snippets/qml/windowconstraints.qml8
172 files changed, 1097 insertions, 245 deletions
diff --git a/src/quick/doc/snippets/qml/anchoranimation.qml b/src/quick/doc/snippets/qml/anchoranimation.qml
index 97a6c79e55..e6fed602ed 100644
--- a/src/quick/doc/snippets/qml/anchoranimation.qml
+++ b/src/quick/doc/snippets/qml/anchoranimation.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
id: container
diff --git a/src/quick/doc/snippets/qml/anchorchanges.qml b/src/quick/doc/snippets/qml/anchorchanges.qml
index d3ee2be000..7a306e0d6b 100644
--- a/src/quick/doc/snippets/qml/anchorchanges.qml
+++ b/src/quick/doc/snippets/qml/anchorchanges.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: window
diff --git a/src/quick/doc/snippets/qml/animatedimage.qml b/src/quick/doc/snippets/qml/animatedimage.qml
index 3d46887a6c..baca3f279a 100644
--- a/src/quick/doc/snippets/qml/animatedimage.qml
+++ b/src/quick/doc/snippets/qml/animatedimage.qml
@@ -5,7 +5,7 @@
// examples/quick/imageelements/animatedimage
//! [document]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: animation.width; height: animation.height + 8
diff --git a/src/quick/doc/snippets/qml/animation.qml b/src/quick/doc/snippets/qml/animation.qml
index 24d23860da..5f10726f48 100644
--- a/src/quick/doc/snippets/qml/animation.qml
+++ b/src/quick/doc/snippets/qml/animation.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
//! [parent begin]
diff --git a/src/quick/doc/snippets/qml/animators.qml b/src/quick/doc/snippets/qml/animators.qml
index 04082ba1fb..b1e929eaaf 100644
--- a/src/quick/doc/snippets/qml/animators.qml
+++ b/src/quick/doc/snippets/qml/animators.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.2
+import QtQuick
Rectangle {
diff --git a/src/quick/doc/snippets/qml/behavior.qml b/src/quick/doc/snippets/qml/behavior.qml
index 0fc6e7e289..8370863cbe 100644
--- a/src/quick/doc/snippets/qml/behavior.qml
+++ b/src/quick/doc/snippets/qml/behavior.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: rect
diff --git a/src/quick/doc/snippets/qml/borderimage/borderimage-rounded.qml b/src/quick/doc/snippets/qml/borderimage/borderimage-rounded.qml
new file mode 100644
index 0000000000..a0b9cc680b
--- /dev/null
+++ b/src/quick/doc/snippets/qml/borderimage/borderimage-rounded.qml
@@ -0,0 +1,124 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Rectangle {
+ id: page
+ color: "white"
+ width: 182; height: 164
+
+//! [tiled border image]
+BorderImage {
+ anchors { fill: parent; margins: 6 }
+ border { left: 30; top: 30; right: 30; bottom: 30 }
+ horizontalTileMode: BorderImage.Round
+ verticalTileMode: BorderImage.Round
+ source: "pics/borderframe.png"
+}
+//! [tiled border image]
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: 5
+ color: "transparent"
+ border.color: "gray"
+
+ Rectangle {
+ x: 30; y: 0
+ width: 1; height: parent.height
+ color: "gray"
+
+ Text {
+ text: "1"
+ font.pixelSize: 9
+ color: "red"
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ y: 20
+ }
+
+ Text {
+ text: "4"
+ font.pixelSize: 9
+ color: "red"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ }
+
+ Text {
+ text: "7"
+ font.pixelSize: 9
+ color: "red"
+ y: parent.height - 30
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ }
+ }
+
+ Rectangle {
+ x: parent.width - 30; y: 0
+ width: 1; height: parent.height
+ color: "gray"
+
+ Text {
+ text: "3"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ y: 20
+ }
+
+ Text {
+ text: "6"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Text {
+ text: "9"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ y: parent.height - 30
+ }
+ }
+
+ Text {
+ text: "5"
+ font.pixelSize: 9
+ color: "red"
+ anchors.centerIn: parent
+ }
+
+ Rectangle {
+ x: 0; y: 30
+ width: parent.width; height: 1
+ color: "gray"
+
+ Text {
+ text: "2"
+ font.pixelSize: 9
+ color: "red"
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: -10
+ }
+ }
+
+ Rectangle {
+ x: 0; y: parent.height - 30
+ width: parent.width; height: 1
+ color: "gray"
+
+ Text {
+ text: "8"
+ font.pixelSize: 9
+ color: "red"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ }
+}
diff --git a/src/quick/doc/snippets/qml/borderimage/borderimage-scaled.qml b/src/quick/doc/snippets/qml/borderimage/borderimage-scaled.qml
index 3a763f4998..5229060435 100644
--- a/src/quick/doc/snippets/qml/borderimage/borderimage-scaled.qml
+++ b/src/quick/doc/snippets/qml/borderimage/borderimage-scaled.qml
@@ -1,16 +1,17 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: page
color: "white"
- width: 180; height: 180
+ width: 182; height: 182
+ border.color: "gray"
//! [scaled border image]
BorderImage {
- width: 180; height: 180
+ anchors { fill: parent; margins: 1 }
border { left: 30; top: 30; right: 30; bottom: 30 }
horizontalTileMode: BorderImage.Stretch
verticalTileMode: BorderImage.Stretch
@@ -20,25 +21,98 @@ BorderImage {
Rectangle {
x: 30; y: 0
- width: 1; height: 180
+ width: 1; height: parent.height
color: "gray"
+
+ Text {
+ text: "1"
+ font.pixelSize: 9
+ color: "red"
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ y: 20
+ }
+
+ Text {
+ text: "4"
+ font.pixelSize: 9
+ color: "red"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ }
+
+ Text {
+ text: "7"
+ font.pixelSize: 9
+ color: "red"
+ y: parent.height - 30
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ }
}
Rectangle {
- x: 150; y: 0
- width: 1; height: 180
+ x: parent.width - 30; y: 0
+ width: 1; height: parent.height
color: "gray"
+
+ Text {
+ text: "3"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ y: 20
+ }
+
+ Text {
+ text: "6"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Text {
+ text: "9"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ y: parent.height - 30
+ }
+ }
+
+ Text {
+ text: "5"
+ font.pixelSize: 9
+ color: "red"
+ anchors.centerIn: parent
}
Rectangle {
x: 0; y: 30
- width: 180; height: 1
+ width: parent.width; height: 1
color: "gray"
+
+ Text {
+ text: "2"
+ font.pixelSize: 9
+ color: "red"
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: -10
+ }
}
Rectangle {
- x: 0; y: 150
- width: 180; height: 1
+ x: 0; y: parent.height - 30
+ width: parent.width; height: 1
color: "gray"
+
+ Text {
+ text: "8"
+ font.pixelSize: 9
+ color: "red"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
}
}
diff --git a/src/quick/doc/snippets/qml/borderimage/borderimage-tiled.qml b/src/quick/doc/snippets/qml/borderimage/borderimage-tiled.qml
index 525824d364..2f7b120b7f 100644
--- a/src/quick/doc/snippets/qml/borderimage/borderimage-tiled.qml
+++ b/src/quick/doc/snippets/qml/borderimage/borderimage-tiled.qml
@@ -1,16 +1,17 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: page
color: "white"
- width: 180; height: 180
+ width: 182; height: 182
+ border.color: "gray"
//! [tiled border image]
BorderImage {
- width: 180; height: 180
+ anchors { fill: parent; margins: 1 }
border { left: 30; top: 30; right: 30; bottom: 30 }
horizontalTileMode: BorderImage.Repeat
verticalTileMode: BorderImage.Repeat
@@ -20,25 +21,98 @@ BorderImage {
Rectangle {
x: 30; y: 0
- width: 1; height: 180
+ width: 1; height: parent.height
color: "gray"
+
+ Text {
+ text: "1"
+ font.pixelSize: 9
+ color: "red"
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ y: 20
+ }
+
+ Text {
+ text: "4"
+ font.pixelSize: 9
+ color: "red"
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ }
+
+ Text {
+ text: "7"
+ font.pixelSize: 9
+ color: "red"
+ y: parent.height - 30
+ anchors.right: parent.right
+ anchors.rightMargin: 1
+ }
}
Rectangle {
- x: 150; y: 0
- width: 1; height: 180
+ x: parent.width - 30; y: 0
+ width: 1; height: parent.height
color: "gray"
+
+ Text {
+ text: "3"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ y: 20
+ }
+
+ Text {
+ text: "6"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Text {
+ text: "9"
+ font.pixelSize: 9
+ color: "red"
+ x: 1
+ y: parent.height - 30
+ }
+ }
+
+ Text {
+ text: "5"
+ font.pixelSize: 9
+ color: "red"
+ anchors.centerIn: parent
}
Rectangle {
x: 0; y: 30
- width: 180; height: 1
+ width: parent.width; height: 1
color: "gray"
+
+ Text {
+ text: "2"
+ font.pixelSize: 9
+ color: "red"
+ anchors.horizontalCenter: parent.horizontalCenter
+ y: -10
+ }
}
Rectangle {
- x: 0; y: 150
- width: 180; height: 1
+ x: 0; y: parent.height - 30
+ width: parent.width; height: 1
color: "gray"
+
+ Text {
+ text: "8"
+ font.pixelSize: 9
+ color: "red"
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
}
}
diff --git a/src/quick/doc/snippets/qml/borderimage/normal-image.qml b/src/quick/doc/snippets/qml/borderimage/normal-image.qml
index 3bcbb258f1..44ca440732 100644
--- a/src/quick/doc/snippets/qml/borderimage/normal-image.qml
+++ b/src/quick/doc/snippets/qml/borderimage/normal-image.qml
@@ -1,40 +1,48 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: page
color: "white"
- width: 120; height: 120
+ width: 182; height: 182
//! [normal image]
Image {
source: "pics/borderframe.png"
+ anchors.centerIn: parent
}
//! [normal image]
Rectangle {
- x: 30; y: 0
- width: 1; height: 120
- color: "gray"
- }
+ width: 120; height: 120
+ color: "transparent"
+ border.color: "gray"
+ anchors.centerIn: parent
- Rectangle {
- x: 90; y: 0
- width: 1; height: 120
- color: "gray"
- }
+ Rectangle {
+ x: 30; y: 0
+ width: 1; height: 120
+ color: "gray"
+ }
- Rectangle {
- x: 0; y: 30
- width: 200; height: 1
- color: "gray"
- }
+ Rectangle {
+ x: 90; y: 0
+ width: 1; height: 120
+ color: "gray"
+ }
- Rectangle {
- x: 0; y: 90
- width: 200; height: 1
- color: "gray"
+ Rectangle {
+ x: 0; y: 30
+ width: 120; height: 1
+ color: "gray"
+ }
+
+ Rectangle {
+ x: 0; y: 90
+ width: 120; height: 1
+ color: "gray"
+ }
}
}
diff --git a/src/quick/doc/snippets/qml/borderimage/pics/borderframe.png b/src/quick/doc/snippets/qml/borderimage/pics/borderframe.png
new file mode 100644
index 0000000000..97a9452d5c
--- /dev/null
+++ b/src/quick/doc/snippets/qml/borderimage/pics/borderframe.png
Binary files differ
diff --git a/src/quick/doc/snippets/qml/borderimage/pics/borderframe.svg b/src/quick/doc/snippets/qml/borderimage/pics/borderframe.svg
new file mode 100644
index 0000000000..1f6c1f2901
--- /dev/null
+++ b/src/quick/doc/snippets/qml/borderimage/pics/borderframe.svg
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="120.00004"
+ height="120.00018"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
+ sodipodi:docname="borderframe.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ version="1.1"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <defs
+ id="defs4">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : -406.18091 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : -406.18091 : 1"
+ inkscape:persp3d-origin="372.04724 : -581.57461 : 1"
+ id="perspective10" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.8998663"
+ inkscape:cx="239.22736"
+ inkscape:cy="198.43502"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="2688"
+ inkscape:window-height="1698"
+ inkscape:window-x="4020"
+ inkscape:window-y="204"
+ inkscape:showpageshadow="0"
+ inkscape:pagecheckerboard="1"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:window-maximized="0">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2383"
+ visible="true"
+ enabled="true"
+ spacingx="1"
+ spacingy="1"
+ originx="-93.000067"
+ originy="-75.362307" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-93.000067,-75.362307)">
+ <path
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.88977;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 105.75595,88.1182 c 0,-11.811047 11.81103,-11.811047 11.81103,0 h 23.62207 L 153.00008,76.307153 164.81112,88.1182 h 23.62206 c 0,-11.811047 11.81104,-11.811047 11.81104,0 11.81104,0 11.81104,11.811049 0,11.811049 v 23.622101 l 11.81104,11.81105 -11.81104,11.81105 v 23.62209 c 11.81104,0 11.81104,11.81105 0,11.81105 0,11.81105 -11.81104,11.81105 -11.81104,0 h -23.62206 l -11.81104,11.81105 -11.81103,-11.81105 h -23.62207 c 0,11.81105 -11.81103,11.81105 -11.81103,0 -11.811037,0 -11.811037,-11.81105 0,-11.81105 V 147.17345 L 93.944913,135.3624 105.75595,123.55135 V 99.929249 c -11.811037,0 -11.811037,-11.811049 0,-11.811049 z"
+ id="rect2387"
+ sodipodi:nodetypes="ccccccccccccccccccccccccc" />
+ <path
+ sodipodi:nodetypes="ccccccccccccccccccccccccc"
+ id="path3160"
+ d="m 110.48036,92.84263 c 0,-10.629942 0,-9.448848 4.72442,-1e-5 l 27.16537,1e-5 10.62993,-10.629942 10.62993,10.629942 27.16538,-1e-5 c 4.72441,-9.448838 4.72441,-10.629932 4.72441,1e-5 10.62993,0 9.44883,-1e-5 0,4.724411 v 27.165419 l 10.62993,10.62995 -10.62993,10.62994 v 27.1654 c 9.44883,4.72442 10.62993,4.72443 0,4.72443 0,10.62995 0,9.44883 -4.72441,-1e-5 l -27.16538,1e-5 -10.62993,10.62995 -10.62993,-10.62995 -27.16537,-1e-5 c -4.72442,9.44884 -4.72442,10.62996 -4.72442,1e-5 -10.629933,0 -9.44883,-1e-5 0,-4.72443 v -27.1654 L 99.850427,135.36241 110.48036,124.73246 V 97.567041 c -9.44883,-4.724421 -10.629933,-4.724411 0,-4.724411 z"
+ style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.77954;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ </g>
+</svg>
diff --git a/src/quick/doc/snippets/qml/boundaryRule.qml b/src/quick/doc/snippets/qml/boundaryRule.qml
index 65c8585e3f..2a1ad46f0a 100644
--- a/src/quick/doc/snippets/qml/boundaryRule.qml
+++ b/src/quick/doc/snippets/qml/boundaryRule.qml
@@ -1,8 +1,8 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.14
-import Qt.labs.animation 1.0
+import QtQuick
+import Qt.labs.animation
Rectangle {
id: root
diff --git a/src/quick/doc/snippets/qml/coloranimation.qml b/src/quick/doc/snippets/qml/coloranimation.qml
index 9e0bf37ca1..698d7f886d 100644
--- a/src/quick/doc/snippets/qml/coloranimation.qml
+++ b/src/quick/doc/snippets/qml/coloranimation.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 100; height: 100
diff --git a/src/quick/doc/snippets/qml/colors.qml b/src/quick/doc/snippets/qml/colors.qml
index b0cc9d14c9..65cf07906b 100644
--- a/src/quick/doc/snippets/qml/colors.qml
+++ b/src/quick/doc/snippets/qml/colors.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 160; height: 250
diff --git a/src/quick/doc/snippets/qml/column/column-transitions.qml b/src/quick/doc/snippets/qml/column/column-transitions.qml
index 80f18b629b..70d8435d07 100644
--- a/src/quick/doc/snippets/qml/column/column-transitions.qml
+++ b/src/quick/doc/snippets/qml/column/column-transitions.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [document]
Column {
diff --git a/src/quick/doc/snippets/qml/column/column.qml b/src/quick/doc/snippets/qml/column/column.qml
index 8df93a83d3..3f9076bd3d 100644
--- a/src/quick/doc/snippets/qml/column/column.qml
+++ b/src/quick/doc/snippets/qml/column/column.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Item {
width: 310; height: 170
diff --git a/src/quick/doc/snippets/qml/column/vertical-positioner.qml b/src/quick/doc/snippets/qml/column/vertical-positioner.qml
index 01b4743c7c..5d8850fc27 100644
--- a/src/quick/doc/snippets/qml/column/vertical-positioner.qml
+++ b/src/quick/doc/snippets/qml/column/vertical-positioner.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [document]
Column {
diff --git a/src/quick/doc/snippets/qml/drag.qml b/src/quick/doc/snippets/qml/drag.qml
index 7205ad2114..2cc57c38b3 100644
--- a/src/quick/doc/snippets/qml/drag.qml
+++ b/src/quick/doc/snippets/qml/drag.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 200
diff --git a/src/quick/doc/snippets/qml/example.md b/src/quick/doc/snippets/qml/example.md
new file mode 100644
index 0000000000..43956c7830
--- /dev/null
+++ b/src/quick/doc/snippets/qml/example.md
@@ -0,0 +1,146 @@
+# Markdown in Qt Quick
+
+The Text, TextEdit and TextArea items support rich text formatted in HTML.
+Since Qt 5.14, they now support two dialects of Markdown as well:
+[The CommonMark Specification](https://spec.commonmark.org/0.29/) is the
+conservative formal specification, while
+[GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown)
+adds extra features such as task lists and tables.
+
+## Font and Paragraph Styles
+
+Markdown supports **bold**, *italic*, ~~strikethrough~~ and `monospace` font
+styles.
+
+> A block quote is indented according to the convention for email quoting.
+
+ A block of code;
+ can be indented;
+ with 4 spaces or a tab;
+
+or
+
+```
+Block {
+ id: code
+ CanBe {
+ wrappedBy: "triple backticks"
+ }
+}
+```
+
+Block quotes can be nested, and block quotes can include indented code blocks.
+
+In [The CommonMark Specification](https://spec.commonmark.org/0.29/)
+John MacFarlane writes:
+
+> What distinguishes Markdown from many other lightweight markup syntaxes,
+> which are often easier to write, is its readability. As Gruber writes:
+
+> > The overriding design goal for Markdown's formatting syntax is to make it
+> > as readable as possible. The idea is that a Markdown-formatted document should
+> > be publishable as-is, as plain text, without looking like it's been marked up
+> > with tags or formatting instructions. (
+> > [http://daringfireball.net/projects/markdown/](http://daringfireball.net/projects/markdown/))
+
+> The point can be illustrated by comparing a sample of AsciiDoc with an
+> equivalent sample of Markdown. Here is a sample of AsciiDoc from the AsciiDoc
+> manual:
+
+> 1. List item one.
+> +
+> List item one continued with a second paragraph followed by an
+> Indented block.
+> +
+> .................
+> $ ls *.sh
+> $ mv *.sh ~/tmp
+> .................
+> +
+> List item continued with a third paragraph.
+>
+> 2. List item two continued with an open block.
+> ...
+>
+
+## Hyperlinks
+
+Hyperlinks can be written with the link text first, and the URL immediately
+following: [Qt Assistant](http://doc.qt.io/qt-6/qtassistant-index.html)
+
+A plain url is automatically recognized: https://doc.qt.io/qt-6/qml-qtquick-text.html
+
+There are also "reference links" where the link text is first labeled
+and then the URL for the label is given elsewhere:
+[The Qt Creator Manual][creatormanual]
+
+## Images
+
+Inline images like this one ![red square](images/red.png) flow with the surrounding text.
+
+The code for including an image is just a link that starts with a bang.
+An image in its own paragraph is given its own space.
+
+## Lists
+
+Different kinds of lists can be included. Standard bullet lists can be nested,
+using different symbols for each level of the list. List items can have nested
+items such as block quotes, code blocks and images. Check boxes can be included
+to form a task list.
+
+- Disc symbols are typically used for top-level list items.
+ * Circle symbols can be used to distinguish between items in lower-level
+ lists.
+ + Square symbols provide a reasonable alternative to discs and circles.
+ * Lists can be continued...
+ * further down
+- List items can include images: ![red square](images/red.png)
+- and even nested quotes, like this:
+
+ The [Qt Documentation](https://doc.qt.io/qt-6/qml-qtquick-textedit.html#details)
+ points out that
+ > The TextEdit item displays a block of editable, formatted text.
+ >
+ > It can display both plain and rich text. For example:
+ >
+ > TextEdit {
+ > width: 240
+ > text: "<b>Hello</b> <i>World!</i>"
+ > font.family: "Helvetica"
+ > font.pointSize: 20
+ > color: "blue"
+ > focus: true
+ > }
+- List items with check boxes allow task lists to be incorporated:
+ * [ ] This task is not yet done
+ * [x] We aced this one!
+
+Ordered lists can be used for tables of contents, for example. Each number
+should end with a period or a parenthesis:
+
+1. Markdown in Qt Quick
+ 1) Font and Paragraph Styles
+ 5) Hyperlinks
+ 3) Images ![red square](images/red.png)
+ 2) Lists
+ 4) Tables
+2. Related work
+
+The list will automatically be renumbered during rendering.
+
+## Thematic Breaks
+
+A horizontal rule is possible, as in HTML:
+
+- - -
+
+## Tables
+
+One of the GitHub extensions is support for tables:
+
+| |Development Tools |Programming Techniques |Graphical User Interfaces|
+|-------------|------------------------------------|---------------------------|-------------------------|
+|9:00 - 11:00 |Introduction to Qt |||
+|11:00 - 13:00|Using Qt Creator |QML and its runtime |Layouts in Qt |
+|13:00 - 15:00|Qt Quick Designer Tutorial |Extreme Programming |Writing Custom Styles |
+|15:00 - 17:00|Qt Linguist and Internationalization| | |
diff --git a/src/quick/doc/snippets/qml/externalDragScaledImage.qml b/src/quick/doc/snippets/qml/externalDragScaledImage.qml
new file mode 100644
index 0000000000..a7069db849
--- /dev/null
+++ b/src/quick/doc/snippets/qml/externalDragScaledImage.qml
@@ -0,0 +1,28 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+//![0]
+import QtQuick
+
+Item {
+ width: 200; height: 200
+
+ Image {
+ anchors.centerIn: parent
+ source: "images/qt_logo.svg"
+ sourceSize.width: 96
+
+ Drag.dragType: Drag.Automatic
+ Drag.supportedActions: Qt.CopyAction
+ Drag.mimeData: {
+ "text/plain": "Qt Quick rocks!"
+ }
+ Drag.imageSource: "images/qt_logo.svg"
+ Drag.imageSourceSize: Qt.size(48, 35)
+ Drag.active: dragHandler.active
+
+ DragHandler {
+ id: dragHandler
+ }
+ }
+}
+//![0]
diff --git a/src/quick/doc/snippets/qml/externaldrag.qml b/src/quick/doc/snippets/qml/externaldrag.qml
index 3c504004de..723701a7a5 100644
--- a/src/quick/doc/snippets/qml/externaldrag.qml
+++ b/src/quick/doc/snippets/qml/externaldrag.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.12
+import QtQuick
Item {
width: 200; height: 200
@@ -12,7 +12,6 @@ Item {
color: "green"
radius: 5
- Drag.active: dragHandler.active
Drag.dragType: Drag.Automatic
Drag.supportedActions: Qt.CopyAction
Drag.mimeData: {
@@ -30,8 +29,11 @@ Item {
onActiveChanged:
if (active) {
parent.grabToImage(function(result) {
- parent.Drag.imageSource = result.url;
+ parent.Drag.imageSource = result.url
+ parent.Drag.active = true
})
+ } else {
+ parent.Drag.active = false
}
}
}
diff --git a/src/quick/doc/snippets/qml/flickable.qml b/src/quick/doc/snippets/qml/flickable.qml
index 0c756f76d4..7334059b9e 100644
--- a/src/quick/doc/snippets/qml/flickable.qml
+++ b/src/quick/doc/snippets/qml/flickable.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Flickable {
width: 200; height: 200
diff --git a/src/quick/doc/snippets/qml/flickableScrollbar.qml b/src/quick/doc/snippets/qml/flickableScrollbar.qml
index 3b2b10ac2b..981b725313 100644
--- a/src/quick/doc/snippets/qml/flickableScrollbar.qml
+++ b/src/quick/doc/snippets/qml/flickableScrollbar.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/flipable/flipable.qml b/src/quick/doc/snippets/qml/flipable/flipable.qml
index 0961653dc0..80821e610f 100644
--- a/src/quick/doc/snippets/qml/flipable/flipable.qml
+++ b/src/quick/doc/snippets/qml/flipable/flipable.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
-import QtQuick 2.0
+import QtQuick
Flipable {
id: flipable
diff --git a/src/quick/doc/snippets/qml/flow.qml b/src/quick/doc/snippets/qml/flow.qml
index 2757dc4bcb..6d8db1e295 100644
--- a/src/quick/doc/snippets/qml/flow.qml
+++ b/src/quick/doc/snippets/qml/flow.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Rectangle {
color: "lightblue"
diff --git a/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml b/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
index 5718fb0e4f..7762a937f0 100644
--- a/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
+++ b/src/quick/doc/snippets/qml/focus/MyClickableWidget.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [clickable in focusscope]
FocusScope {
diff --git a/src/quick/doc/snippets/qml/focus/MyWidget.qml b/src/quick/doc/snippets/qml/focus/MyWidget.qml
index f43d7af2de..cb04176880 100644
--- a/src/quick/doc/snippets/qml/focus/MyWidget.qml
+++ b/src/quick/doc/snippets/qml/focus/MyWidget.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
//! [mywidget]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/focus/advancedFocus.qml b/src/quick/doc/snippets/qml/focus/advancedFocus.qml
index 42ec222237..6874b8fa5b 100644
--- a/src/quick/doc/snippets/qml/focus/advancedFocus.qml
+++ b/src/quick/doc/snippets/qml/focus/advancedFocus.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [FocusScope delegate]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/focus/basicwidget.qml b/src/quick/doc/snippets/qml/focus/basicwidget.qml
index e5f96ce4eb..377e852a1d 100644
--- a/src/quick/doc/snippets/qml/focus/basicwidget.qml
+++ b/src/quick/doc/snippets/qml/focus/basicwidget.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [focus true]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/focus/clickablewidget.qml b/src/quick/doc/snippets/qml/focus/clickablewidget.qml
index 99df888ba8..502fa36bf8 100644
--- a/src/quick/doc/snippets/qml/focus/clickablewidget.qml
+++ b/src/quick/doc/snippets/qml/focus/clickablewidget.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [clickable window]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml b/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
index 5dd5f3f8b4..6703d3102a 100644
--- a/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
+++ b/src/quick/doc/snippets/qml/focus/myfocusscopewidget.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
//! [widget in focusscope]
FocusScope {
diff --git a/src/quick/doc/snippets/qml/focus/rectangle.qml b/src/quick/doc/snippets/qml/focus/rectangle.qml
index 119495767e..4264673581 100644
--- a/src/quick/doc/snippets/qml/focus/rectangle.qml
+++ b/src/quick/doc/snippets/qml/focus/rectangle.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [simple key event]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/focus/widget.qml b/src/quick/doc/snippets/qml/focus/widget.qml
index 5a0200d26c..1c44f97c4d 100644
--- a/src/quick/doc/snippets/qml/focus/widget.qml
+++ b/src/quick/doc/snippets/qml/focus/widget.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [window]
diff --git a/src/quick/doc/snippets/qml/font.qml b/src/quick/doc/snippets/qml/font.qml
new file mode 100644
index 0000000000..5f76d6fc30
--- /dev/null
+++ b/src/quick/doc/snippets/qml/font.qml
@@ -0,0 +1,22 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Item {
+//! [text]
+ Text {
+ font.family: "Helvetica"
+ font.pointSize: 13
+ font.bold: true
+ }
+//! [text]
+
+//! [structured-value-construction]
+ readonly property font myFont: ({
+ family: "Helvetica",
+ pointSize: 13,
+ bold: true
+ })
+//! [structured-value-construction]
+}
diff --git a/src/quick/doc/snippets/qml/gradient.qml b/src/quick/doc/snippets/qml/gradient.qml
index 861af15736..39ec1d37bd 100644
--- a/src/quick/doc/snippets/qml/gradient.qml
+++ b/src/quick/doc/snippets/qml/gradient.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![code]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/grid-spacing.qml b/src/quick/doc/snippets/qml/grid-spacing.qml
index ae976f1510..763b4acfbf 100644
--- a/src/quick/doc/snippets/qml/grid-spacing.qml
+++ b/src/quick/doc/snippets/qml/grid-spacing.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 112; height: 112
diff --git a/src/quick/doc/snippets/qml/grid/grid.qml b/src/quick/doc/snippets/qml/grid/grid.qml
index c66e32bc07..db72263ebb 100644
--- a/src/quick/doc/snippets/qml/grid/grid.qml
+++ b/src/quick/doc/snippets/qml/grid/grid.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Grid {
columns: 3
diff --git a/src/quick/doc/snippets/qml/gridview/ContactModel.qml b/src/quick/doc/snippets/qml/gridview/ContactModel.qml
index 42319725cf..a6c7f949b8 100644
--- a/src/quick/doc/snippets/qml/gridview/ContactModel.qml
+++ b/src/quick/doc/snippets/qml/gridview/ContactModel.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
ListModel {
diff --git a/src/quick/doc/snippets/qml/gridview/gridview.qml b/src/quick/doc/snippets/qml/gridview/gridview.qml
index 247865d41f..3ce3cba61d 100644
--- a/src/quick/doc/snippets/qml/gridview/gridview.qml
+++ b/src/quick/doc/snippets/qml/gridview/gridview.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![import]
-import QtQuick 2.0
+import QtQuick
//![import]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/image.qml b/src/quick/doc/snippets/qml/image.qml
index f73793384c..40d85e44c6 100644
--- a/src/quick/doc/snippets/qml/image.qml
+++ b/src/quick/doc/snippets/qml/image.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Image {
source: "pics/qtlogo.png"
diff --git a/src/quick/doc/snippets/qml/images/qt-logo.png b/src/quick/doc/snippets/qml/images/qt-logo.png
new file mode 100644
index 0000000000..30c621c9c6
--- /dev/null
+++ b/src/quick/doc/snippets/qml/images/qt-logo.png
Binary files differ
diff --git a/src/quick/doc/snippets/qml/images/qt_logo.svg b/src/quick/doc/snippets/qml/images/qt_logo.svg
new file mode 100644
index 0000000000..062daff3e9
--- /dev/null
+++ b/src/quick/doc/snippets/qml/images/qt_logo.svg
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="462pt"
+ height="339pt"
+ viewBox="0 0 462 339"
+ version="1.1"
+ id="svg2"
+>
+ <path
+ fill="#41cd52"
+ d=" M 63.50 0.00 L 462.00 0.00 L 462.00 274.79 C 440.60 296.26 419.13 317.66 397.61 339.00 L 0.00 339.00 L 0.00 63.39 C 21.08 42.18 42.34 21.13 63.50 0.00 Z"
+ id="path6"/>
+ <path
+ d=" M 122.37 71.33 C 137.50 61.32 156.21 58.79 174.00 58.95 C 190.94 59.16 208.72 62.13 222.76 72.24 C 232.96 79.41 239.59 90.48 244.01 101.93 C 251.16 120.73 253.26 141.03 253.50 161.01 C 253.53 181.13 252.62 201.69 245.96 220.86 C 241.50 233.90 233.01 245.48 221.81 253.52 C 229.87 266.58 238.09 279.54 246.15 292.60 C 236.02 297.27 225.92 301.97 215.78 306.62 C 207.15 292.38 198.56 278.11 189.90 263.89 C 178.19 265.81 166.21 265.66 154.44 264.36 C 140.34 262.67 125.97 258.37 115.09 248.88 C 106.73 241.64 101.48 231.51 97.89 221.21 C 92.01 203.79 90.43 185.25 90.16 166.97 C 90.02 147.21 91.28 127.14 97.24 108.18 C 101.85 93.92 109.48 79.69 122.37 71.33 Z"
+ id="path8"
+ fill="#ffffff"/>
+ <path
+ d=" M 294.13 70.69 C 304.73 70.68 315.33 70.68 325.93 70.69 C 325.96 84.71 325.92 98.72 325.95 112.74 C 339.50 112.76 353.05 112.74 366.60 112.75 C 366.37 121.85 366.12 130.95 365.86 140.05 C 352.32 140.08 338.79 140.04 325.25 140.07 C 325.28 163.05 325.18 186.03 325.30 209.01 C 325.56 215.30 325.42 221.94 328.19 227.75 C 330.21 232.23 335.65 233.38 340.08 233.53 C 348.43 233.50 356.77 233.01 365.12 232.86 C 365.63 241.22 366.12 249.59 366.60 257.95 C 349.99 260.74 332.56 264.08 316.06 258.86 C 309.11 256.80 302.63 252.19 299.81 245.32 C 294.76 233.63 294.35 220.62 294.13 208.07 C 294.11 185.40 294.13 162.74 294.12 140.07 C 286.73 140.05 279.34 140.08 271.95 140.05 C 271.93 130.96 271.93 121.86 271.95 112.76 C 279.34 112.73 286.72 112.77 294.11 112.74 C 294.14 98.72 294.10 84.71 294.13 70.69 Z"
+ id="path10"
+ fill="#ffffff"/>
+ <path
+ fill="#41cd52"
+ d=" M 160.51 87.70 C 170.80 86.36 181.60 86.72 191.34 90.61 C 199.23 93.73 205.93 99.84 209.47 107.58 C 214.90 119.31 216.98 132.26 218.03 145.05 C 219.17 162.07 219.01 179.25 216.66 196.17 C 215.01 206.24 212.66 216.85 205.84 224.79 C 198.92 232.76 188.25 236.18 178.01 236.98 C 167.21 237.77 155.82 236.98 146.07 231.87 C 140.38 228.84 135.55 224.09 132.73 218.27 C 129.31 211.30 127.43 203.69 126.11 196.07 C 122.13 171.91 121.17 146.91 126.61 122.89 C 128.85 113.83 132.11 104.53 138.73 97.70 C 144.49 91.85 152.51 88.83 160.51 87.70 Z"
+ id="path12"/>
+</svg>
diff --git a/src/quick/doc/snippets/qml/images/red.png b/src/quick/doc/snippets/qml/images/red.png
new file mode 100644
index 0000000000..9038fef784
--- /dev/null
+++ b/src/quick/doc/snippets/qml/images/red.png
Binary files differ
diff --git a/src/quick/doc/snippets/qml/item/childrenRect.qml b/src/quick/doc/snippets/qml/item/childrenRect.qml
index bd7261074e..750a6fa125 100644
--- a/src/quick/doc/snippets/qml/item/childrenRect.qml
+++ b/src/quick/doc/snippets/qml/item/childrenRect.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [local]
Item {
diff --git a/src/quick/doc/snippets/qml/item/containmentMask-circle-js.qml b/src/quick/doc/snippets/qml/item/containmentMask-circle-js.qml
index 2865c1d067..9aa8ddcc75 100644
--- a/src/quick/doc/snippets/qml/item/containmentMask-circle-js.qml
+++ b/src/quick/doc/snippets/qml/item/containmentMask-circle-js.qml
@@ -1,8 +1,8 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQml 2.12
-import QtQuick 2.12
+import QtQml
+import QtQuick
//![0]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/item/containmentMask-shape.qml b/src/quick/doc/snippets/qml/item/containmentMask-shape.qml
index 607c0e148a..171437c380 100644
--- a/src/quick/doc/snippets/qml/item/containmentMask-shape.qml
+++ b/src/quick/doc/snippets/qml/item/containmentMask-shape.qml
@@ -1,8 +1,8 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.12
-import QtQuick.Shapes 1.12
+import QtQuick
+import QtQuick.Shapes
//![0]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/item/itemGrab.qml b/src/quick/doc/snippets/qml/item/itemGrab.qml
index ef4430175a..dc5a52a123 100644
--- a/src/quick/doc/snippets/qml/item/itemGrab.qml
+++ b/src/quick/doc/snippets/qml/item/itemGrab.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2014 Jolla Ltd, author: <gunnar.sletta@jollamobile.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.4
+import QtQuick
Item {
width: 320
@@ -12,12 +12,13 @@ Rectangle {
id: sourceRectangle
width: 100
height: 100
+ focus: true
gradient: Gradient {
GradientStop { position: 0; color: "steelblue" }
GradientStop { position: 1; color: "black" }
}
- Component.onCompleted: {
+ Keys.onSpacePressed: {
sourceRectangle.grabToImage(function(result) {
result.saveToFile("something.png")
})
@@ -30,7 +31,7 @@ Image {
id: image
}
-Component.onCompleted: {
+Keys.onSpacePressed: {
sourceRectangle.grabToImage(function(result) {
image.source = result.url
}, Qt.size(50, 50))
diff --git a/src/quick/doc/snippets/qml/keynavigation.qml b/src/quick/doc/snippets/qml/keynavigation.qml
index 9536cf85f2..498d53e1c7 100644
--- a/src/quick/doc/snippets/qml/keynavigation.qml
+++ b/src/quick/doc/snippets/qml/keynavigation.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Grid {
width: 100; height: 100
diff --git a/src/quick/doc/snippets/qml/keys/keys-handler.qml b/src/quick/doc/snippets/qml/keys/keys-handler.qml
index 00d7ca7fed..3b63f0ac0a 100644
--- a/src/quick/doc/snippets/qml/keys/keys-handler.qml
+++ b/src/quick/doc/snippets/qml/keys/keys-handler.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
width: 400; height: 400
diff --git a/src/quick/doc/snippets/qml/keys/keys-pressed.qml b/src/quick/doc/snippets/qml/keys/keys-pressed.qml
index fe27486b30..ddc4a239c7 100644
--- a/src/quick/doc/snippets/qml/keys/keys-pressed.qml
+++ b/src/quick/doc/snippets/qml/keys/keys-pressed.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
width: 400; height: 400
diff --git a/src/quick/doc/snippets/qml/layerblending.qml b/src/quick/doc/snippets/qml/layerblending.qml
index 0e3c628585..4f174360bf 100644
--- a/src/quick/doc/snippets/qml/layerblending.qml
+++ b/src/quick/doc/snippets/qml/layerblending.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2014 Gunnar Sletta <gunnar@sletta.org>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
width: 300
diff --git a/src/quick/doc/snippets/qml/layout-simple.qml b/src/quick/doc/snippets/qml/layout-simple.qml
index ef707b3337..4c972a9441 100644
--- a/src/quick/doc/snippets/qml/layout-simple.qml
+++ b/src/quick/doc/snippets/qml/layout-simple.qml
@@ -1,9 +1,9 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.9
-import QtQuick.Layouts 1.2
-import QtQuick.Window 2.2
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Window
//! [1]
Window {
diff --git a/src/quick/doc/snippets/qml/layoutmirroring.qml b/src/quick/doc/snippets/qml/layoutmirroring.qml
index 6ac975c1de..0c7154e0a1 100644
--- a/src/quick/doc/snippets/qml/layoutmirroring.qml
+++ b/src/quick/doc/snippets/qml/layoutmirroring.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
LayoutMirroring.enabled: true
diff --git a/src/quick/doc/snippets/qml/listview-decorations.qml b/src/quick/doc/snippets/qml/listview-decorations.qml
index 3c5c3bcfc1..af8d2bdcb0 100644
--- a/src/quick/doc/snippets/qml/listview-decorations.qml
+++ b/src/quick/doc/snippets/qml/listview-decorations.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
//! [parent begin]
Rectangle {
@@ -24,7 +24,8 @@ ListModel {
Component {
id: nameDelegate
Text {
- text: name;
+ required property string name
+ text: name
font.pixelSize: 24
}
}
diff --git a/src/quick/doc/snippets/qml/listview-sections.qml b/src/quick/doc/snippets/qml/listview-sections.qml
index f6c4159fd7..54fc4dd8c8 100644
--- a/src/quick/doc/snippets/qml/listview-sections.qml
+++ b/src/quick/doc/snippets/qml/listview-sections.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
//! [parent begin]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/listview.qml b/src/quick/doc/snippets/qml/listview.qml
index 028a859fed..948249f849 100644
--- a/src/quick/doc/snippets/qml/listview.qml
+++ b/src/quick/doc/snippets/qml/listview.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
//! [parent begin]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/listview/ContactModel.qml b/src/quick/doc/snippets/qml/listview/ContactModel.qml
index bf4662581f..8ea6bf42aa 100644
--- a/src/quick/doc/snippets/qml/listview/ContactModel.qml
+++ b/src/quick/doc/snippets/qml/listview/ContactModel.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
ListModel {
ListElement {
diff --git a/src/quick/doc/snippets/qml/listview/ReusableDelegate.qml b/src/quick/doc/snippets/qml/listview/ReusableDelegate.qml
index bed0df639f..e8e1077509 100644
--- a/src/quick/doc/snippets/qml/listview/ReusableDelegate.qml
+++ b/src/quick/doc/snippets/qml/listview/ReusableDelegate.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.15
+import QtQuick
//![0]
Component {
diff --git a/src/quick/doc/snippets/qml/listview/listview.qml b/src/quick/doc/snippets/qml/listview/listview.qml
index cd8b4c1962..c8df8e727b 100644
--- a/src/quick/doc/snippets/qml/listview/listview.qml
+++ b/src/quick/doc/snippets/qml/listview/listview.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![import]
-import QtQuick 2.0
+import QtQuick
//![import]
Item {
diff --git a/src/quick/doc/snippets/qml/loader/KeyReader.qml b/src/quick/doc/snippets/qml/loader/KeyReader.qml
index 1f20b16291..2bb1c270e6 100644
--- a/src/quick/doc/snippets/qml/loader/KeyReader.qml
+++ b/src/quick/doc/snippets/qml/loader/KeyReader.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
Item {
diff --git a/src/quick/doc/snippets/qml/loader/MyComponent.qml b/src/quick/doc/snippets/qml/loader/MyComponent.qml
index 06ec24dde5..6554648387 100644
--- a/src/quick/doc/snippets/qml/loader/MyComponent.qml
+++ b/src/quick/doc/snippets/qml/loader/MyComponent.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Text { text: index }
diff --git a/src/quick/doc/snippets/qml/loader/MyItem.qml b/src/quick/doc/snippets/qml/loader/MyItem.qml
index dfc77c5c50..2385680d80 100644
--- a/src/quick/doc/snippets/qml/loader/MyItem.qml
+++ b/src/quick/doc/snippets/qml/loader/MyItem.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: myItem
diff --git a/src/quick/doc/snippets/qml/loader/connections.qml b/src/quick/doc/snippets/qml/loader/connections.qml
index 7e49094b2c..fca17479ba 100644
--- a/src/quick/doc/snippets/qml/loader/connections.qml
+++ b/src/quick/doc/snippets/qml/loader/connections.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 100; height: 100
diff --git a/src/quick/doc/snippets/qml/loader/creationContext1.qml b/src/quick/doc/snippets/qml/loader/creationContext1.qml
index 9a19cea82a..91a4051d9d 100644
--- a/src/quick/doc/snippets/qml/loader/creationContext1.qml
+++ b/src/quick/doc/snippets/qml/loader/creationContext1.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Item {
diff --git a/src/quick/doc/snippets/qml/loader/creationContext2.qml b/src/quick/doc/snippets/qml/loader/creationContext2.qml
index 26c911dd5c..846b9de317 100644
--- a/src/quick/doc/snippets/qml/loader/creationContext2.qml
+++ b/src/quick/doc/snippets/qml/loader/creationContext2.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
width: 400
diff --git a/src/quick/doc/snippets/qml/loader/creationContext3.qml b/src/quick/doc/snippets/qml/loader/creationContext3.qml
index 3bc6439071..e9d47f1e18 100644
--- a/src/quick/doc/snippets/qml/loader/creationContext3.qml
+++ b/src/quick/doc/snippets/qml/loader/creationContext3.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
width: 400
diff --git a/src/quick/doc/snippets/qml/loader/creationContext4.qml b/src/quick/doc/snippets/qml/loader/creationContext4.qml
index 3b10ff2894..fdbeacbfa1 100644
--- a/src/quick/doc/snippets/qml/loader/creationContext4.qml
+++ b/src/quick/doc/snippets/qml/loader/creationContext4.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Item {
diff --git a/src/quick/doc/snippets/qml/loader/focus.qml b/src/quick/doc/snippets/qml/loader/focus.qml
index 6f8adc25a2..724b6f6094 100644
--- a/src/quick/doc/snippets/qml/loader/focus.qml
+++ b/src/quick/doc/snippets/qml/loader/focus.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 200; height: 200
diff --git a/src/quick/doc/snippets/qml/loader/simple.qml b/src/quick/doc/snippets/qml/loader/simple.qml
index 48080be758..f8d2249ac7 100644
--- a/src/quick/doc/snippets/qml/loader/simple.qml
+++ b/src/quick/doc/snippets/qml/loader/simple.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 200
diff --git a/src/quick/doc/snippets/qml/loader/sizeitem.qml b/src/quick/doc/snippets/qml/loader/sizeitem.qml
index 3252d0201e..f0cf7204c2 100644
--- a/src/quick/doc/snippets/qml/loader/sizeitem.qml
+++ b/src/quick/doc/snippets/qml/loader/sizeitem.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 200
diff --git a/src/quick/doc/snippets/qml/loader/sizeloader.qml b/src/quick/doc/snippets/qml/loader/sizeloader.qml
index 4229df9127..8d13def3ba 100644
--- a/src/quick/doc/snippets/qml/loader/sizeloader.qml
+++ b/src/quick/doc/snippets/qml/loader/sizeloader.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 200
diff --git a/src/quick/doc/snippets/qml/localstorage/hello.qml b/src/quick/doc/snippets/qml/localstorage/hello.qml
index bfb2a8c67e..915667848b 100644
--- a/src/quick/doc/snippets/qml/localstorage/hello.qml
+++ b/src/quick/doc/snippets/qml/localstorage/hello.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
color: "white"
diff --git a/src/quick/doc/snippets/qml/models/views-models-delegates.qml b/src/quick/doc/snippets/qml/models/views-models-delegates.qml
index 4d97ae2cf4..8a2f0519d6 100644
--- a/src/quick/doc/snippets/qml/models/views-models-delegates.qml
+++ b/src/quick/doc/snippets/qml/models/views-models-delegates.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [rectangle]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/mousearea/mousearea-snippet.qml b/src/quick/doc/snippets/qml/mousearea/mousearea-snippet.qml
index fe8816fc1e..d99f0efc6e 100644
--- a/src/quick/doc/snippets/qml/mousearea/mousearea-snippet.qml
+++ b/src/quick/doc/snippets/qml/mousearea/mousearea-snippet.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
//! [parent begin]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/mousearea/mousearea.qml b/src/quick/doc/snippets/qml/mousearea/mousearea.qml
index 4cb5e226fd..6793284080 100644
--- a/src/quick/doc/snippets/qml/mousearea/mousearea.qml
+++ b/src/quick/doc/snippets/qml/mousearea/mousearea.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [import]
-import QtQuick 2.0
+import QtQuick
//! [import]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/mousearea/mouseareadragfilter.qml b/src/quick/doc/snippets/qml/mousearea/mouseareadragfilter.qml
index db8772bbb8..75b14530d1 100644
--- a/src/quick/doc/snippets/qml/mousearea/mouseareadragfilter.qml
+++ b/src/quick/doc/snippets/qml/mousearea/mouseareadragfilter.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [dragfilter]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 480
diff --git a/src/quick/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml b/src/quick/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml
index 1cab349f3a..dff1326cdb 100644
--- a/src/quick/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml
+++ b/src/quick/doc/snippets/qml/multipointtoucharea/multipointtoucharea.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 400; height: 400
diff --git a/src/quick/doc/snippets/qml/nestedWindowTransientParent.qml b/src/quick/doc/snippets/qml/nestedWindowTransientParent.qml
new file mode 100644
index 0000000000..51f076172d
--- /dev/null
+++ b/src/quick/doc/snippets/qml/nestedWindowTransientParent.qml
@@ -0,0 +1,23 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+//![0]
+Window {
+ // visible is false by default
+ Window {
+ transientParent: null
+ visible: true
+ }
+//![0]
+
+ id: outer
+ Timer {
+ interval: 2000
+ running: true
+ onTriggered: outer.visible = true
+ }
+//![1]
+}
+//![1]
diff --git a/src/quick/doc/snippets/qml/numberanimation.qml b/src/quick/doc/snippets/qml/numberanimation.qml
index 6ad18388d7..28de4c7ba3 100644
--- a/src/quick/doc/snippets/qml/numberanimation.qml
+++ b/src/quick/doc/snippets/qml/numberanimation.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 100; height: 100
diff --git a/src/quick/doc/snippets/qml/parallelanimation.qml b/src/quick/doc/snippets/qml/parallelanimation.qml
index 95b45da4c5..1ffcd75e9d 100644
--- a/src/quick/doc/snippets/qml/parallelanimation.qml
+++ b/src/quick/doc/snippets/qml/parallelanimation.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: rect
diff --git a/src/quick/doc/snippets/qml/parentanimation.qml b/src/quick/doc/snippets/qml/parentanimation.qml
index ea66881196..ced59b6842 100644
--- a/src/quick/doc/snippets/qml/parentanimation.qml
+++ b/src/quick/doc/snippets/qml/parentanimation.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 100
diff --git a/src/quick/doc/snippets/qml/parentchange.qml b/src/quick/doc/snippets/qml/parentchange.qml
index f3d7623185..4b04219f52 100644
--- a/src/quick/doc/snippets/qml/parentchange.qml
+++ b/src/quick/doc/snippets/qml/parentchange.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 100
diff --git a/src/quick/doc/snippets/qml/path/arcdirection.qml b/src/quick/doc/snippets/qml/path/arcdirection.qml
index eec544f65b..ef7a68d6d2 100644
--- a/src/quick/doc/snippets/qml/path/arcdirection.qml
+++ b/src/quick/doc/snippets/qml/path/arcdirection.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Path {
startX: 50; startY: 50
diff --git a/src/quick/doc/snippets/qml/path/arcradius.qml b/src/quick/doc/snippets/qml/path/arcradius.qml
index cf7e4226e4..c303f8fa7f 100644
--- a/src/quick/doc/snippets/qml/path/arcradius.qml
+++ b/src/quick/doc/snippets/qml/path/arcradius.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Path {
startX: 0; startY: 100
diff --git a/src/quick/doc/snippets/qml/path/arcrotation.qml b/src/quick/doc/snippets/qml/path/arcrotation.qml
index dde11593ec..26ab0f4661 100644
--- a/src/quick/doc/snippets/qml/path/arcrotation.qml
+++ b/src/quick/doc/snippets/qml/path/arcrotation.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.9
+import QtQuick
//![0]
Path {
startX: 50; startY: 100
diff --git a/src/quick/doc/snippets/qml/path/basicarc.qml b/src/quick/doc/snippets/qml/path/basicarc.qml
index 56c3790424..60a04fc4ce 100644
--- a/src/quick/doc/snippets/qml/path/basicarc.qml
+++ b/src/quick/doc/snippets/qml/path/basicarc.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Path {
startX: 100; startY: 0
diff --git a/src/quick/doc/snippets/qml/path/basiccurve.qml b/src/quick/doc/snippets/qml/path/basiccurve.qml
index 1f3e03056d..a5c521b967 100644
--- a/src/quick/doc/snippets/qml/path/basiccurve.qml
+++ b/src/quick/doc/snippets/qml/path/basiccurve.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Canvas {
width: 400; height: 200
diff --git a/src/quick/doc/snippets/qml/path/largearc.qml b/src/quick/doc/snippets/qml/path/largearc.qml
index ec457ace28..929da8e016 100644
--- a/src/quick/doc/snippets/qml/path/largearc.qml
+++ b/src/quick/doc/snippets/qml/path/largearc.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Path {
startX: 0; startY: 100
diff --git a/src/quick/doc/snippets/qml/pathinterpolator.qml b/src/quick/doc/snippets/qml/pathinterpolator.qml
index fd693998a4..6fa0a8a4da 100644
--- a/src/quick/doc/snippets/qml/pathinterpolator.qml
+++ b/src/quick/doc/snippets/qml/pathinterpolator.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 400
diff --git a/src/quick/doc/snippets/qml/pathview/ContactModel.qml b/src/quick/doc/snippets/qml/pathview/ContactModel.qml
index 8573899707..827184bbb2 100644
--- a/src/quick/doc/snippets/qml/pathview/ContactModel.qml
+++ b/src/quick/doc/snippets/qml/pathview/ContactModel.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
ListModel {
ListElement {
diff --git a/src/quick/doc/snippets/qml/pathview/pathattributes.qml b/src/quick/doc/snippets/qml/pathview/pathattributes.qml
index 1323a25002..7d07b76bf0 100644
--- a/src/quick/doc/snippets/qml/pathview/pathattributes.qml
+++ b/src/quick/doc/snippets/qml/pathview/pathattributes.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 240; height: 200
diff --git a/src/quick/doc/snippets/qml/pathview/pathview.qml b/src/quick/doc/snippets/qml/pathview/pathview.qml
index 4ee4e8ff83..2a801e5d7c 100644
--- a/src/quick/doc/snippets/qml/pathview/pathview.qml
+++ b/src/quick/doc/snippets/qml/pathview/pathview.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 240; height: 200
@@ -12,15 +12,20 @@ Rectangle {
id: delegate
Column {
id: wrapper
+
+ required property url icon
+ required property string name
+
opacity: PathView.isCurrentItem ? 1 : 0.5
+
Image {
anchors.horizontalCenter: nameText.horizontalCenter
width: 64; height: 64
- source: icon
+ source: wrapper.icon
}
Text {
id: nameText
- text: name
+ text: wrapper.name
font.pointSize: 16
}
}
diff --git a/src/quick/doc/snippets/qml/propertyaction-sequential.qml b/src/quick/doc/snippets/qml/propertyaction-sequential.qml
index 9ad5f06717..c2f029e709 100644
--- a/src/quick/doc/snippets/qml/propertyaction-sequential.qml
+++ b/src/quick/doc/snippets/qml/propertyaction-sequential.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Row {
diff --git a/src/quick/doc/snippets/qml/propertyaction.qml b/src/quick/doc/snippets/qml/propertyaction.qml
index 1c4b05facc..28c2b6e247 100644
--- a/src/quick/doc/snippets/qml/propertyaction.qml
+++ b/src/quick/doc/snippets/qml/propertyaction.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Row {
diff --git a/src/quick/doc/snippets/qml/propertyanimation.qml b/src/quick/doc/snippets/qml/propertyanimation.qml
index f950c1eeb8..8850e72d24 100644
--- a/src/quick/doc/snippets/qml/propertyanimation.qml
+++ b/src/quick/doc/snippets/qml/propertyanimation.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Row {
diff --git a/src/quick/doc/snippets/qml/propertychanges.qml b/src/quick/doc/snippets/qml/propertychanges.qml
index ecfaf8a3f9..621abad278 100644
--- a/src/quick/doc/snippets/qml/propertychanges.qml
+++ b/src/quick/doc/snippets/qml/propertychanges.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![import]
-import QtQuick 2.0
+import QtQuick
//![import]
Column {
diff --git a/src/quick/doc/snippets/qml/qml-data-models/dynamic-listmodel.qml b/src/quick/doc/snippets/qml/qml-data-models/dynamic-listmodel.qml
index 4bf9fccb93..eacba90716 100644
--- a/src/quick/doc/snippets/qml/qml-data-models/dynamic-listmodel.qml
+++ b/src/quick/doc/snippets/qml/qml-data-models/dynamic-listmodel.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 250
@@ -15,8 +15,12 @@ Item {
anchors.fill: parent
model: fruitModel
delegate: Row {
- Text { text: "Fruit: " + name }
- Text { text: "Cost: $" + cost }
+ id: delegate
+ required property string name
+ required property real cost
+
+ Text { text: "Fruit: " + delegate.name }
+ Text { text: "Cost: $" + delegate.cost }
}
}
//! [view]
diff --git a/src/quick/doc/snippets/qml/qml-data-models/listelements.qml b/src/quick/doc/snippets/qml/qml-data-models/listelements.qml
index bab4aec6a2..aa8e5e4833 100644
--- a/src/quick/doc/snippets/qml/qml-data-models/listelements.qml
+++ b/src/quick/doc/snippets/qml/qml-data-models/listelements.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 250
@@ -31,8 +31,12 @@ Item {
anchors.fill: parent
model: fruitModel
delegate: Row {
- Text { text: "Fruit: " + name }
- Text { text: "Cost: $" + cost }
+ id: delegate
+ required property string name
+ required property real cost
+
+ Text { text: "Fruit: " + delegate.name }
+ Text { text: "Cost: $" + delegate.cost }
}
}
//! [view]
diff --git a/src/quick/doc/snippets/qml/qml-data-models/listmodel-listview-required.qml b/src/quick/doc/snippets/qml/qml-data-models/listmodel-listview-required.qml
index 040b033141..dd7c21b88e 100644
--- a/src/quick/doc/snippets/qml/qml-data-models/listmodel-listview-required.qml
+++ b/src/quick/doc/snippets/qml/qml-data-models/listmodel-listview-required.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200
diff --git a/src/quick/doc/snippets/qml/qml-data-models/listmodel-listview.qml b/src/quick/doc/snippets/qml/qml-data-models/listmodel-listview.qml
index 03f3df2304..2942eaf3df 100644
--- a/src/quick/doc/snippets/qml/qml-data-models/listmodel-listview.qml
+++ b/src/quick/doc/snippets/qml/qml-data-models/listmodel-listview.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Item {
width: 200; height: 250
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml b/src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml
index 2ce2669ab3..c317be5f2f 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/components/Button.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// Button.qml
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 100; height: 100
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/components/application.qml b/src/quick/doc/snippets/qml/qml-extending-types/components/application.qml
index dedc28b3f3..e6572c542f 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/components/application.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/components/application.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// application.qml
-import QtQuick 2.0
+import QtQuick
Column {
Button { width: 50; height: 50 }
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml b/src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml
index 14221c8904..f5b7714c1a 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/methods/app.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Rectangle {
id: rect
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml
index 29567389c6..5d48114c0b 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/ImageViewer.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// ImageViewer.qml
-import QtQuick 2.0
+import QtQuick
Item {
id: item
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias-override.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias-override.qml
index 9af9879839..f214e55dc9 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias-override.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias-override.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Rectangle {
property alias color: childRect.color
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias.qml
index 03e288b6e3..c6adac69fa 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// Button.qml
-import QtQuick 2.0
+import QtQuick
Item {
property alias buttonText: textItem.text
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml
index 32db5bc230..2fbb13e927 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/ImageViewer.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// ImageViewer.qml
-import QtQuick 2.0
+import QtQuick
Item {
id: item
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml
index 4b827450c4..697a07062d 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/alias/application.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// application.qml
-import QtQuick 2.0
+import QtQuick
ImageViewer {
id: viewer
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/application.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/application.qml
index f880f2d555..4cda04660e 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/properties/application.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/application.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
ImageViewer {
id: viewer
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml b/src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml
index faa6dfb51e..23a48c4d9f 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/properties/property-signals.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Item {
property int myNumber
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
index f37b88ea0a..e53526f16f 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/Button.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
// Button.qml
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml
index b6fd62ce66..7bf81cc227 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/basic.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// Button.qml
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: rect
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml
index a481990144..5e6469a44b 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/connectdynamic.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Item {
id: item
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/connectslots.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/connectslots.qml
index e08c16808c..6c9ad3fa03 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/connectslots.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/connectslots.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Item {
id: item
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/no-parameters.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/no-parameters.qml
index cc248b0c18..dca0073177 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/no-parameters.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/no-parameters.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
// application.qml
-import QtQuick 2.0
+import QtQuick
Button {
width: 100; height: 100
diff --git a/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml b/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
index 7400e84ae5..a473d9c503 100644
--- a/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
+++ b/src/quick/doc/snippets/qml/qml-extending-types/signals/parameters.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
// application.qml
Button {
diff --git a/src/quick/doc/snippets/qml/rectangle/rectangle-colors.qml b/src/quick/doc/snippets/qml/rectangle/rectangle-colors.qml
index a2edc4d350..bfa106dc4a 100644
--- a/src/quick/doc/snippets/qml/rectangle/rectangle-colors.qml
+++ b/src/quick/doc/snippets/qml/rectangle/rectangle-colors.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
width: 100; height: 200
diff --git a/src/quick/doc/snippets/qml/rectangle/rectangle-gradient.qml b/src/quick/doc/snippets/qml/rectangle/rectangle-gradient.qml
index 560950f849..bdf6950189 100644
--- a/src/quick/doc/snippets/qml/rectangle/rectangle-gradient.qml
+++ b/src/quick/doc/snippets/qml/rectangle/rectangle-gradient.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
width: 100; height: 300
diff --git a/src/quick/doc/snippets/qml/rectangle/rectangle.qml b/src/quick/doc/snippets/qml/rectangle/rectangle.qml
index 14baa83bfc..552119b5e5 100644
--- a/src/quick/doc/snippets/qml/rectangle/rectangle.qml
+++ b/src/quick/doc/snippets/qml/rectangle/rectangle.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 100
diff --git a/src/quick/doc/snippets/qml/regularexpression.qml b/src/quick/doc/snippets/qml/regularexpression.qml
index a38dec48f2..f08a55725b 100644
--- a/src/quick/doc/snippets/qml/regularexpression.qml
+++ b/src/quick/doc/snippets/qml/regularexpression.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.14
+import QtQuick
//![0]
TextInput {
id: hexNumber
diff --git a/src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml b/src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml
index 37188f2001..945641e37c 100644
--- a/src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml
+++ b/src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 400; height: 400; color: "black"
diff --git a/src/quick/doc/snippets/qml/repeaters/repeater.qml b/src/quick/doc/snippets/qml/repeaters/repeater.qml
index cdb1f6f50a..b1cee3ea8d 100644
--- a/src/quick/doc/snippets/qml/repeaters/repeater.qml
+++ b/src/quick/doc/snippets/qml/repeaters/repeater.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [import]
-import QtQuick 2.0
+import QtQuick
//! [import]
Row {
@@ -24,7 +24,10 @@ Row {
Column {
Repeater {
model: 10
- Text { text: "I'm item " + index }
+ Text {
+ required property int index
+ text: "I'm item " + index
+ }
}
}
//! [index]
@@ -33,7 +36,10 @@ Column {
Column {
Repeater {
model: ["apples", "oranges", "pears"]
- Text { text: "Data: " + modelData }
+ Text {
+ required property string modelData
+ text: "Data: " + modelData
+ }
}
}
//! [modeldata]
diff --git a/src/quick/doc/snippets/qml/righttoleft.qml b/src/quick/doc/snippets/qml/righttoleft.qml
index fde45e6e69..dc81e88455 100644
--- a/src/quick/doc/snippets/qml/righttoleft.qml
+++ b/src/quick/doc/snippets/qml/righttoleft.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
import "righttoleft"
Column {
diff --git a/src/quick/doc/snippets/qml/righttoleft/Child.qml b/src/quick/doc/snippets/qml/righttoleft/Child.qml
index 7118a5feb0..6bedd78a62 100644
--- a/src/quick/doc/snippets/qml/righttoleft/Child.qml
+++ b/src/quick/doc/snippets/qml/righttoleft/Child.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 50; height: 50
diff --git a/src/quick/doc/snippets/qml/rotation.qml b/src/quick/doc/snippets/qml/rotation.qml
index d44ca5f4d6..55a6d54cbb 100644
--- a/src/quick/doc/snippets/qml/rotation.qml
+++ b/src/quick/doc/snippets/qml/rotation.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
-import QtQuick 2.0
+import QtQuick
Row {
x: 10; y: 10
diff --git a/src/quick/doc/snippets/qml/rotationanimation.qml b/src/quick/doc/snippets/qml/rotationanimation.qml
index 6f3d0722c6..9e4f45b876 100644
--- a/src/quick/doc/snippets/qml/rotationanimation.qml
+++ b/src/quick/doc/snippets/qml/rotationanimation.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 300; height: 300
diff --git a/src/quick/doc/snippets/qml/row.qml b/src/quick/doc/snippets/qml/row.qml
index 5951ab8b8b..dd1f7cc2e8 100644
--- a/src/quick/doc/snippets/qml/row.qml
+++ b/src/quick/doc/snippets/qml/row.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 320; height: 110
diff --git a/src/quick/doc/snippets/qml/row/row.qml b/src/quick/doc/snippets/qml/row/row.qml
index 75e8fad100..88f7aa743a 100644
--- a/src/quick/doc/snippets/qml/row/row.qml
+++ b/src/quick/doc/snippets/qml/row/row.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.0
+import QtQuick
Row {
spacing: 2
diff --git a/src/quick/doc/snippets/qml/sequentialanimation.qml b/src/quick/doc/snippets/qml/sequentialanimation.qml
index 2098f395e7..c40d272220 100644
--- a/src/quick/doc/snippets/qml/sequentialanimation.qml
+++ b/src/quick/doc/snippets/qml/sequentialanimation.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: rect
diff --git a/src/quick/doc/snippets/qml/smoothedanimation.qml b/src/quick/doc/snippets/qml/smoothedanimation.qml
index 1cd4ee6b6f..ae9c20a7b9 100644
--- a/src/quick/doc/snippets/qml/smoothedanimation.qml
+++ b/src/quick/doc/snippets/qml/smoothedanimation.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 800; height: 600
diff --git a/src/quick/doc/snippets/qml/splashWindow.qml b/src/quick/doc/snippets/qml/splashWindow.qml
new file mode 100644
index 0000000000..c790fa5c1f
--- /dev/null
+++ b/src/quick/doc/snippets/qml/splashWindow.qml
@@ -0,0 +1,57 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [entire]
+import QtQuick
+
+Window {
+ id: mainWindow
+ title: "Main Window"
+ color: "#456"
+ property real defaultSpacing: 10
+
+ property Splash splash: Splash {
+ onTimeout: mainWindow.show()
+ }
+
+ component Splash: Window {
+ id: splash
+
+ // a splash screen has no titlebar
+ flags: Qt.SplashScreen
+ // the transparent color lets background behind the image edges show through
+ color: "transparent"
+ modality: Qt.ApplicationModal // in case another application window is showing
+ title: "Splash Window" // for the taskbar/dock, task switcher etc.
+ visible: true
+
+ // here we use the Screen attached property to center the splash window
+ //! [screen-properties]
+ x: (Screen.width - splashImage.width) / 2
+ y: (Screen.height - splashImage.height) / 2
+ //! [screen-properties]
+ width: splashImage.width
+ height: splashImage.height
+
+ property int timeoutInterval: 2000
+ signal timeout
+
+ Image {
+ id: splashImage
+ source: "images/qt-logo.png"
+ }
+
+ TapHandler {
+ onTapped: splash.timeout()
+ }
+
+ Timer {
+ interval: splash.timeoutInterval; running: true; repeat: false
+ onTriggered: {
+ splash.visible = false
+ splash.timeout()
+ }
+ }
+ }
+}
+//! [entire]
diff --git a/src/quick/doc/snippets/qml/springanimation.qml b/src/quick/doc/snippets/qml/springanimation.qml
index 6937cf8fe6..4c2c974450 100644
--- a/src/quick/doc/snippets/qml/springanimation.qml
+++ b/src/quick/doc/snippets/qml/springanimation.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Item {
width: 300; height: 300
diff --git a/src/quick/doc/snippets/qml/state-when.qml b/src/quick/doc/snippets/qml/state-when.qml
index 58e8e7dd98..98ff68594f 100644
--- a/src/quick/doc/snippets/qml/state-when.qml
+++ b/src/quick/doc/snippets/qml/state-when.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Rectangle {
id: myRect
diff --git a/src/quick/doc/snippets/qml/state.qml b/src/quick/doc/snippets/qml/state.qml
index e3cfac72f6..c749df23b5 100644
--- a/src/quick/doc/snippets/qml/state.qml
+++ b/src/quick/doc/snippets/qml/state.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: myRect
diff --git a/src/quick/doc/snippets/qml/states.qml b/src/quick/doc/snippets/qml/states.qml
index 285f395f0b..426ce3be4f 100644
--- a/src/quick/doc/snippets/qml/states.qml
+++ b/src/quick/doc/snippets/qml/states.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![document]
-import QtQuick 2.0
+import QtQuick
//![parent begin]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/states/statechangescript.qml b/src/quick/doc/snippets/qml/states/statechangescript.qml
index 074f02988d..5461861c5b 100644
--- a/src/quick/doc/snippets/qml/states/statechangescript.qml
+++ b/src/quick/doc/snippets/qml/states/statechangescript.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Item {
//! [state and transition]
diff --git a/src/quick/doc/snippets/qml/systempalette.qml b/src/quick/doc/snippets/qml/systempalette.qml
index 102e5c28d3..c157856350 100644
--- a/src/quick/doc/snippets/qml/systempalette.qml
+++ b/src/quick/doc/snippets/qml/systempalette.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
diff --git a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h
index a4def6be54..1de11ed48f 100644
--- a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h
+++ b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.h
@@ -12,7 +12,7 @@ class TableModel : public QAbstractTableModel
{
Q_OBJECT
QML_ELEMENT
- QML_ADDED_IN_MINOR_VERSION(1)
+ QML_ADDED_IN_VERSION(1, 1)
public:
int rowCount(const QModelIndex & = QModelIndex()) const override
diff --git a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.qml b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.qml
index b06783d864..6158c2f75f 100644
--- a/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.qml
+++ b/src/quick/doc/snippets/qml/tableview/cpp-tablemodel.qml
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.12
+import QtQuick
import TableModel 0.1
TableView {
diff --git a/src/quick/doc/snippets/qml/tableview/editdelegate.qml b/src/quick/doc/snippets/qml/tableview/editdelegate.qml
index b320969347..c5274e5ac7 100644
--- a/src/quick/doc/snippets/qml/tableview/editdelegate.qml
+++ b/src/quick/doc/snippets/qml/tableview/editdelegate.qml
@@ -44,9 +44,9 @@ Window {
TableView.onCommit: {
display = text
- // display = text is short-hand for:
- // let index = TableView.view.modelIndex(column, row)
- // TableView.view.model.setData(index, text, Qt.DisplayRole)
+ // 'display = text' is short-hand for:
+ // let index = TableView.view.index(row, column)
+ // TableView.view.model.setData(index, "display", text)
}
}
}
diff --git a/src/quick/doc/snippets/qml/tableview/keyboard-navigation.qml b/src/quick/doc/snippets/qml/tableview/keyboard-navigation.qml
index 8af308dec5..9231b9e1a5 100644
--- a/src/quick/doc/snippets/qml/tableview/keyboard-navigation.qml
+++ b/src/quick/doc/snippets/qml/tableview/keyboard-navigation.qml
@@ -3,7 +3,7 @@
import QtQuick
import QtQuick.Controls
-import Qt.labs.qmlmodels 1.0
+import Qt.labs.qmlmodels
//![0]
ApplicationWindow {
diff --git a/src/quick/doc/snippets/qml/tableview/qml-tablemodel.qml b/src/quick/doc/snippets/qml/tableview/qml-tablemodel.qml
index be861ec28a..f0a28a4be6 100644
--- a/src/quick/doc/snippets/qml/tableview/qml-tablemodel.qml
+++ b/src/quick/doc/snippets/qml/tableview/qml-tablemodel.qml
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.14
-import Qt.labs.qmlmodels 1.0
+import QtQuick
+import Qt.labs.qmlmodels
TableView {
anchors.fill: parent
diff --git a/src/quick/doc/snippets/qml/tableview/reusabledelegate.qml b/src/quick/doc/snippets/qml/tableview/reusabledelegate.qml
index f3ca4830dd..0f68786ac4 100644
--- a/src/quick/doc/snippets/qml/tableview/reusabledelegate.qml
+++ b/src/quick/doc/snippets/qml/tableview/reusabledelegate.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.12
+import QtQuick
//![0]
Component {
diff --git a/src/quick/doc/snippets/qml/tableview/tableviewwithheader.qml b/src/quick/doc/snippets/qml/tableview/tableviewwithheader.qml
index 08848fc1ef..40006e4e6c 100644
--- a/src/quick/doc/snippets/qml/tableview/tableviewwithheader.qml
+++ b/src/quick/doc/snippets/qml/tableview/tableviewwithheader.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.12
+import QtQuick
//![0]
TableView {
diff --git a/src/quick/doc/snippets/qml/tableview/tableviewwithprovider.qml b/src/quick/doc/snippets/qml/tableview/tableviewwithprovider.qml
index b4fbf19bec..6911d47eb5 100644
--- a/src/quick/doc/snippets/qml/tableview/tableviewwithprovider.qml
+++ b/src/quick/doc/snippets/qml/tableview/tableviewwithprovider.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.12
+import QtQuick
//![0]
TableView {
diff --git a/src/quick/doc/snippets/qml/text/onLinkActivated.qml b/src/quick/doc/snippets/qml/text/onLinkActivated.qml
index 3bb59f2f6e..25223a5d55 100644
--- a/src/quick/doc/snippets/qml/text/onLinkActivated.qml
+++ b/src/quick/doc/snippets/qml/text/onLinkActivated.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Rectangle {
width: 700; height: 400
diff --git a/src/quick/doc/snippets/qml/text/textEditFormats.qml b/src/quick/doc/snippets/qml/text/textEditFormats.qml
index caf1a842a3..259beab672 100644
--- a/src/quick/doc/snippets/qml/text/textEditFormats.qml
+++ b/src/quick/doc/snippets/qml/text/textEditFormats.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.14
+import QtQuick
//![0]
Column {
diff --git a/src/quick/doc/snippets/qml/text/textFormats.qml b/src/quick/doc/snippets/qml/text/textFormats.qml
index c2de9b4ca8..d79bcb01bb 100644
--- a/src/quick/doc/snippets/qml/text/textFormats.qml
+++ b/src/quick/doc/snippets/qml/text/textFormats.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.14
+import QtQuick
//![0]
Column {
diff --git a/src/quick/doc/snippets/qml/textEditStatusSwitch.qml b/src/quick/doc/snippets/qml/textEditStatusSwitch.qml
new file mode 100644
index 0000000000..ad29220482
--- /dev/null
+++ b/src/quick/doc/snippets/qml/textEditStatusSwitch.qml
@@ -0,0 +1,31 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+
+//! [0]
+TextEdit {
+ id: edit
+ width: 300
+ height: 200
+ textFormat: TextEdit.MarkdownText
+ textDocument.source: "example.md"
+ wrapMode: TextEdit.WordWrap
+
+ Text {
+ anchors {
+ bottom: parent.bottom
+ right: parent.right
+ }
+ color: edit.textDocument.status === TextDocument.Loaded ? "darkolivegreen" : "tomato"
+ text:
+ switch (edit.textDocument.status) {
+ case TextDocument.Loading:
+ return qsTr("Loading ") + edit.textDocument.source
+ case TextDocument.Loaded:
+ return qsTr("Loaded ") + edit.textDocument.source
+ default:
+ return edit.textDocument.errorString
+ }
+ }
+}
+//! [0]
diff --git a/src/quick/doc/snippets/qml/texteditor.qml b/src/quick/doc/snippets/qml/texteditor.qml
index 8b667001c7..687d419ca3 100644
--- a/src/quick/doc/snippets/qml/texteditor.qml
+++ b/src/quick/doc/snippets/qml/texteditor.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [0]
Flickable {
diff --git a/src/quick/doc/snippets/qml/texthandling.qml b/src/quick/doc/snippets/qml/texthandling.qml
index 2aa4a97030..bf98fb71c3 100644
--- a/src/quick/doc/snippets/qml/texthandling.qml
+++ b/src/quick/doc/snippets/qml/texthandling.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [document]
-import QtQuick 2.14
+import QtQuick
//! [parent begin]
diff --git a/src/quick/doc/snippets/qml/transition-animation.qml b/src/quick/doc/snippets/qml/transition-animation.qml
new file mode 100644
index 0000000000..a0482018ad
--- /dev/null
+++ b/src/quick/doc/snippets/qml/transition-animation.qml
@@ -0,0 +1,13 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+
+
+Item {
+//![0]
+ transitions: Transition {
+ PropertyAnimation { duration: 3000 }
+ ColorAnimation { duration: 3000 }
+ }
+//![0]
+}
diff --git a/src/quick/doc/snippets/qml/transition-from-to-modified.qml b/src/quick/doc/snippets/qml/transition-from-to-modified.qml
index 2e5c074e23..1ec9edd0a1 100644
--- a/src/quick/doc/snippets/qml/transition-from-to-modified.qml
+++ b/src/quick/doc/snippets/qml/transition-from-to-modified.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: rect
diff --git a/src/quick/doc/snippets/qml/transition-from-to.qml b/src/quick/doc/snippets/qml/transition-from-to.qml
index c282c3c16f..c9ebc3aa30 100644
--- a/src/quick/doc/snippets/qml/transition-from-to.qml
+++ b/src/quick/doc/snippets/qml/transition-from-to.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/transition-reversible.qml b/src/quick/doc/snippets/qml/transition-reversible.qml
index d5f225eb40..57acd92f89 100644
--- a/src/quick/doc/snippets/qml/transition-reversible.qml
+++ b/src/quick/doc/snippets/qml/transition-reversible.qml
@@ -1,6 +1,6 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.12
+import QtQuick
//![0]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/transition.qml b/src/quick/doc/snippets/qml/transition.qml
index 97188a8181..abcb9b6e19 100644
--- a/src/quick/doc/snippets/qml/transition.qml
+++ b/src/quick/doc/snippets/qml/transition.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
-import QtQuick 2.0
+import QtQuick
Rectangle {
id: rect
diff --git a/src/quick/doc/snippets/qml/transitions-list.qml b/src/quick/doc/snippets/qml/transitions-list.qml
index de8a364744..9ad70d6ccf 100644
--- a/src/quick/doc/snippets/qml/transitions-list.qml
+++ b/src/quick/doc/snippets/qml/transitions-list.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.13
+import QtQuick
Rectangle {
id: page
diff --git a/src/quick/doc/snippets/qml/treeview/qml-customdelegate.qml b/src/quick/doc/snippets/qml/treeview/qml-customdelegate.qml
index 97574487e9..49483af572 100644
--- a/src/quick/doc/snippets/qml/treeview/qml-customdelegate.qml
+++ b/src/quick/doc/snippets/qml/treeview/qml-customdelegate.qml
@@ -1,26 +1,31 @@
-// Copyright (C) 2021 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//![0]
import QtQuick
+import QtQuick.Controls
-Window {
- width: 600
- height: 400
+ApplicationWindow {
+ width: 800
+ height: 600
visible: true
TreeView {
+ id: treeView
anchors.fill: parent
+ anchors.margins: 10
+ clip: true
+
+ selectionModel: ItemSelectionModel {}
+
// The model needs to be a QAbstractItemModel
// model: yourTreeModel
delegate: Item {
- id: treeDelegate
-
implicitWidth: padding + label.x + label.implicitWidth + padding
implicitHeight: label.implicitHeight * 1.5
- readonly property real indent: 20
+ readonly property real indentation: 20
readonly property real padding: 5
// Assigned to by TreeView:
@@ -29,24 +34,52 @@ Window {
required property bool expanded
required property int hasChildren
required property int depth
+ required property int row
+ required property int column
+ required property bool current
- TapHandler {
- onTapped: treeView.toggleExpanded(row)
+ // Rotate indicator when expanded by the user
+ // (requires TreeView to have a selectionModel)
+ property Animation indicatorAnimation: NumberAnimation {
+ target: indicator
+ property: "rotation"
+ from: expanded ? 0 : 90
+ to: expanded ? 90 : 0
+ duration: 100
+ easing.type: Easing.OutQuart
}
+ TableView.onPooled: indicatorAnimation.complete()
+ TableView.onReused: if (current) indicatorAnimation.start()
+ onExpandedChanged: indicator.rotation = expanded ? 90 : 0
- Text {
+ Rectangle {
+ id: background
+ anchors.fill: parent
+ color: row === treeView.currentRow ? palette.highlight : "black"
+ opacity: (treeView.alternatingRows && row % 2 !== 0) ? 0.3 : 0.1
+ }
+
+ Label {
id: indicator
- visible: treeDelegate.isTreeNode && treeDelegate.hasChildren
- x: padding + (treeDelegate.depth * treeDelegate.indent)
- anchors.verticalCenter: label.verticalCenter
- text: "▸"
- rotation: treeDelegate.expanded ? 90 : 0
+ x: padding + (depth * indentation)
+ anchors.verticalCenter: parent.verticalCenter
+ visible: isTreeNode && hasChildren
+ text: "▶"
+
+ TapHandler {
+ onSingleTapped: {
+ let index = treeView.index(row, column)
+ treeView.selectionModel.setCurrentIndex(index, ItemSelectionModel.NoUpdate)
+ treeView.toggleExpanded(row)
+ }
+ }
}
- Text {
+ Label {
id: label
- x: padding + (treeDelegate.isTreeNode ? (treeDelegate.depth + 1) * treeDelegate.indent : 0)
- width: treeDelegate.width - treeDelegate.padding - x
+ x: padding + (isTreeNode ? (depth + 1) * indentation : 0)
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width - padding - x
clip: true
text: model.display
}
diff --git a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-basic.qml b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-basic.qml
index 5a597d2a89..f5ef24a174 100644
--- a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-basic.qml
+++ b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-basic.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [0]
ListView {
diff --git a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml
index a12458770a..444fdd5434 100644
--- a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml
+++ b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
ListView {
width: 240; height: 320
diff --git a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml
index 656417aba0..1f913fe5c8 100644
--- a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml
+++ b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
ListView {
width: 240; height: 320
diff --git a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml
index d7e8ce60fb..79d39a49f1 100644
--- a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml
+++ b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
ListView {
width: 240; height: 320
diff --git a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-pathanim.qml b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-pathanim.qml
index 362aa81923..8767aab58c 100644
--- a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-pathanim.qml
+++ b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-pathanim.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
ListView {
width: 240; height: 320
diff --git a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml
index faf5e76ca9..984bdc1e84 100644
--- a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml
+++ b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//! [0]
ListView {
diff --git a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml
index 1cf181de3f..c0819c2103 100644
--- a/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml
+++ b/src/quick/doc/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
ListView {
width: 240; height: 320
diff --git a/src/quick/doc/snippets/qml/visualparent.qml b/src/quick/doc/snippets/qml/visualparent.qml
index eeca529612..22da8a6622 100644
--- a/src/quick/doc/snippets/qml/visualparent.qml
+++ b/src/quick/doc/snippets/qml/visualparent.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/visualparent2.qml b/src/quick/doc/snippets/qml/visualparent2.qml
index 4824686273..a5957100ef 100644
--- a/src/quick/doc/snippets/qml/visualparent2.qml
+++ b/src/quick/doc/snippets/qml/visualparent2.qml
@@ -1,7 +1,7 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.0
+import QtQuick
//![0]
Rectangle {
diff --git a/src/quick/doc/snippets/qml/windowActiveAttached.qml b/src/quick/doc/snippets/qml/windowActiveAttached.qml
new file mode 100644
index 0000000000..791091ef82
--- /dev/null
+++ b/src/quick/doc/snippets/qml/windowActiveAttached.qml
@@ -0,0 +1,10 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//![entire]
+import QtQuick
+
+Text {
+ text: Window.active ? "active" : "inactive"
+}
+//![entire]
diff --git a/src/quick/doc/snippets/qml/windowPalette.qml b/src/quick/doc/snippets/qml/windowPalette.qml
new file mode 100644
index 0000000000..5a9219c638
--- /dev/null
+++ b/src/quick/doc/snippets/qml/windowPalette.qml
@@ -0,0 +1,40 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//![entire]
+import QtQuick
+import QtQuick.Controls
+
+//![declaration-and-color]
+Window {
+ visible: true
+
+ // here we use the Window.active and Window.palette ordinary properties
+ color: active ? palette.active.window : palette.inactive.window
+//![declaration-and-color]
+
+ // colors that are not customized here come from SystemPalette
+ palette.active.window: "peachpuff"
+ palette.windowText: "brown"
+
+//![text-item]
+ Text {
+ anchors.centerIn: parent
+ // here we use the Window.active attached property and the Item.palette property
+ color: Window.active ? palette.active.windowText : palette.inactive.windowText
+ text: Window.active ? "active" : "inactive"
+ }
+//![text-item]
+
+ Button {
+ text: "Button"
+ anchors {
+ bottom: parent.bottom
+ bottomMargin: 6
+ horizontalCenter: parent.horizontalCenter
+ }
+ }
+//![closing-brace]
+}
+//![closing-brace]
+//![entire]
diff --git a/src/quick/doc/snippets/qml/windowVisibility.qml b/src/quick/doc/snippets/qml/windowVisibility.qml
new file mode 100644
index 0000000000..fcdbd5aef1
--- /dev/null
+++ b/src/quick/doc/snippets/qml/windowVisibility.qml
@@ -0,0 +1,29 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [entire]
+import QtQuick
+import QtQuick.Controls
+
+Window {
+ id: win
+ flags: Qt.Window | Qt.WindowFullscreenButtonHint
+ visibility: fullscreenButton.checked ? Window.FullScreen : Window.Windowed
+
+ Button {
+ id: fullscreenButton
+ anchors {
+ right: parent.right
+ top: parent.top
+ margins: 6
+ }
+ width: height
+ checkable: true
+ Binding on checked { value: win.visibility === Window.FullScreen }
+ text: "⛶"
+ ToolTip.visible: hovered
+ ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
+ ToolTip.text: win.visibility === Window.FullScreen ? qsTr("restore") : qsTr("fill screen")
+ }
+}
+//! [entire]
diff --git a/src/quick/doc/snippets/qml/windowconstraints.qml b/src/quick/doc/snippets/qml/windowconstraints.qml
index 87424ffe79..e7cb0b747c 100644
--- a/src/quick/doc/snippets/qml/windowconstraints.qml
+++ b/src/quick/doc/snippets/qml/windowconstraints.qml
@@ -1,9 +1,9 @@
// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
-import QtQuick 2.2
-import QtQuick.Layouts 1.2
-import QtQuick.Window 2.2
+import QtQuick
+import QtQuick.Layouts
+import QtQuick.Window
Window {
//! [binddefaultsize]