diff --git a/examples/quick/customitems/customitems.pro b/examples/quick/customitems/customitems.pro index 1e0a2aed49..399c1dd126 100644 --- a/examples/quick/customitems/customitems.pro +++ b/examples/quick/customitems/customitems.pro @@ -5,10 +5,4 @@ SUBDIRS = \ EXAMPLE_FILES = \ dialcontrol \ - flipable \ - progressbar \ - scrollbar \ - searchbox \ - slideswitch \ - spinner \ - tabwidget + flipable diff --git a/examples/quick/customitems/progressbar/content/ProgressBar.qml b/examples/quick/customitems/progressbar/content/ProgressBar.qml deleted file mode 100644 index f97ab90709..0000000000 --- a/examples/quick/customitems/progressbar/content/ProgressBar.qml +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Item { - id: progressbar - - property int minimum: 0 - property int maximum: 100 - property int value: 0 - property alias color: gradient1.color - property alias secondColor: gradient2.color - - width: 250; height: 23 - clip: true - - BorderImage { - source: "background.png" - width: parent.width; height: parent.height - border { left: 4; top: 4; right: 4; bottom: 4 } - } - - Rectangle { - id: highlight - - property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6) - - width: highlight.widthDest - Behavior on width { SmoothedAnimation { velocity: 1200 } } - - anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 } - radius: 1 - gradient: Gradient { - GradientStop { id: gradient1; position: 0.0 } - GradientStop { id: gradient2; position: 1.0 } - } - - } - Text { - anchors { right: highlight.right; rightMargin: 6; verticalCenter: parent.verticalCenter } - color: "white" - font.bold: true - text: Math.floor((value - minimum) / (maximum - minimum) * 100) + '%' - } -} diff --git a/examples/quick/customitems/progressbar/content/background.png b/examples/quick/customitems/progressbar/content/background.png deleted file mode 100644 index 5c316bc03e..0000000000 Binary files a/examples/quick/customitems/progressbar/content/background.png and /dev/null differ diff --git a/examples/quick/customitems/progressbar/main.qml b/examples/quick/customitems/progressbar/main.qml deleted file mode 100644 index 7b281aeb90..0000000000 --- a/examples/quick/customitems/progressbar/main.qml +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import "content" - -Rectangle { - id: main - - width: 600; height: 405 - color: "#edecec" - - Flickable { - anchors.fill: parent - contentHeight: column.height + 20 - - Column { - id: column - x: 10; y: 10 - spacing: 10 - - Repeater { - model: 25 - - ProgressBar { - property int r: Math.floor(Math.random() * 5000 + 1000) - width: main.width - 20 - - NumberAnimation on value { duration: r; from: 0; to: 100; loops: Animation.Infinite } - ColorAnimation on color { duration: r; from: "lightsteelblue"; to: "thistle"; loops: Animation.Infinite } - ColorAnimation on secondColor { duration: r; from: "steelblue"; to: "#CD96CD"; loops: Animation.Infinite } - } - } - } - } -} diff --git a/examples/quick/customitems/scrollbar/ScrollBar.qml b/examples/quick/customitems/scrollbar/ScrollBar.qml deleted file mode 100644 index 1df14ddba8..0000000000 --- a/examples/quick/customitems/scrollbar/ScrollBar.qml +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Item { - id: scrollBar - - // The properties that define the scrollbar's state. - // position and pageSize are in the range 0.0 - 1.0. They are relative to the - // height of the page, i.e. a pageSize of 0.5 means that you can see 50% - // of the height of the view. - // orientation can be either Qt.Vertical or Qt.Horizontal - property real position - property real pageSize - property int orientation : Qt.Vertical - - // A light, semi-transparent background - Rectangle { - id: background - anchors.fill: parent - radius: orientation === Qt.Vertical ? (width/2 - 1) : (height/2 - 1) - color: "white" - opacity: 0.3 - } - - // Size the bar to the required size, depending upon the orientation. - Rectangle { - x: orientation === Qt.Vertical ? 1 : (scrollBar.position * (scrollBar.width-2) + 1) - y: orientation === Qt.Vertical ? (scrollBar.position * (scrollBar.height-2) + 1) : 1 - width: orientation === Qt.Vertical ? (parent.width-2) : (scrollBar.pageSize * (scrollBar.width-2)) - height: orientation === Qt.Vertical ? (scrollBar.pageSize * (scrollBar.height-2)) : (parent.height-2) - radius: orientation === Qt.Vertical ? (width/2 - 1) : (height/2 - 1) - color: "black" - opacity: 0.7 - } -} diff --git a/examples/quick/customitems/scrollbar/doc/images/qml-scrollbar-example.png b/examples/quick/customitems/scrollbar/doc/images/qml-scrollbar-example.png deleted file mode 100644 index 2c80421b06..0000000000 Binary files a/examples/quick/customitems/scrollbar/doc/images/qml-scrollbar-example.png and /dev/null differ diff --git a/examples/quick/customitems/scrollbar/doc/src/scrollbar.qdoc b/examples/quick/customitems/scrollbar/doc/src/scrollbar.qdoc deleted file mode 100644 index 5df9e1156d..0000000000 --- a/examples/quick/customitems/scrollbar/doc/src/scrollbar.qdoc +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only -/*! - \title UI Components: Scroll Bar Example - \example customitems/scrollbar - \brief The Scroll Bar Example shows how to use scroll bars on a flickable element. - - This example shows how to create scroll bars for a \l Flickable element - using the \l {Flickable::visibleArea.xPosition}{Flickable::visibleArea} - properties. - - \image qml-scrollbar-example.png -*/ - diff --git a/examples/quick/customitems/scrollbar/main.cpp b/examples/quick/customitems/scrollbar/main.cpp deleted file mode 100644 index 33b7876405..0000000000 --- a/examples/quick/customitems/scrollbar/main.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(main) diff --git a/examples/quick/customitems/scrollbar/main.qml b/examples/quick/customitems/scrollbar/main.qml deleted file mode 100644 index 61b6453c03..0000000000 --- a/examples/quick/customitems/scrollbar/main.qml +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Rectangle { - width: 640 - height: 480 - - // Create a flickable to view a large image. - Flickable { - id: view - anchors.fill: parent - contentWidth: picture.width - contentHeight: picture.height - - Image { - id: picture - source: "pics/niagara_falls.jpg" - asynchronous: true - } - - // Only show the scrollbars when the view is moving. - states: State { - name: "ShowBars" - when: view.movingVertically || view.movingHorizontally - PropertyChanges { - verticalScrollBar.opacity: 1 - horizontalScrollBar.opacity: 1 - } - } - - transitions: Transition { - NumberAnimation { properties: "opacity"; duration: 400 } - } - } - - // Attach scrollbars to the right and bottom edges of the view. - ScrollBar { - id: verticalScrollBar - width: 12; height: view.height-12 - anchors.right: view.right - opacity: 0 - orientation: Qt.Vertical - position: view.visibleArea.yPosition - pageSize: view.visibleArea.heightRatio - } - - ScrollBar { - id: horizontalScrollBar - width: view.width-12; height: 12 - anchors.bottom: view.bottom - opacity: 0 - orientation: Qt.Horizontal - position: view.visibleArea.xPosition - pageSize: view.visibleArea.widthRatio - } -} diff --git a/examples/quick/customitems/scrollbar/pics/niagara_falls.jpg b/examples/quick/customitems/scrollbar/pics/niagara_falls.jpg deleted file mode 100644 index e625c0d3e6..0000000000 Binary files a/examples/quick/customitems/scrollbar/pics/niagara_falls.jpg and /dev/null differ diff --git a/examples/quick/customitems/scrollbar/scrollbar.pro b/examples/quick/customitems/scrollbar/scrollbar.pro deleted file mode 100644 index 7e6ea3c2d6..0000000000 --- a/examples/quick/customitems/scrollbar/scrollbar.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = app - -QT += quick qml -SOURCES += main.cpp - -RESOURCES += scrollbar.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/scrollbar -INSTALLS += target diff --git a/examples/quick/customitems/scrollbar/scrollbar.qmlproject b/examples/quick/customitems/scrollbar/scrollbar.qmlproject deleted file mode 100644 index e5a8bf02ca..0000000000 --- a/examples/quick/customitems/scrollbar/scrollbar.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/customitems/scrollbar/scrollbar.qrc b/examples/quick/customitems/scrollbar/scrollbar.qrc deleted file mode 100644 index b1ba5f9211..0000000000 --- a/examples/quick/customitems/scrollbar/scrollbar.qrc +++ /dev/null @@ -1,7 +0,0 @@ - - - main.qml - ScrollBar.qml - pics/niagara_falls.jpg - - diff --git a/examples/quick/customitems/searchbox/SearchBox.qml b/examples/quick/customitems/searchbox/SearchBox.qml deleted file mode 100644 index 205e691508..0000000000 --- a/examples/quick/customitems/searchbox/SearchBox.qml +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -FocusScope { - id: focusScope - width: 250; height: 28 - - BorderImage { - source: "images/lineedit-bg.png" - width: parent.width; height: parent.height - border { left: 4; top: 4; right: 4; bottom: 4 } - } - - BorderImage { - source: "images/lineedit-bg-focus.png" - width: parent.width; height: parent.height - border { left: 4; top: 4; right: 4; bottom: 4 } - visible: parent.activeFocus ? true : false - } - - Text { - id: typeSomething - anchors.fill: parent; anchors.leftMargin: 8 - verticalAlignment: Text.AlignVCenter - text: "Type something..." - color: "gray" - font.italic: true - } - - MouseArea { - anchors.fill: parent - onClicked: { focusScope.focus = true; Qt.inputMethod.show(); } - } - - TextInput { - id: textInput - anchors { left: parent.left; leftMargin: 8; right: clear.left; rightMargin: 8; verticalCenter: parent.verticalCenter } - focus: true - selectByMouse: true - } - - Image { - id: clear - anchors { right: parent.right; rightMargin: 8; verticalCenter: parent.verticalCenter } - source: "images/clear.png" - opacity: 0 - - MouseArea { - anchors.fill: parent - onClicked: { textInput.text = ''; focusScope.focus = true; textInput.openSoftwareInputPanel(); } - } - } - - states: State { - name: "hasText"; when: textInput.text != '' - PropertyChanges { - typeSomething.opacity: 0 - clear.opacity: 1 - } - } - - transitions: [ - Transition { - from: ""; to: "hasText" - NumberAnimation { exclude: typeSomething; properties: "opacity" } - }, - Transition { - from: "hasText"; to: "" - NumberAnimation { properties: "opacity" } - } - ] -} diff --git a/examples/quick/customitems/searchbox/images/clear.png b/examples/quick/customitems/searchbox/images/clear.png deleted file mode 100644 index c20a9cfba5..0000000000 Binary files a/examples/quick/customitems/searchbox/images/clear.png and /dev/null differ diff --git a/examples/quick/customitems/searchbox/images/lineedit-bg-focus.png b/examples/quick/customitems/searchbox/images/lineedit-bg-focus.png deleted file mode 100644 index c8f2722298..0000000000 Binary files a/examples/quick/customitems/searchbox/images/lineedit-bg-focus.png and /dev/null differ diff --git a/examples/quick/customitems/searchbox/images/lineedit-bg.png b/examples/quick/customitems/searchbox/images/lineedit-bg.png deleted file mode 100644 index 5c316bc03e..0000000000 Binary files a/examples/quick/customitems/searchbox/images/lineedit-bg.png and /dev/null differ diff --git a/examples/quick/customitems/searchbox/main.cpp b/examples/quick/customitems/searchbox/main.cpp deleted file mode 100644 index 33b7876405..0000000000 --- a/examples/quick/customitems/searchbox/main.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(main) diff --git a/examples/quick/customitems/searchbox/main.qml b/examples/quick/customitems/searchbox/main.qml deleted file mode 100644 index f250c4067d..0000000000 --- a/examples/quick/customitems/searchbox/main.qml +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Rectangle { - id: page - width: 500; height: 250 - color: "#edecec" - - MouseArea { - anchors.fill: parent - onClicked: page.focus = false; - } - Column { - anchors { horizontalCenter: parent.horizontalCenter; verticalCenter: parent.verticalCenter } - spacing: 10 - - SearchBox { id: search1; KeyNavigation.tab: search2; KeyNavigation.backtab: search3; focus: true } - SearchBox { id: search2; KeyNavigation.tab: search3; KeyNavigation.backtab: search1 } - SearchBox { id: search3; KeyNavigation.tab: search1; KeyNavigation.backtab: search2 } - } -} diff --git a/examples/quick/customitems/searchbox/searchbox.pro b/examples/quick/customitems/searchbox/searchbox.pro deleted file mode 100644 index c22fc117aa..0000000000 --- a/examples/quick/customitems/searchbox/searchbox.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = app - -QT += quick qml -SOURCES += main.cpp - -RESOURCES += searchbox.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/searchbox -INSTALLS += target diff --git a/examples/quick/customitems/searchbox/searchbox.qmlproject b/examples/quick/customitems/searchbox/searchbox.qmlproject deleted file mode 100644 index e5a8bf02ca..0000000000 --- a/examples/quick/customitems/searchbox/searchbox.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/customitems/searchbox/searchbox.qrc b/examples/quick/customitems/searchbox/searchbox.qrc deleted file mode 100644 index f7a8602c9a..0000000000 --- a/examples/quick/customitems/searchbox/searchbox.qrc +++ /dev/null @@ -1,9 +0,0 @@ - - - main.qml - SearchBox.qml - images/clear.png - images/lineedit-bg-focus.png - images/lineedit-bg.png - - diff --git a/examples/quick/customitems/slideswitch/content/Switch.qml b/examples/quick/customitems/slideswitch/content/Switch.qml deleted file mode 100644 index 38beefb8c4..0000000000 --- a/examples/quick/customitems/slideswitch/content/Switch.qml +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -//![0] -import QtQuick - -Item { - id: toggleswitch - width: background.width; height: background.height - -//![1] - property bool on: false -//![1] - -//![2] - function toggle() { - if (toggleswitch.state == "on") - toggleswitch.state = "off"; - else - toggleswitch.state = "on"; - } -//![2] - -//![3] - function releaseSwitch() { - if (knob.x == 1) { - if (toggleswitch.state == "off") return; - } - if (knob.x == 78) { - if (toggleswitch.state == "on") return; - } - toggle(); - } -//![3] - -//![4] - Image { - id: background - source: "background.png" - MouseArea { anchors.fill: parent; onClicked: toggle() } - } -//![4] - -//![5] - Image { - id: knob - x: 1; y: 2 - source: "knob.png" - - MouseArea { - anchors.fill: parent - drag.target: knob; drag.axis: Drag.XAxis; drag.minimumX: 1; drag.maximumX: 78 - onClicked: toggle() - onReleased: releaseSwitch() - } - } -//![5] - -//![6] - states: [ - State { - name: "on" - PropertyChanges { - knob.x: 78 - toggleswitch.on: true - } - }, - State { - name: "off" - PropertyChanges { - knob.x: 1 - toggleswitch.on: false - } - } - ] -//![6] - -//![7] - transitions: Transition { - NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 } - } -//![7] -} -//![0] diff --git a/examples/quick/customitems/slideswitch/content/background.png b/examples/quick/customitems/slideswitch/content/background.png deleted file mode 100644 index d736815870..0000000000 Binary files a/examples/quick/customitems/slideswitch/content/background.png and /dev/null differ diff --git a/examples/quick/customitems/slideswitch/content/background.svg b/examples/quick/customitems/slideswitch/content/background.svg deleted file mode 100644 index f920d3e47a..0000000000 --- a/examples/quick/customitems/slideswitch/content/background.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - -]> - - - - - - - - - - - - - - diff --git a/examples/quick/customitems/slideswitch/content/knob.png b/examples/quick/customitems/slideswitch/content/knob.png deleted file mode 100644 index ee0a436f84..0000000000 Binary files a/examples/quick/customitems/slideswitch/content/knob.png and /dev/null differ diff --git a/examples/quick/customitems/slideswitch/content/knob.svg b/examples/quick/customitems/slideswitch/content/knob.svg deleted file mode 100644 index fb6933718e..0000000000 --- a/examples/quick/customitems/slideswitch/content/knob.svg +++ /dev/null @@ -1,867 +0,0 @@ - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/quick/customitems/slideswitch/doc/src/example-slideswitch.qdoc b/examples/quick/customitems/slideswitch/doc/src/example-slideswitch.qdoc deleted file mode 100644 index 4c6b37695e..0000000000 --- a/examples/quick/customitems/slideswitch/doc/src/example-slideswitch.qdoc +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - - -/*! -\page qmlexampletoggleswitch.html -\title Qt Quick Examples - Toggle Switch -\brief A reusable switch component made in QML - \ingroup qtquickexamples - -This example shows how to create a reusable switch component in QML. - -The code for this example can be found in the \c examples/quick/customitems/slideswitch directory. - -The objects that compose the switch are: - -\list -\li a \c on property (the interface to interact with the switch), -\li two images (the background image and the knob), -\li two mouse regions for user interation (on the background image and on the knob), -\li two states (an \e on state and an \e off state), -\li two functions or slots to react to the user interation (\c toggle() and \c dorelease()), -\li and a transition that describe how to go from one state to the other. -\endlist - -\section1 Switch.qml -\snippet customitems/slideswitch/content/Switch.qml 0 - -\section1 Walkthrough - -\section2 Interface -\snippet customitems/slideswitch/content/Switch.qml 1 - -This property is the interface of the switch. By default, the switch is off and this property is \c false. -It can be used to activate/deactivate the switch or to query its current state. - -In this example: - -\qml -Item { - Switch { - id: mySwitch - on: true - } - Text { - text: "The switch is on" - visible: mySwitch.on == true - } -} -\endqml - -the text will only be visible when the switch is on. - -\section2 Images and User Interaction -\snippet customitems/slideswitch/content/Switch.qml 4 - -First, we create the background image of the switch. -In order for the switch to toggle when the user clicks on the background, we add a \l{MouseArea} as a child item of the image. -A \c MouseArea has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a -\c toggle() function. We will see what this function does in a moment. - -\snippet customitems/slideswitch/content/Switch.qml 5 - -Then, we place the image of the knob on top of the background. -The interaction here is a little more complex. We want the knob to move with the finger when it is clicked. That is what the \c drag -property of the \c MouseArea is for. We also want to toggle the switch if the knob is released between state. We handle this case -in the \c dorelease() function that is called in the \c onReleased property. - -\section2 States -\snippet customitems/slideswitch/content/Switch.qml 6 - -We define the two states of the switch: -\list -\li In the \e on state the knob is on the right (\c x position is 78) and the \c on property is \c true. -\li In the \e off state the knob is on the left (\c x position is 1) and the \c on property is \c false. -\endlist - -For more information on states see \l{Qt Quick States}. - -\section2 Functions - -We add two JavaScript functions to our switch: - -\snippet customitems/slideswitch/content/Switch.qml 2 - -This first function is called when the background image or the knob are clicked. We simply want the switch to toggle between the two -states (\e on and \e off). - - -\snippet customitems/slideswitch/content/Switch.qml 3 - -This second function is called when the knob is released and we want to make sure that the knob does not end up between states -(neither \e on nor \e off). If it is the case call the \c toggle() function otherwise we do nothing. - -For more information on scripts see \l{JavaScript Expressions in QML Documents}. - -\section2 Transition -\snippet customitems/slideswitch/content/Switch.qml 7 - -At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78. -In order for the knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms. - -For more information on transitions see \l{Animation and Transitions in Qt Quick}. - -\section1 Usage -The switch can be used in a QML file, like this: -\snippet customitems/slideswitch/slideswitch.qml 0 -*/ diff --git a/examples/quick/customitems/slideswitch/slideswitch.qml b/examples/quick/customitems/slideswitch/slideswitch.qml deleted file mode 100644 index 430c46c6dd..0000000000 --- a/examples/quick/customitems/slideswitch/slideswitch.qml +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import "content" - -Rectangle { - color: "white" - width: 400; height: 250 - -//![0] - Switch { anchors.centerIn: parent; on: false } -//![0] -} diff --git a/examples/quick/customitems/spinner/content/Spinner.qml b/examples/quick/customitems/spinner/content/Spinner.qml deleted file mode 100644 index c5f2a2b4ed..0000000000 --- a/examples/quick/customitems/spinner/content/Spinner.qml +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Image { - property alias model: view.model - property alias delegate: view.delegate - property alias currentIndex: view.currentIndex - property real itemHeight: 30 - - source: "spinner-bg.png" - clip: true - - PathView { - id: view - anchors.fill: parent - - pathItemCount: height/itemHeight - preferredHighlightBegin: 0.5 - preferredHighlightEnd: 0.5 - highlight: Image { source: "spinner-select.png"; width: view.width; height: itemHeight+4 } - dragMargin: view.width/2 - - path: Path { - startX: view.width/2; startY: -itemHeight/2 - PathLine { x: view.width/2; y: view.pathItemCount*itemHeight + itemHeight } - } - } - - Keys.onDownPressed: view.incrementCurrentIndex() - Keys.onUpPressed: view.decrementCurrentIndex() -} diff --git a/examples/quick/customitems/spinner/content/spinner-bg.png b/examples/quick/customitems/spinner/content/spinner-bg.png deleted file mode 100644 index da34fc4090..0000000000 Binary files a/examples/quick/customitems/spinner/content/spinner-bg.png and /dev/null differ diff --git a/examples/quick/customitems/spinner/content/spinner-select.png b/examples/quick/customitems/spinner/content/spinner-select.png deleted file mode 100644 index 95a17a1fe2..0000000000 Binary files a/examples/quick/customitems/spinner/content/spinner-select.png and /dev/null differ diff --git a/examples/quick/customitems/spinner/main.cpp b/examples/quick/customitems/spinner/main.cpp deleted file mode 100644 index 33b7876405..0000000000 --- a/examples/quick/customitems/spinner/main.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(main) diff --git a/examples/quick/customitems/spinner/main.qml b/examples/quick/customitems/spinner/main.qml deleted file mode 100644 index e6b674fc53..0000000000 --- a/examples/quick/customitems/spinner/main.qml +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick -import "content" - -Rectangle { - width: 240; height: 320 - - Column { - y: 20; x: 20; spacing: 20 - - Spinner { - id: spinner - width: 200; height: 240 - focus: true - model: 20 - itemHeight: 30 - delegate: Text { font.pixelSize: 25; text: index; height: 30 } - } - - Text { text: "Current item index: " + spinner.currentIndex } - } -} diff --git a/examples/quick/customitems/spinner/spinner.pro b/examples/quick/customitems/spinner/spinner.pro deleted file mode 100644 index b5be6884d2..0000000000 --- a/examples/quick/customitems/spinner/spinner.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = app - -QT += quick qml -SOURCES += main.cpp - -RESOURCES += spinner.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/spinner -INSTALLS += target diff --git a/examples/quick/customitems/spinner/spinner.qmlproject b/examples/quick/customitems/spinner/spinner.qmlproject deleted file mode 100644 index e5a8bf02ca..0000000000 --- a/examples/quick/customitems/spinner/spinner.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/customitems/spinner/spinner.qrc b/examples/quick/customitems/spinner/spinner.qrc deleted file mode 100644 index 3a8e4b17fd..0000000000 --- a/examples/quick/customitems/spinner/spinner.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - main.qml - content/spinner-bg.png - content/spinner-select.png - content/Spinner.qml - - diff --git a/examples/quick/customitems/tabwidget/TabWidget.qml b/examples/quick/customitems/tabwidget/TabWidget.qml deleted file mode 100644 index f031cd8beb..0000000000 --- a/examples/quick/customitems/tabwidget/TabWidget.qml +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -Item { - id: tabWidget - - // Setting the default property to stack.children means any child items - // of the TabWidget are actually added to the 'stack' item's children. - // See the "Property Binding" - // documentation for details on default properties. - default property alias content: stack.children - - property int current: 0 - - onCurrentChanged: setOpacities() - Component.onCompleted: setOpacities() - - function setOpacities() { - for (var i = 0; i < stack.children.length; ++i) { - stack.children[i].opacity = (i == current ? 1 : 0) - } - } - - Row { - id: header - - Repeater { - model: stack.children.length - delegate: Rectangle { - width: tabWidget.width / stack.children.length; height: 36 - - Rectangle { - width: parent.width; height: 1 - anchors { bottom: parent.bottom; bottomMargin: 1 } - color: "#acb2c2" - } - BorderImage { - anchors { fill: parent; leftMargin: 2; topMargin: 5; rightMargin: 1 } - border { left: 7; right: 7 } - source: "tab.png" - visible: tabWidget.current == index - } - Text { - horizontalAlignment: Qt.AlignHCenter; verticalAlignment: Qt.AlignVCenter - anchors.fill: parent - text: stack.children[index].title - elide: Text.ElideRight - font.bold: tabWidget.current == index - } - MouseArea { - anchors.fill: parent - onClicked: tabWidget.current = index - } - } - } - } - - Item { - id: stack - width: tabWidget.width - anchors.top: header.bottom; anchors.bottom: tabWidget.bottom - } -} diff --git a/examples/quick/customitems/tabwidget/doc/images/qml-tabwidget-example.png b/examples/quick/customitems/tabwidget/doc/images/qml-tabwidget-example.png deleted file mode 100644 index 2e1cae2584..0000000000 Binary files a/examples/quick/customitems/tabwidget/doc/images/qml-tabwidget-example.png and /dev/null differ diff --git a/examples/quick/customitems/tabwidget/doc/images/tab.png b/examples/quick/customitems/tabwidget/doc/images/tab.png deleted file mode 100644 index 2ea989b68d..0000000000 Binary files a/examples/quick/customitems/tabwidget/doc/images/tab.png and /dev/null differ diff --git a/examples/quick/customitems/tabwidget/doc/src/tabwidget.qdoc b/examples/quick/customitems/tabwidget/doc/src/tabwidget.qdoc deleted file mode 100644 index d4124b631a..0000000000 --- a/examples/quick/customitems/tabwidget/doc/src/tabwidget.qdoc +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \title TabWidget Example - \example customitems/tabwidget - \brief The TabWidget example shows how to create a tabwidget using property aliases - and QML Object default properties. - - This example shows how to create a tab widget. It also demonstrates how - \l {Property aliases}{property aliases} and - \l {QML Object Attributes#Default Properties}{default properties} can be used to collect and - assemble the child items declared within an \l Item. - - \image qml-tabwidget-example.png -*/ - - diff --git a/examples/quick/customitems/tabwidget/main.cpp b/examples/quick/customitems/tabwidget/main.cpp deleted file mode 100644 index 33b7876405..0000000000 --- a/examples/quick/customitems/tabwidget/main.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -#include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(main) diff --git a/examples/quick/customitems/tabwidget/main.qml b/examples/quick/customitems/tabwidget/main.qml deleted file mode 100644 index ef73847f66..0000000000 --- a/examples/quick/customitems/tabwidget/main.qml +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -import QtQuick - -TabWidget { - id: tabs - width: 640; height: 480 - - Rectangle { - property string title: "Red" - anchors.fill: parent - color: "#e3e3e3" - - Rectangle { - anchors.fill: parent; anchors.margins: 20 - color: "#ff7f7f" - Text { - width: parent.width - 20 - anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter - text: "Roses are red" - font.pixelSize: 20 - wrapMode: Text.WordWrap - } - } - } - - Rectangle { - property string title: "Green" - anchors.fill: parent - color: "#e3e3e3" - - Rectangle { - anchors.fill: parent; anchors.margins: 20 - color: "#7fff7f" - Text { - width: parent.width - 20 - anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter - text: "Flower stems are green" - font.pixelSize: 20 - wrapMode: Text.WordWrap - } - } - } - - Rectangle { - property string title: "Blue" - anchors.fill: parent; color: "#e3e3e3" - - Rectangle { - anchors.fill: parent; anchors.margins: 20 - color: "#7f7fff" - Text { - width: parent.width - 20 - anchors.centerIn: parent; horizontalAlignment: Qt.AlignHCenter - text: "Violets are blue" - font.pixelSize: 20 - wrapMode: Text.WordWrap - } - } - } -} diff --git a/examples/quick/customitems/tabwidget/tabwidget.pro b/examples/quick/customitems/tabwidget/tabwidget.pro deleted file mode 100644 index b852bb4075..0000000000 --- a/examples/quick/customitems/tabwidget/tabwidget.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = app - -QT += quick qml -SOURCES += main.cpp - -RESOURCES += tabwidget.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/quick/customitems/tabwidget -INSTALLS += target diff --git a/examples/quick/customitems/tabwidget/tabwidget.qmlproject b/examples/quick/customitems/tabwidget/tabwidget.qmlproject deleted file mode 100644 index e5a8bf02ca..0000000000 --- a/examples/quick/customitems/tabwidget/tabwidget.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/quick/customitems/tabwidget/tabwidget.qrc b/examples/quick/customitems/tabwidget/tabwidget.qrc deleted file mode 100644 index ee71f677b1..0000000000 --- a/examples/quick/customitems/tabwidget/tabwidget.qrc +++ /dev/null @@ -1,8 +0,0 @@ - - - main.qml - TabWidget.qml - doc/images/qml-tabwidget-example.png - doc/images/tab.png - -