aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols2/qquickapplicationwindow
diff options
context:
space:
mode:
authorMitch Curtis <[email protected]>2021-08-12 14:39:51 +0200
committerMitch Curtis <[email protected]>2021-08-16 12:52:59 +0200
commit809339d1484cf556512534367b8170bc26baf072 (patch)
tree12871313b658f36d058b5ef25af1e247e9c46ce9 /tests/auto/quickcontrols2/qquickapplicationwindow
parentb01b4f00eae8022c6a97d90f54dac395144ae095 (diff)
Remove qtquickcontrols2 sources and explain where they wentHEADdev
Now that qtquickcontrols2 has been merged into qtdeclarative, we should make it obvious that this repo should no longer be used, by preventing it from being built. Task-number: QTBUG-95173 Pick-to: 6.2 Change-Id: I95bd6a214f3d75a865ab163ee0a1f9ffbeb7a051 Reviewed-by: Alexandru Croitor <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'tests/auto/quickcontrols2/qquickapplicationwindow')
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt49
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/activeFocusControl.qml115
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/activefocusontab.qml94
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/attachedProperties.qml179
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/basicapplicationwindow.qml56
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/clearfocusondestruction.qml84
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/defaultFocus.qml69
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/fill.qml79
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/focusAfterPopupClosed.qml111
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/font.qml97
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/layout.qml62
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/layoutLayout.qml66
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/locale.qml77
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/data/opacity.qml61
-rw-r--r--tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp946
15 files changed, 0 insertions, 2145 deletions
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt b/tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt
deleted file mode 100644
index 00cde69c..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/CMakeLists.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-# Generated from qquickapplicationwindow.pro.
-
-#####################################################################
-## tst_qquickapplicationwindow Test:
-#####################################################################
-
-# Collect test data
-file(GLOB_RECURSE test_data_glob
- RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
- data/*)
-list(APPEND test_data ${test_data_glob})
-
-qt_internal_add_test(tst_qquickapplicationwindow
- SOURCES
- ../shared/qtest_quickcontrols.h
- ../shared/util.cpp ../shared/util.h
- ../shared/visualtestutil.cpp ../shared/visualtestutil.h
- tst_qquickapplicationwindow.cpp
- DEFINES
- QQC2_IMPORT_PATH=\\\"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/quickcontrols2\\\"
- PUBLIC_LIBRARIES
- Qt::CorePrivate
- Qt::Gui
- Qt::GuiPrivate
- Qt::QmlPrivate
- Qt::QuickControls2
- Qt::QuickControls2Private
- Qt::QuickPrivate
- Qt::QuickTemplates2Private
- Qt::QuickTest
- Qt::TestPrivate
- TESTDATA ${test_data}
-)
-
-#### Keys ignored in scope 1:.:.:qquickapplicationwindow.pro:<TRUE>:
-# OTHER_FILES = "data/*.qml"
-
-## Scopes:
-#####################################################################
-
-qt_internal_extend_target(tst_qquickapplicationwindow CONDITION ANDROID OR IOS
- DEFINES
- QT_QMLTEST_DATADIR=\\\":/data\\\"
-)
-
-qt_internal_extend_target(tst_qquickapplicationwindow CONDITION NOT ANDROID AND NOT IOS
- DEFINES
- QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
-)
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/activeFocusControl.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/activeFocusControl.qml
deleted file mode 100644
index ef694990..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/activeFocusControl.qml
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-
-ApplicationWindow {
- width: 400
- height: 400
-
- property alias container_column: column
- property alias textInput_column: ti_column
- property alias textEdit_column: te_column
- property alias textField_column: tf_column
- property alias textArea_column: ta_column
- property alias spinBox_column: sp_column
- property alias spinContent_column: sp_column.contentItem
-
- property alias container_frame: frame
- property alias textInput_frame: ti_frame
- property alias textEdit_frame: te_frame
- property alias textField_frame: tf_frame
- property alias textArea_frame: ta_frame
- property alias spinBox_frame: sp_frame
- property alias spinContent_frame: sp_frame.contentItem
-
- Column {
- id: column
-
- TextInput {
- id: ti_column
- }
- TextEdit {
- id: te_column
- }
- TextField {
- id: tf_column
- }
- TextArea {
- id: ta_column
- }
- SpinBox {
- id: sp_column
- }
- }
-
- Frame {
- id: frame
-
- Column {
- TextInput {
- id: ti_frame
- }
- TextEdit {
- id: te_frame
- }
- TextField {
- id: tf_frame
- }
- TextArea {
- id: ta_frame
- }
- SpinBox {
- id: sp_frame
- }
- }
- }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/activefocusontab.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/activefocusontab.qml
deleted file mode 100644
index 07d783ac..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/activefocusontab.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-
-ApplicationWindow {
- title: "Test Application Window"
- width: 100
- height: 100
- Item {
- id: main
- objectName: "main"
- width: 100
- height: 100
- //focus: true
- Column {
- anchors.fill: parent
- id: column
- objectName: "column"
- Item {
- id: sub1
- objectName: "sub1"
- activeFocusOnTab: true
- Accessible.role: Accessible.Table
- width: 100
- height: 50
- Rectangle {
- anchors.fill: parent
- color: parent.activeFocus ? "red" : "black"
- }
- }
- Item {
- id: sub2
- objectName: "sub2"
- activeFocusOnTab: true
- Accessible.role: Accessible.Table
- width: 100
- height: 50
- Rectangle {
- anchors.fill: parent
- color: parent.activeFocus ? "red" : "black"
- }
- }
- }
- }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/attachedProperties.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/attachedProperties.qml
deleted file mode 100644
index d241d995..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/attachedProperties.qml
+++ /dev/null
@@ -1,179 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Window
-import QtQuick.Controls
-
-ApplicationWindow {
- property alias childControl: childControl
- property alias childItem: childItem
- property alias childObject: childObject
-
- Control {
- id: childControl
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
-
- Item {
- id: childItem
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
-
- QtObject {
- id: childObject
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
-
- property alias childWindow: childWindow
- property alias childWindowControl: childWindowControl
- property alias childWindowItem: childWindowItem
- property alias childWindowObject: childWindowObject
-
- Window {
- id: childWindow
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
-
- Control {
- id: childWindowControl
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
-
- Item {
- id: childWindowItem
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
-
- QtObject {
- id: childWindowObject
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
- }
-
- property alias childAppWindow: childAppWindow
- property alias childAppWindowControl: childAppWindowControl
- property alias childAppWindowItem: childAppWindowItem
- property alias childAppWindowObject: childAppWindowObject
-
- ApplicationWindow {
- id: childAppWindow
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
-
- Control {
- id: childAppWindowControl
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
-
- Item {
- id: childAppWindowItem
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
-
- QtObject {
- id: childAppWindowObject
-
- property ApplicationWindow attached_window: ApplicationWindow.window
- property Item attached_contentItem: ApplicationWindow.contentItem
- property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
- property Item attached_header: ApplicationWindow.header
- property Item attached_footer: ApplicationWindow.footer
- }
- }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/basicapplicationwindow.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/basicapplicationwindow.qml
deleted file mode 100644
index 738022e9..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/basicapplicationwindow.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-
-ApplicationWindow {
- title: "Test Application Window"
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/clearfocusondestruction.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/clearfocusondestruction.qml
deleted file mode 100644
index bf8f61b7..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/clearfocusondestruction.qml
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-import QtQuick.Layouts
-import QtGraphicalEffects
-
-ApplicationWindow {
- width: 200
- height: 200
- visible: true
-
- property alias textfield: textfield
-
- /*
- * The code below is the simplest way we can trigger that the signal
- * activeFocusItemChanged() is emitted during destruction of the
- * ApplicationWindow. This caused a crash in QQuickApplicationWindow.
- */
- FastBlur {
- id: fastBlur
- anchors.fill: parent
- radius: 30
- source: ShaderEffectSource {
- id: effectsource
- sourceItem: textfield
- sourceRect: Qt.rect( 0, 0, fastBlur.width, fastBlur.height )
- }
- }
-
- TextField {
- id: textfield
- anchors.bottom: parent.bottom
- focus: true
- }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/defaultFocus.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/defaultFocus.qml
deleted file mode 100644
index 4651c2fc..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/defaultFocus.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-
-ApplicationWindow {
- visible: true
- width: 200
- height: 200
-
- property bool receivedKeyPress: false
-
- Item {
- objectName: "item"
- focus: true
- anchors.fill: parent
-
- Keys.onLeftPressed: receivedKeyPress = true
- }
-}
-
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/fill.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/fill.qml
deleted file mode 100644
index 082e2409..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/fill.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-
-ApplicationWindow {
- width: 400
- height: 400
-
- property alias stackView: stackView
- property alias nextItem: nextItem
-
- function pushNextItem() {
- stackView.push(nextItem, StackView.Immediate);
- }
-
- Rectangle {
- id: nextItem
- color: "blue"
- visible: false
- }
-
- StackView {
- id: stackView
- anchors.fill: parent
-
- initialItem: Rectangle {
- color: "red"
- }
- }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/focusAfterPopupClosed.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/focusAfterPopupClosed.qml
deleted file mode 100644
index ca8da3c2..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/focusAfterPopupClosed.qml
+++ /dev/null
@@ -1,111 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-
-ApplicationWindow {
- width: 200
- height: 200
- visible: true
-
- signal focusScopeKeyPressed
- signal focusPopupKeyPressed
-
- property alias fileMenu: fileMenu
- property alias toolButton: toolButton
- property alias focusScope: focusScope
- property alias focusPopup: focusPopup
-
- header: ToolBar {
- ToolButton {
- id: toolButton
- text: qsTr("File")
- onClicked: fileMenu.open()
- focusPolicy: Qt.TabFocus
-
- Menu {
- id: fileMenu
- y: parent.height
-
- MenuItem {
- text: qsTr("New")
- }
- MenuItem {
- text: qsTr("Open")
- }
- MenuItem {
- text: qsTr("Close")
- }
- }
- }
- }
-
- FocusScope {
- id: focusScope
- focus: true
- anchors.fill: parent
-
- Keys.onSpacePressed: focusScopeKeyPressed()
- }
-
- Popup {
- id: focusPopup
- focus: true
- width: parent.width
- height: parent.height
-
- Item {
- focus: true
- Keys.onSpacePressed: focusPopupKeyPressed()
- }
- }
-}
-
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/font.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/font.qml
deleted file mode 100644
index f0abbb9a..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/font.qml
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-import QtQuick.Templates as T
-
-ApplicationWindow {
- objectName: "appWin"
- width: 400
- height: 400
-
- property alias mainItem: mainItem
-
- font.family: "Arial"
-
- T.Control {
- id: mainItem
- objectName: "mainItem"
- anchors.fill: parent
- property alias item_2: _item_2;
- property alias item_3: _item_3;
- property alias item_4: _item_4;
- property alias item_5: _item_5;
- property alias item_6: _item_6;
- T.Control {
- id: _item_2
- objectName: "_item_2"
- T.Control {
- id: _item_3
- objectName: "_item_3"
- }
- }
- T.TextArea {
- id: _item_4
- objectName: "_item_4"
- text: "Text Area"
- }
- T.TextField {
- id: _item_5
- objectName: "_item_5"
- text: "Text Field"
- }
- T.Label {
- id: _item_6
- objectName: "_item_6"
- text: "Label"
- }
- }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/layout.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/layout.qml
deleted file mode 100644
index 6d4f3794..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/layout.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-
-ApplicationWindow {
- width: 200
- height: 200
- visible: true
-
- menuBar: MenuBar { }
- header: ToolBar { }
- footer: ToolBar { }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/layoutLayout.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/layoutLayout.qml
deleted file mode 100644
index 670306fa..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/layoutLayout.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-import QtQuick.Layouts
-
-ApplicationWindow {
- width: 200
- height: 200
- visible: true
-
- header: RowLayout {
- Rectangle { color: "red"; implicitWidth: 20; implicitHeight: 20; Layout.fillWidth: true}
- }
- footer: ColumnLayout {
- Rectangle { color: "green"; implicitWidth: 20; implicitHeight: 20; Layout.fillWidth: true}
- }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/locale.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/locale.qml
deleted file mode 100644
index 243ce440..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/locale.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-import QtQuick.Templates as T
-
-ApplicationWindow {
- objectName: "appWin"
- width: 400
- height: 400
-
- property alias mainItem: mainItem
-
- T.Control {
- id: mainItem
- objectName: "mainItem"
- anchors.fill: parent
- property alias item_2: _item_2;
- property alias item_3: _item_3;
- T.Control {
- id: _item_2
- objectName: "_item_2"
- T.Control {
- id: _item_3
- objectName: "_item_3"
- }
- }
- }
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/data/opacity.qml b/tests/auto/quickcontrols2/qquickapplicationwindow/data/opacity.qml
deleted file mode 100644
index d3272522..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/data/opacity.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick
-import QtQuick.Controls
-
-ApplicationWindow {
- title: "Test Application Window"
- width: 300
- height: 300
- opacity: 0.5
-
- property bool testActive: active
-}
diff --git a/tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp b/tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
deleted file mode 100644
index f6bf7d74..00000000
--- a/tests/auto/quickcontrols2/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
+++ /dev/null
@@ -1,946 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qtest.h>
-#include <QtCore/qoperatingsystemversion.h>
-#include <QtTest/QSignalSpy>
-#include <QtQml/qqmlengine.h>
-#include <QtQml/qqmlcomponent.h>
-#include <QtQml/qqmlcontext.h>
-#include <QtQuick/qquickview.h>
-#include <QtQuick/private/qquickitem_p.h>
-#include <QtGui/private/qguiapplication_p.h>
-#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
-#include <QtQuickTemplates2/private/qquickoverlay_p.h>
-#include <QtQuickTemplates2/private/qquickcontrol_p.h>
-#include <QtQuickTemplates2/private/qquicklabel_p.h>
-#include <QtQuickTemplates2/private/qquickmenu_p.h>
-#include <QtQuickTemplates2/private/qquickpopup_p.h>
-#include <QtQuickTemplates2/private/qquicktextarea_p.h>
-#include <QtQuickTemplates2/private/qquicktextfield_p.h>
-#include <QtQuickTemplates2/private/qquicktheme_p_p.h>
-#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
-
-using namespace QQuickVisualTestUtil;
-
-class tst_QQuickApplicationWindow : public QQmlDataTest
-{
- Q_OBJECT
-
-public:
- tst_QQuickApplicationWindow();
-
-private slots:
- void qmlCreation();
- void activeFocusOnTab1();
- void activeFocusOnTab2();
- void defaultFocus();
- void implicitFill();
- void attachedProperties();
- void font();
- void defaultFont();
- void locale();
- void activeFocusControl_data();
- void activeFocusControl();
- void focusAfterPopupClosed();
- void clearFocusOnDestruction();
- void layout();
- void layoutLayout();
- void componentComplete();
- void opacity();
-};
-
-tst_QQuickApplicationWindow::tst_QQuickApplicationWindow()
-{
- QQuickStyle::setStyle("Basic");
-}
-
-void tst_QQuickApplicationWindow::qmlCreation()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("basicapplicationwindow.qml"));
- QObject* created = component.create();
- QScopedPointer<QObject> cleanup(created);
- QVERIFY(created);
-
- QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
- QVERIFY(window);
- QVERIFY(!window->isVisible());
-
- QCOMPARE(created->property("title"), QVariant("Test Application Window"));
-
- QQuickItem* statusBar = qvariant_cast<QQuickItem*>(created->property("statusBar"));
- QVERIFY(!statusBar);
-
- QQuickItem* header = qvariant_cast<QQuickItem*>(created->property("header"));
- QVERIFY(!header);
-
- QQuickItem* footer = qvariant_cast<QQuickItem*>(created->property("footer"));
- QVERIFY(!footer);
-}
-
-void tst_QQuickApplicationWindow::activeFocusOnTab1()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("activefocusontab.qml"));
- QObject* created = component.create();
- QScopedPointer<QObject> cleanup(created);
- QVERIFY(created);
-
- QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
- QVERIFY(window);
- window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QVERIFY(QGuiApplication::focusWindow() == window);
-
- QQuickItem* contentItem = window->contentItem();
- QVERIFY(contentItem);
- QVERIFY(contentItem->hasActiveFocus());
-
- QQuickItem* item = findItem<QQuickItem>(window->contentItem(), "sub1");
- QVERIFY(item);
- QVERIFY(!item->hasActiveFocus());
-
- // Tab: contentItem->sub1
- {
- QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
- QGuiApplication::sendEvent(window, &key);
- QVERIFY(key.isAccepted());
-
- item = findItem<QQuickItem>(window->contentItem(), "sub1");
- QVERIFY(item);
- QVERIFY(item->hasActiveFocus());
- }
-
- // Tab: sub1->sub2
- {
- QKeyEvent key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
- QGuiApplication::sendEvent(window, &key);
- QVERIFY(key.isAccepted());
-
- item = findItem<QQuickItem>(window->contentItem(), "sub2");
- QVERIFY(item);
- QVERIFY(item->hasActiveFocus());
- }
-
- // Tab: sub2->sub1
- {
- QKeyEvent key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
- QGuiApplication::sendEvent(window, &key);
- QVERIFY(key.isAccepted());
-
- item = findItem<QQuickItem>(window->contentItem(), "sub1");
- QVERIFY(item);
- QVERIFY(item->hasActiveFocus());
- }
-}
-
-void tst_QQuickApplicationWindow::activeFocusOnTab2()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("activefocusontab.qml"));
- QObject* created = component.create();
- QScopedPointer<QObject> cleanup(created);
- QVERIFY(created);
-
- QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
- QVERIFY(window);
- window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QVERIFY(QGuiApplication::focusWindow() == window);
-
- QQuickItem* contentItem = window->contentItem();
- QVERIFY(contentItem);
- QVERIFY(contentItem->hasActiveFocus());
-
- QQuickItem* item = findItem<QQuickItem>(window->contentItem(), "sub2");
- QVERIFY(item);
- QVERIFY(!item->hasActiveFocus());
-
- // BackTab: contentItem->sub2
- {
- QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
- QGuiApplication::sendEvent(window, &key);
- QVERIFY(key.isAccepted());
-
- item = findItem<QQuickItem>(window->contentItem(), "sub2");
- QVERIFY(item);
- QVERIFY(item->hasActiveFocus());
- }
-
- // BackTab: sub2->sub1
- {
- QKeyEvent key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
- QGuiApplication::sendEvent(window, &key);
- QVERIFY(key.isAccepted());
-
- item = findItem<QQuickItem>(window->contentItem(), "sub1");
- QVERIFY(item);
- QVERIFY(item->hasActiveFocus());
- }
-
- // BackTab: sub1->sub2
- {
- QKeyEvent key = QKeyEvent(QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier, "", false, 1);
- QGuiApplication::sendEvent(window, &key);
- QVERIFY(key.isAccepted());
-
- item = findItem<QQuickItem>(window->contentItem(), "sub2");
- QVERIFY(item);
- QVERIFY(item->hasActiveFocus());
- }
-}
-
-void tst_QQuickApplicationWindow::defaultFocus()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("defaultFocus.qml"));
- QObject* created = component.create();
- QScopedPointer<QObject> cleanup(created);
- Q_UNUSED(cleanup);
- QVERIFY(created);
-
- QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
- QVERIFY(window);
- window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QVERIFY(QGuiApplication::focusWindow() == window);
-
- QQuickItem* contentItem = window->contentItem();
- QVERIFY(contentItem);
- QVERIFY(contentItem->hasActiveFocus());
-
- // A single item in an ApplicationWindow with focus: true should receive focus.
- QQuickItem* item = findItem<QQuickItem>(window->contentItem(), "item");
- QVERIFY(item);
- QVERIFY(item->hasFocus());
- QVERIFY(item->hasActiveFocus());
-}
-
-void tst_QQuickApplicationWindow::implicitFill()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("fill.qml"));
- QObject* created = component.create();
- QScopedPointer<QObject> cleanup(created);
- QVERIFY(created);
-
- QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
- QVERIFY(window);
- QVERIFY(!window->isVisible());
- QCOMPARE(window->width(), 400);
- QCOMPARE(window->height(), 400);
-
- window->show();
- QVERIFY(QTest::qWaitForWindowActive(window));
-
- QQuickItem *stackView = window->property("stackView").value<QQuickItem*>();
- QVERIFY(stackView);
- QCOMPARE(stackView->width(), 400.0);
- QCOMPARE(stackView->height(), 400.0);
-
- QQuickItem *nextItem = window->property("nextItem").value<QQuickItem*>();
- QVERIFY(nextItem);
-
- QVERIFY(QMetaObject::invokeMethod(window, "pushNextItem"));
- QCOMPARE(nextItem->width(), 400.0);
- QCOMPARE(nextItem->height(), 400.0);
-}
-
-void tst_QQuickApplicationWindow::attachedProperties()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("attachedProperties.qml"));
-
- QScopedPointer<QObject> object(component.create());
- QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
-
- QQuickApplicationWindow *window = qobject_cast<QQuickApplicationWindow *>(object.data());
- QVERIFY(window);
-
- QQuickItem *childControl = object->property("childControl").value<QQuickItem *>();
- QVERIFY(childControl);
- QCOMPARE(childControl->property("attached_window").value<QQuickApplicationWindow *>(), window);
- QCOMPARE(childControl->property("attached_contentItem").value<QQuickItem *>(), window->contentItem());
- QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), window->activeFocusControl());
- QCOMPARE(childControl->property("attached_header").value<QQuickItem *>(), window->header());
- QCOMPARE(childControl->property("attached_footer").value<QQuickItem *>(), window->footer());
-
- QQuickItem *childItem = object->property("childItem").value<QQuickItem *>();
- QVERIFY(childItem);
- QCOMPARE(childItem->property("attached_window").value<QQuickApplicationWindow *>(), window);
- QCOMPARE(childItem->property("attached_contentItem").value<QQuickItem *>(), window->contentItem());
- QCOMPARE(childItem->property("attached_activeFocusControl").value<QQuickItem *>(), window->activeFocusControl());
- QCOMPARE(childItem->property("attached_header").value<QQuickItem *>(), window->header());
- QCOMPARE(childItem->property("attached_footer").value<QQuickItem *>(), window->footer());
-
- QObject *childObject = object->property("childObject").value<QObject *>();
- QVERIFY(childObject);
- QVERIFY(!childObject->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childObject->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childObject->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childObject->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childObject->property("attached_footer").value<QQuickItem *>());
-
- QQuickWindow *childWindow = object->property("childWindow").value<QQuickWindow *>();
- QVERIFY(childWindow);
- QVERIFY(!childWindow->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childWindow->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childWindow->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childWindow->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childWindow->property("attached_footer").value<QQuickItem *>());
-
- QQuickItem *childWindowControl = object->property("childWindowControl").value<QQuickItem *>();
- QVERIFY(childWindowControl);
- QVERIFY(!childWindowControl->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childWindowControl->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childWindowControl->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childWindowControl->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childWindowControl->property("attached_footer").value<QQuickItem *>());
-
- QQuickItem *childWindowItem = object->property("childWindowItem").value<QQuickItem *>();
- QVERIFY(childWindowItem);
- QVERIFY(!childWindowItem->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childWindowItem->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childWindowItem->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childWindowItem->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childWindowItem->property("attached_footer").value<QQuickItem *>());
-
- QObject *childWindowObject = object->property("childWindowObject").value<QObject *>();
- QVERIFY(childWindowObject);
- QVERIFY(!childWindowObject->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childWindowObject->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childWindowObject->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childWindowObject->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childWindowObject->property("attached_footer").value<QQuickItem *>());
-
- QQuickApplicationWindow *childAppWindow = object->property("childAppWindow").value<QQuickApplicationWindow *>();
- QVERIFY(childAppWindow);
- QVERIFY(!childAppWindow->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childAppWindow->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childAppWindow->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childAppWindow->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childAppWindow->property("attached_footer").value<QQuickItem *>());
-
- QQuickItem *childAppWindowControl = object->property("childAppWindowControl").value<QQuickItem *>();
- QVERIFY(childAppWindowControl);
- QCOMPARE(childAppWindowControl->property("attached_window").value<QQuickApplicationWindow *>(), childAppWindow);
- QCOMPARE(childAppWindowControl->property("attached_contentItem").value<QQuickItem *>(), childAppWindow->contentItem());
- QCOMPARE(childAppWindowControl->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindow->activeFocusControl());
- QCOMPARE(childAppWindowControl->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
- QCOMPARE(childAppWindowControl->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
-
- QQuickItem *childAppWindowItem = object->property("childAppWindowItem").value<QQuickItem *>();
- QVERIFY(childAppWindowItem);
- QCOMPARE(childAppWindowItem->property("attached_window").value<QQuickApplicationWindow *>(), childAppWindow);
- QCOMPARE(childAppWindowItem->property("attached_contentItem").value<QQuickItem *>(), childAppWindow->contentItem());
- QCOMPARE(childAppWindowItem->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindow->activeFocusControl());
- QCOMPARE(childAppWindowItem->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
- QCOMPARE(childAppWindowItem->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
-
- QObject *childAppWindowObject = object->property("childAppWindowObject").value<QObject *>();
- QVERIFY(childAppWindowObject);
- QVERIFY(!childAppWindowObject->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childAppWindowObject->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childAppWindowObject->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childAppWindowObject->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childAppWindowObject->property("attached_footer").value<QQuickItem *>());
-
- window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
-
- QVERIFY(!childControl->hasActiveFocus());
- childControl->forceActiveFocus();
- QTRY_VERIFY(childControl->hasActiveFocus());
- QCOMPARE(window->activeFocusItem(), childControl);
- QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childControl);
-
- QQuickItem *header = new QQuickItem;
- window->setHeader(header);
- QCOMPARE(window->header(), header);
- QCOMPARE(childControl->property("attached_header").value<QQuickItem *>(), header);
-
- QQuickItem *footer = new QQuickItem;
- window->setFooter(footer);
- QCOMPARE(window->footer(), footer);
- QCOMPARE(childControl->property("attached_footer").value<QQuickItem *>(), footer);
-
- childAppWindow->show();
- childAppWindow->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(childAppWindow));
-
- QVERIFY(!childAppWindowControl->hasActiveFocus());
- childAppWindowControl->forceActiveFocus();
- QTRY_VERIFY(childAppWindowControl->hasActiveFocus());
- QCOMPARE(childAppWindow->activeFocusItem(), childAppWindowControl);
- QCOMPARE(childAppWindowControl->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindowControl);
-
- childControl->setParentItem(childAppWindow->contentItem());
- QCOMPARE(childControl->window(), childAppWindow);
- QCOMPARE(childControl->property("attached_window").value<QQuickApplicationWindow *>(), childAppWindow);
- QCOMPARE(childControl->property("attached_contentItem").value<QQuickItem *>(), childAppWindow->contentItem());
- QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindowControl);
- QCOMPARE(childControl->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
- QCOMPARE(childControl->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
-
- childItem->setParentItem(childAppWindow->contentItem());
- QCOMPARE(childItem->window(), childAppWindow);
- QCOMPARE(childItem->property("attached_window").value<QQuickApplicationWindow *>(), childAppWindow);
- QCOMPARE(childItem->property("attached_contentItem").value<QQuickItem *>(), childAppWindow->contentItem());
- QCOMPARE(childItem->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindowControl);
- QCOMPARE(childItem->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
- QCOMPARE(childItem->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
-
- childControl->setParentItem(nullptr);
- QVERIFY(!childControl->window());
- QVERIFY(!childControl->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
-
- childItem->setParentItem(nullptr);
- QVERIFY(!childItem->window());
- QVERIFY(!childItem->property("attached_window").value<QQuickApplicationWindow *>());
- QVERIFY(!childItem->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childItem->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childItem->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childItem->property("attached_footer").value<QQuickItem *>());
- childAppWindow->close();
- qApp->processEvents();
-
- childWindow->show();
- childWindow->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(childWindow));
-
- QVERIFY(!childWindowControl->hasActiveFocus());
- childWindowControl->forceActiveFocus();
- QTRY_VERIFY(childWindowControl->hasActiveFocus());
- QCOMPARE(childWindow->activeFocusItem(), childWindowControl);
- QCOMPARE(childWindowControl->property("attached_activeFocusControl").value<QQuickItem *>(), childWindowControl);
-
- childControl->setParentItem(childWindow->contentItem());
- QCOMPARE(childControl->window(), childWindow);
- QVERIFY(!childControl->property("attached_window").value<QQuickWindow *>());
- QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childWindowControl);
- QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
-
- childItem->setParentItem(childWindow->contentItem());
- QCOMPARE(childItem->window(), childWindow);
- QVERIFY(!childControl->property("attached_window").value<QQuickWindow *>());
- QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childWindowControl);
- QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
-
- childControl->setParentItem(nullptr);
- QVERIFY(!childControl->window());
- QVERIFY(!childControl->property("attached_window").value<QQuickWindow *>());
- QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
-
- childItem->setParentItem(nullptr);
- QVERIFY(!childItem->window());
- QVERIFY(!childItem->property("attached_window").value<QQuickWindow *>());
- QVERIFY(!childItem->property("attached_contentItem").value<QQuickItem *>());
- QVERIFY(!childItem->property("attached_activeFocusControl").value<QQuickItem *>());
- QVERIFY(!childItem->property("attached_header").value<QQuickItem *>());
- QVERIFY(!childItem->property("attached_footer").value<QQuickItem *>());
- childWindow->close();
-}
-
-void tst_QQuickApplicationWindow::font()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("font.qml"));
- QObject* created = component.create();
- QScopedPointer<QObject> cleanup(created);
- QVERIFY(created);
-
- QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(created);
- QVERIFY(window);
- QVERIFY(!window->isVisible());
- QCOMPARE(window->width(), 400);
- QCOMPARE(window->height(), 400);
-
- window->show();
- QVERIFY(QTest::qWaitForWindowActive(window));
-
- QFont font = window->font();
-
- QQuickControl *mainItem = window->property("mainItem").value<QQuickControl*>();
- QVERIFY(mainItem);
- QCOMPARE(mainItem->width(), 400.0);
- QCOMPARE(mainItem->height(), 400.0);
- QCOMPARE(mainItem->font(), font);
-
- QQuickControl *item2 = mainItem->property("item_2").value<QQuickControl*>();
- QVERIFY(item2);
- QQuickControl *item3 = mainItem->property("item_3").value<QQuickControl*>();
- QVERIFY(item3);
- QQuickTextArea *item4 = mainItem->property("item_4").value<QQuickTextArea*>();
- QVERIFY(item4);
- QQuickTextField *item5 = mainItem->property("item_5").value<QQuickTextField*>();
- QVERIFY(item5);
- QQuickLabel *item6 = mainItem->property("item_6").value<QQuickLabel*>();
- QVERIFY(item6);
-
- QCOMPARE(item2->font(), font);
- QCOMPARE(item3->font(), font);
- QCOMPARE(item4->font(), font);
- QCOMPARE(item5->font(), font);
- QCOMPARE(item6->font(), font);
-
- int pointSize = font.pointSize();
- font.setPixelSize(pointSize + 5);
- window->setFont(font);
-
- QCOMPARE(window->font(), font);
- QCOMPARE(mainItem->font(), font);
- QCOMPARE(item2->font(), font);
- QCOMPARE(item3->font(), font);
- QCOMPARE(item4->font(), font);
- QCOMPARE(item5->font(), font);
- QCOMPARE(item6->font(), font);
-}
-
-class TestTheme : public QQuickTheme
-{
-public:
- TestTheme()
- {
- setFont(System, QFont("Courier"));
- }
-};
-
-void tst_QQuickApplicationWindow::defaultFont()
-{
- QQuickThemePrivate::instance.reset(new TestTheme);
-
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.setData("import QtQuick.Controls; ApplicationWindow { }", QUrl());
-
- QScopedPointer<QQuickApplicationWindow> window;
- window.reset(static_cast<QQuickApplicationWindow *>(component.create()));
- QVERIFY(!window.isNull());
- QCOMPARE(window->font(), QQuickTheme::font(QQuickTheme::System));
-}
-
-void tst_QQuickApplicationWindow::locale()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("locale.qml"));
- QObject* created = component.create();
- QScopedPointer<QObject> cleanup(created);
- QVERIFY(created);
-
- QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(created);
- QVERIFY(window);
- QVERIFY(!window->isVisible());
- QCOMPARE(window->width(), 400);
- QCOMPARE(window->height(), 400);
-
- window->show();
- QVERIFY(QTest::qWaitForWindowActive(window));
-
- QLocale l = window->locale();
-
- QQuickControl *mainItem = window->property("mainItem").value<QQuickControl*>();
- QVERIFY(mainItem);
- QCOMPARE(mainItem->width(), 400.0);
- QCOMPARE(mainItem->height(), 400.0);
- QCOMPARE(mainItem->locale(), l);
-
- QQuickControl *item2 = mainItem->property("item_2").value<QQuickControl*>();
- QVERIFY(item2);
- QQuickControl *item3 = mainItem->property("item_3").value<QQuickControl*>();
- QVERIFY(item3);
-
- QCOMPARE(item2->locale(), l);
- QCOMPARE(item3->locale(), l);
-
- l = QLocale("en_US");
- window->setLocale(l);
-
- QCOMPARE(window->locale(), l);
- QCOMPARE(mainItem->locale(), l);
- QCOMPARE(item2->locale(), l);
- QCOMPARE(item3->locale(), l);
-
- l = QLocale("ar_EG");
- window->setLocale(l);
-
- QCOMPARE(window->locale(), l);
- QCOMPARE(mainItem->locale(), l);
- QCOMPARE(item2->locale(), l);
- QCOMPARE(item3->locale(), l);
-}
-
-void tst_QQuickApplicationWindow::activeFocusControl_data()
-{
- QTest::addColumn<QByteArray>("containerName");
- QTest::addColumn<QByteArray>("activeFocusItemName");
- QTest::addColumn<QByteArray>("activeFocusControlName");
-
- QTest::newRow("Column:TextInput") << QByteArray("container_column") << QByteArray("textInput_column") << QByteArray();
- QTest::newRow("Column:TextEdit") << QByteArray("container_column") << QByteArray("textEdit_column") << QByteArray();
- QTest::newRow("Column:TextField") << QByteArray("container_column") << QByteArray("textField_column") << QByteArray("textField_column");
- QTest::newRow("Column:TextArea") << QByteArray("container_column") << QByteArray("textArea_column") << QByteArray("textArea_column");
- QTest::newRow("Column:SpinBox") << QByteArray("container_column") << QByteArray("spinContent_column") << QByteArray("spinBox_column");
-
- QTest::newRow("Frame:TextInput") << QByteArray("container_frame") << QByteArray("textInput_frame") << QByteArray("container_frame");
- QTest::newRow("Frame:TextEdit") << QByteArray("container_frame") << QByteArray("textEdit_frame") << QByteArray("container_frame");
- QTest::newRow("Frame:TextField") << QByteArray("container_frame") << QByteArray("textField_frame") << QByteArray("textField_frame");
- QTest::newRow("Frame:TextArea") << QByteArray("container_frame") << QByteArray("textArea_frame") << QByteArray("textArea_frame");
- QTest::newRow("Frame:SpinBox") << QByteArray("container_frame") << QByteArray("spinContent_frame") << QByteArray("spinBox_frame");
-}
-
-void tst_QQuickApplicationWindow::activeFocusControl()
-{
- QFETCH(QByteArray, containerName);
- QFETCH(QByteArray, activeFocusItemName);
- QFETCH(QByteArray, activeFocusControlName);
-
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("activeFocusControl.qml"));
- QScopedPointer<QObject> object(component.create());
- QVERIFY(!object.isNull());
-
- QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(object.data());
- QVERIFY(window);
- QVERIFY(!window->isVisible());
- QCOMPARE(window->width(), 400);
- QCOMPARE(window->height(), 400);
-
- window->show();
- QVERIFY(QTest::qWaitForWindowActive(window));
-
- QQuickItem *container = window->property(containerName).value<QQuickItem*>();
- QVERIFY(container);
-
- QQuickItem *activeFocusItem = window->property(activeFocusItemName).value<QQuickItem*>();
- QVERIFY(activeFocusItem);
- activeFocusItem->forceActiveFocus();
- QVERIFY(activeFocusItem->hasActiveFocus());
- QCOMPARE(window->activeFocusItem(), activeFocusItem);
-
- QQuickItem *activeFocusControl = window->property(activeFocusControlName).value<QQuickItem*>();
- if (activeFocusControlName.isEmpty()) {
- QVERIFY(!activeFocusControl);
- } else {
- QVERIFY(activeFocusControl);
- QVERIFY(activeFocusControl->hasActiveFocus());
- }
- QCOMPARE(window->activeFocusControl(), activeFocusControl);
-}
-
-void tst_QQuickApplicationWindow::focusAfterPopupClosed()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("focusAfterPopupClosed.qml"));
- QScopedPointer<QQuickWindow> window(qobject_cast<QQuickWindow*>(component.create()));
- QVERIFY(window);
-
- window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window.data()));
- QVERIFY(QGuiApplication::focusWindow() == window.data());
-
- QQuickItem* contentItem = window->contentItem();
- QVERIFY(contentItem);
- QVERIFY(contentItem->hasActiveFocus());
-
- QQuickItem* focusScope = window->property("focusScope").value<QQuickItem*>();
- QVERIFY(focusScope);
- QVERIFY(focusScope->hasActiveFocus());
-
- QSignalSpy focusScopeSpy(window.data(), SIGNAL(focusScopeKeyPressed()));
- QTest::keyClick(window.data(), Qt::Key_Space);
- QCOMPARE(focusScopeSpy.count(), 1);
-
- // Open the menu.
- QQuickItem* toolButton = window->property("toolButton").value<QQuickItem*>();
- QVERIFY(toolButton);
- QTest::mouseClick(window.data(), Qt::LeftButton, Qt::NoModifier,
- toolButton->mapFromScene(QPointF(toolButton->width() / 2, toolButton->height() / 2)).toPoint());
- QVERIFY(!focusScope->hasActiveFocus());
-
- // The FocusScope shouldn't receive any key events while the menu is open.
- QTest::keyClick(window.data(), Qt::Key_Space);
- QCOMPARE(focusScopeSpy.count(), 1);
-
- // Close the menu. The FocusScope should regain focus.
- QTest::keyClick(window.data(), Qt::Key_Escape);
- QVERIFY(focusScope->hasActiveFocus());
-
- QTest::keyClick(window.data(), Qt::Key_Space);
- QCOMPARE(focusScopeSpy.count(), 2);
-
- QQuickPopup *focusPopup = window->property("focusPopup").value<QQuickPopup*>();
- QVERIFY(focusPopup);
- QVERIFY(!focusPopup->hasActiveFocus());
-
- focusPopup->open();
- QVERIFY(focusPopup->isVisible());
-
- QSignalSpy focusPopupSpy(window.data(), SIGNAL(focusPopupKeyPressed()));
- QTest::keyClick(window.data(), Qt::Key_Space);
- QCOMPARE(focusPopupSpy.count(), 1);
-
- QQuickMenu *fileMenu = window->property("fileMenu").value<QQuickMenu*>();
- QVERIFY(fileMenu);
- fileMenu->open();
- QVERIFY(fileMenu->isVisible());
-
- // The Popup shouldn't receive any key events while the menu is open.
- QTest::keyClick(window.data(), Qt::Key_Space);
- QCOMPARE(focusPopupSpy.count(), 1);
-
- // Close the menu. The Popup should regain focus.
- QTest::keyClick(window.data(), Qt::Key_Escape);
- QVERIFY(focusPopup->hasActiveFocus());
-
- QTest::keyClick(window.data(), Qt::Key_Space);
- QCOMPARE(focusPopupSpy.count(), 2);
-
- // Close the popup. The FocusScope should regain focus.
- QTest::keyClick(window.data(), Qt::Key_Escape);
- QVERIFY(focusScope->hasActiveFocus());
-
- QTest::keyClick(window.data(), Qt::Key_Space);
- QCOMPARE(focusScopeSpy.count(), 3);
-}
-
-void tst_QQuickApplicationWindow::clearFocusOnDestruction()
-{
- if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7)
- QSKIP("Test requires a version of Windows newer than 7: QTBUG-84443");
- if (!canImportModule("import QtGraphicalEffects; DropShadow {}"))
- QSKIP("Test requires QtGraphicalEffects");
-
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("clearfocusondestruction.qml"));
- QScopedPointer<QQuickWindow> window(qobject_cast<QQuickWindow*>(component.create()));
- QVERIFY(window);
-
- window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window.data()));
- QVERIFY(QGuiApplication::focusWindow() == window.data());
-
- QQuickItem* contentItem = window->contentItem();
- QVERIFY(contentItem);
- QVERIFY(contentItem->hasActiveFocus());
-
- QQuickItem* focusScope = window->property("textfield").value<QQuickItem*>();
- QVERIFY(focusScope);
- QVERIFY(focusScope->hasActiveFocus());
-
- QSignalSpy spy(window.data(), SIGNAL(activeFocusControlChanged()));
- // destroy the window, do not crash
- window.reset();
-
- /*
- QQuickWindow::activeFocusItemChanged() is emitted inconsistently and
- only for certain use cases. Ideally it should be emitted whenever a
- QQuickWindow with a focus item is destroyed, but it doesn't... It might
- also be favorable to not emit it for performance reason.
-
- However, activeFocusControlChanged() is emitted more consistently, which
- of course makes it inconsistent with the emission of
- activeFocusItemChanged()....
-
- Therefore, if you have good reasons to change the behavior (and not emit
- it) take the test below with a grain of salt.
- */
- QCOMPARE(spy.count(), 1);
-}
-
-void tst_QQuickApplicationWindow::layout()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("layout.qml"));
- QScopedPointer<QObject> object(component.create());
- QVERIFY(!object.isNull());
-
- QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(object.data());
- QVERIFY(window);
- QVERIFY(QTest::qWaitForWindowExposed(window));
-
- QQuickItem *content = window->contentItem();
- QVERIFY(content);
- QQuickItem *menuBar = window->menuBar();
- QVERIFY(menuBar);
- QQuickItem *header = window->header();
- QVERIFY(header);
- QQuickItem *footer = window->footer();
- QVERIFY(footer);
-
- QCOMPARE(menuBar->x(), 0.0);
- QCOMPARE(menuBar->y(), -menuBar->height() - header->height());
- QCOMPARE(header->width(), qreal(window->width()));
- QVERIFY(menuBar->height() > 0);
-
- QCOMPARE(header->x(), 0.0);
- QCOMPARE(header->y(), -header->height());
- QCOMPARE(header->width(), qreal(window->width()));
- QVERIFY(header->height() > 0);
-
- QCOMPARE(footer->x(), 0.0);
- QCOMPARE(footer->y(), content->height());
- QCOMPARE(footer->width(), qreal(window->width()));
- QVERIFY(footer->height() > 0.0);
-
- QCOMPARE(content->x(), 0.0);
- QCOMPARE(content->y(), menuBar->height() + header->height());
- QCOMPARE(content->width(), qreal(window->width()));
- QCOMPARE(content->height(), window->height() - menuBar->height() - header->height() - footer->height());
-
- menuBar->setVisible(false);
- QCOMPARE(content->x(), 0.0);
- QCOMPARE(content->y(), header->height());
- QCOMPARE(content->width(), qreal(window->width()));
- QCOMPARE(content->height(), window->height() - header->height() - footer->height());
-
- header->setVisible(false);
- QCOMPARE(content->x(), 0.0);
- QCOMPARE(content->y(), 0.0);
- QCOMPARE(content->width(), qreal(window->width()));
- QCOMPARE(content->height(), window->height() - footer->height());
-
- footer->setVisible(false);
- QCOMPARE(content->x(), 0.0);
- QCOMPARE(content->y(), 0.0);
- QCOMPARE(content->width(), qreal(window->width()));
- QCOMPARE(content->height(), qreal(window->height()));
-}
-
-void tst_QQuickApplicationWindow::layoutLayout()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("layoutLayout.qml"));
- QScopedPointer<QObject> object(component.create());
- QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
-
- QQuickApplicationWindow* window = qobject_cast<QQuickApplicationWindow*>(object.data());
- QVERIFY(window);
- QVERIFY(QTest::qWaitForWindowExposed(window));
-
- QQuickItem *content = window->contentItem();
- QVERIFY(content);
- QQuickItem *header = window->header();
- QVERIFY(header);
- QQuickItem *footer = window->footer();
- QVERIFY(footer);
-
- QQuickItem *headerChild = header->findChild<QQuickItem*>();
- QVERIFY(headerChild);
- QCOMPARE(header->x(), 0.0);
- QCOMPARE(header->y(), -header->height());
- QCOMPARE(header->width(), qreal(window->width()));
- QCOMPARE(headerChild->width(), qreal(window->width()));
- QVERIFY(header->height() > 0);
-
- QQuickItem *footerChild = header->findChild<QQuickItem*>();
- QVERIFY(footerChild);
- QCOMPARE(footer->x(), 0.0);
- QCOMPARE(footer->y(), content->height());
- QCOMPARE(footer->width(), qreal(window->width()));
- QCOMPARE(footerChild->width(), qreal(window->width()));
- QVERIFY(footer->height() > 0.0);
-}
-
-class FriendlyApplicationWindow : public QQuickApplicationWindow
-{
- friend class tst_QQuickApplicationWindow;
-};
-
-void tst_QQuickApplicationWindow::componentComplete()
-{
- FriendlyApplicationWindow cppWindow;
- QVERIFY(cppWindow.isComponentComplete());
-
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.setData("import QtQuick.Controls; ApplicationWindow { }", QUrl());
-
- FriendlyApplicationWindow *qmlWindow = static_cast<FriendlyApplicationWindow *>(component.beginCreate(engine.rootContext()));
- QVERIFY(qmlWindow);
- QVERIFY(!qmlWindow->isComponentComplete());
-
- component.completeCreate();
- QVERIFY(qmlWindow->isComponentComplete());
-}
-
-void tst_QQuickApplicationWindow::opacity()
-{
- QQmlEngine engine;
- QQmlComponent component(&engine);
- component.loadUrl(testFileUrl("opacity.qml"));
-
- QScopedPointer<QObject> object(component.create());
- QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
-
- QQuickApplicationWindow *window = qobject_cast<QQuickApplicationWindow *>(object.data());
- QVERIFY(window);
-}
-
-QTEST_MAIN(tst_QQuickApplicationWindow)
-
-#include "tst_qquickapplicationwindow.moc"