aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols2/font
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quickcontrols2/font')
-rw-r--r--tests/auto/quickcontrols2/font/CMakeLists.txt47
-rw-r--r--tests/auto/quickcontrols2/font/data/font-appwindow-custom.qml62
-rw-r--r--tests/auto/quickcontrols2/font/data/font-appwindow-default.qml55
-rw-r--r--tests/auto/quickcontrols2/font/data/font-control-custom.qml62
-rw-r--r--tests/auto/quickcontrols2/font/data/font-control-default.qml55
-rw-r--r--tests/auto/quickcontrols2/font/data/font-popup-custom.qml62
-rw-r--r--tests/auto/quickcontrols2/font/data/font-popup-default.qml55
-rw-r--r--tests/auto/quickcontrols2/font/data/inheritance-childcontrol.qml76
-rw-r--r--tests/auto/quickcontrols2/font/data/inheritance-childpopup.qml76
-rw-r--r--tests/auto/quickcontrols2/font/data/inheritance-control.qml74
-rw-r--r--tests/auto/quickcontrols2/font/data/inheritance-dynamicchildcontrol.qml75
-rw-r--r--tests/auto/quickcontrols2/font/data/inheritance-dynamicchildpopup.qml80
-rw-r--r--tests/auto/quickcontrols2/font/data/inheritance-dynamiccontrol.qml71
-rw-r--r--tests/auto/quickcontrols2/font/data/inheritance-dynamicpopup.qml76
-rw-r--r--tests/auto/quickcontrols2/font/data/inheritance-popup.qml74
-rw-r--r--tests/auto/quickcontrols2/font/data/listview.qml79
-rw-r--r--tests/auto/quickcontrols2/font/tst_font.cpp369
17 files changed, 1448 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols2/font/CMakeLists.txt b/tests/auto/quickcontrols2/font/CMakeLists.txt
new file mode 100644
index 0000000000..ce782668fb
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from font.pro.
+
+#####################################################################
+## tst_font 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_font
+ SOURCES
+ tst_font.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::QuickTestUtilsPrivate
+ Qt::TestPrivate
+ TESTDATA ${test_data}
+)
+
+#### Keys ignored in scope 1:.:.:font.pro:<TRUE>:
+# OTHER_FILES = "data/*.qml"
+
+## Scopes:
+#####################################################################
+
+qt_internal_extend_target(tst_font CONDITION ANDROID OR IOS
+ DEFINES
+ QT_QMLTEST_DATADIR=\\\":/data\\\"
+)
+
+qt_internal_extend_target(tst_font CONDITION NOT ANDROID AND NOT IOS
+ DEFINES
+ QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
+)
diff --git a/tests/auto/quickcontrols2/font/data/font-appwindow-custom.qml b/tests/auto/quickcontrols2/font/data/font-appwindow-custom.qml
new file mode 100644
index 0000000000..9f82079e05
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/font-appwindow-custom.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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 {
+ font.capitalization: Font.AllUppercase
+ font.family: "Courier"
+ font.italic: true
+ font.pixelSize: 60
+ font.strikeout: true
+ font.underline: true
+ font.weight: Font.DemiBold
+}
diff --git a/tests/auto/quickcontrols2/font/data/font-appwindow-default.qml b/tests/auto/quickcontrols2/font/data/font-appwindow-default.qml
new file mode 100644
index 0000000000..9f2c34fe17
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/font-appwindow-default.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** 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 {
+}
diff --git a/tests/auto/quickcontrols2/font/data/font-control-custom.qml b/tests/auto/quickcontrols2/font/data/font-control-custom.qml
new file mode 100644
index 0000000000..8fcfc68612
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/font-control-custom.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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
+
+Control {
+ font.capitalization: Font.AllUppercase
+ font.family: "Courier"
+ font.italic: true
+ font.pixelSize: 60
+ font.strikeout: true
+ font.underline: true
+ font.weight: Font.DemiBold
+}
diff --git a/tests/auto/quickcontrols2/font/data/font-control-default.qml b/tests/auto/quickcontrols2/font/data/font-control-default.qml
new file mode 100644
index 0000000000..48afa021cd
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/font-control-default.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** 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
+
+Control {
+}
diff --git a/tests/auto/quickcontrols2/font/data/font-popup-custom.qml b/tests/auto/quickcontrols2/font/data/font-popup-custom.qml
new file mode 100644
index 0000000000..e3983bf518
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/font-popup-custom.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** 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
+
+Popup {
+ font.capitalization: Font.AllUppercase
+ font.family: "Courier"
+ font.italic: true
+ font.pixelSize: 60
+ font.strikeout: true
+ font.underline: true
+ font.weight: Font.DemiBold
+}
diff --git a/tests/auto/quickcontrols2/font/data/font-popup-default.qml b/tests/auto/quickcontrols2/font/data/font-popup-default.qml
new file mode 100644
index 0000000000..77676baccf
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/font-popup-default.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** 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
+
+Popup {
+}
diff --git a/tests/auto/quickcontrols2/font/data/inheritance-childcontrol.qml b/tests/auto/quickcontrols2/font/data/inheritance-childcontrol.qml
new file mode 100644
index 0000000000..896354dfb0
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/inheritance-childcontrol.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+
+ property alias control: control
+ property alias child: child
+ property alias grandChild: grandChild
+
+ Item {
+ Control {
+ id: control
+
+ Control {
+ id: child
+
+ Item {
+ Control {
+ id: grandChild
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/data/inheritance-childpopup.qml b/tests/auto/quickcontrols2/font/data/inheritance-childpopup.qml
new file mode 100644
index 0000000000..7896a558e9
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/inheritance-childpopup.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+
+ property alias control: control
+ property alias child: child
+ property alias grandChild: grandChild
+
+ Item {
+ Popup {
+ id: control
+
+ Control {
+ id: child
+
+ Item {
+ Control {
+ id: grandChild
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/data/inheritance-control.qml b/tests/auto/quickcontrols2/font/data/inheritance-control.qml
new file mode 100644
index 0000000000..eb534180a8
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/inheritance-control.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+
+ property alias control: control
+ property alias child: child
+ property alias grandChild: grandChild
+
+ Control {
+ id: control
+
+ Control {
+ id: child
+
+ Item {
+ Control {
+ id: grandChild
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/data/inheritance-dynamicchildcontrol.qml b/tests/auto/quickcontrols2/font/data/inheritance-dynamicchildcontrol.qml
new file mode 100644
index 0000000000..0a4e5bc664
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/inheritance-dynamicchildcontrol.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+
+ property Control control
+ property Control child
+ property Control grandChild
+
+ Item {
+ id: childItem
+ }
+
+ Component {
+ id: component
+ Control { }
+ }
+
+ Component.onCompleted: {
+ control = component.createObject(childItem)
+ child = component.createObject(control)
+ grandChild = component.createObject(child)
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/data/inheritance-dynamicchildpopup.qml b/tests/auto/quickcontrols2/font/data/inheritance-dynamicchildpopup.qml
new file mode 100644
index 0000000000..0e799d47f0
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/inheritance-dynamicchildpopup.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+
+ property Popup control
+ property Control child
+ property Control grandChild
+
+ Item {
+ id: childItem
+ }
+
+ Component {
+ id: popupComponent
+ Popup { }
+ }
+
+ Component {
+ id: controlComponent
+ Control { }
+ }
+
+ Component.onCompleted: {
+ control = popupComponent.createObject(childItem)
+ child = controlComponent.createObject(control.contentItem)
+ grandChild = controlComponent.createObject(child)
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/data/inheritance-dynamiccontrol.qml b/tests/auto/quickcontrols2/font/data/inheritance-dynamiccontrol.qml
new file mode 100644
index 0000000000..058d5b8b95
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/inheritance-dynamiccontrol.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+
+ property Control control
+ property Control child
+ property Control grandChild
+
+ Component {
+ id: component
+ Control { }
+ }
+
+ Component.onCompleted: {
+ control = component.createObject(contentItem)
+ child = component.createObject(control)
+ grandChild = component.createObject(child)
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/data/inheritance-dynamicpopup.qml b/tests/auto/quickcontrols2/font/data/inheritance-dynamicpopup.qml
new file mode 100644
index 0000000000..429669c7b2
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/inheritance-dynamicpopup.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+
+ property Popup control
+ property Control child
+ property Control grandChild
+
+ Component {
+ id: popupComponent
+ Popup { }
+ }
+
+ Component {
+ id: controlComponent
+ Control { }
+ }
+
+ Component.onCompleted: {
+ control = popupComponent.createObject(window)
+ child = controlComponent.createObject(control.contentItem)
+ grandChild = controlComponent.createObject(child)
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/data/inheritance-popup.qml b/tests/auto/quickcontrols2/font/data/inheritance-popup.qml
new file mode 100644
index 0000000000..cd2aebb55a
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/inheritance-popup.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+
+ property alias control: control
+ property alias child: child
+ property alias grandChild: grandChild
+
+ Popup {
+ id: control
+
+ Control {
+ id: child
+
+ Item {
+ Control {
+ id: grandChild
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/data/listview.qml b/tests/auto/quickcontrols2/font/data/listview.qml
new file mode 100644
index 0000000000..7c37258519
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/data/listview.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** 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 {
+ id: window
+ width: 200
+ height: 200
+
+ property alias listView: listView
+
+ font.pixelSize: 55
+
+ ListView {
+ id: listView
+ anchors.fill: parent
+ model: 1
+ delegate: Column {
+ property alias control: control
+ property alias label: label
+ property alias textarea: textarea
+ property alias textfield: textfield
+
+ Control { id: control }
+ Label { id: label }
+ TextArea { id: textarea }
+ TextField { id: textfield }
+ }
+ }
+}
diff --git a/tests/auto/quickcontrols2/font/tst_font.cpp b/tests/auto/quickcontrols2/font/tst_font.cpp
new file mode 100644
index 0000000000..a3adcfd6c4
--- /dev/null
+++ b/tests/auto/quickcontrols2/font/tst_font.cpp
@@ -0,0 +1,369 @@
+/****************************************************************************
+**
+** 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 <QtTest/qtest.h>
+
+#include <QtGui/qfont.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtQml/qqmlengine.h>
+#include <QtQml/qqmlcomponent.h>
+#include <QtQuickTestUtils/private/qmlutils_p.h>
+#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
+#include <QtQuickTemplates2/private/qquickcontrol_p.h>
+#include <QtQuickTemplates2/private/qquickpopup_p.h>
+#include <QtQuickTemplates2/private/qquicktheme_p_p.h>
+#include <QtQuickControls2/qquickstyle.h>
+
+class tst_font : public QQmlDataTest
+{
+ Q_OBJECT
+
+public:
+ tst_font();
+
+private slots:
+ void systemFont();
+
+ void font_data();
+ void font();
+
+ void inheritance_data();
+ void inheritance();
+
+ void defaultFont_data();
+ void defaultFont();
+
+ void listView_data();
+ void listView();
+};
+
+static QFont testFont()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.setData("import QtQuick; import QtQuick.Controls; Text { }", QUrl());
+
+ QScopedPointer<QObject> object(component.create());
+ Q_ASSERT_X(!object.isNull(), "testFont", qPrintable(component.errorString()));
+
+ QVariant var = object->property("font");
+ Q_ASSERT_X(var.isValid(), "testFont", var.typeName());
+ return var.value<QFont>();
+}
+
+tst_font::tst_font()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+ QQuickStyle::setStyle("Basic");
+}
+
+void tst_font::systemFont()
+{
+ QSKIP("QTBUG-70063: qmlClearTypeRegistrations() call causes crash");
+
+ const QFont *originalSystemFont = QGuiApplicationPrivate::platformTheme()->font(QPlatformTheme::SystemFont);
+ if (!originalSystemFont)
+ QSKIP("Cannot test the system font on a minimal platform");
+
+ const QFont fontBefore = testFont();
+ QCOMPARE(fontBefore, *originalSystemFont);
+
+ qmlClearTypeRegistrations();
+ delete QGuiApplicationPrivate::app_font;
+ QGuiApplicationPrivate::app_font = nullptr;
+
+ const QFont appFont = QGuiApplication::font();
+ QCOMPARE(appFont, *originalSystemFont);
+
+ const QFont fontAfter = testFont();
+ QCOMPARE(fontAfter, *originalSystemFont);
+}
+
+void tst_font::font_data()
+{
+ QTest::addColumn<QString>("testFile");
+ QTest::addColumn<QFont>("expectedFont");
+
+ QTest::newRow("Control") << "font-control-default.qml" << QFont();
+ QTest::newRow("AppWindow") << "font-appwindow-default.qml" << QFont();
+ QTest::newRow("Popup") << "font-popup-default.qml" << QFont();
+
+ QFont customFont;
+ customFont.setCapitalization(QFont::AllUppercase);
+ customFont.setFamilies(QStringList{QLatin1String("Courier")});
+ customFont.setItalic(true);
+ customFont.setPixelSize(60);
+ customFont.setStrikeOut(true);
+ customFont.setUnderline(true);
+ customFont.setWeight(QFont::DemiBold);
+
+ QTest::newRow("Control:custom") << "font-control-custom.qml" << customFont;
+ QTest::newRow("AppWindow:custom") << "font-appwindow-custom.qml" << customFont;
+ QTest::newRow("Popup:custom") << "font-popup-custom.qml" << customFont;
+}
+
+void tst_font::font()
+{
+ QFETCH(QString, testFile);
+ QFETCH(QFont, expectedFont);
+
+ if (QSysInfo::productType().compare(QLatin1String("osx"), Qt::CaseInsensitive) == 0
+ && qgetenv("QTEST_ENVIRONMENT").split(' ').contains("CI")) {
+ QSKIP("This test crashes on macOS: QTBUG-70063");
+ }
+
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl(testFile));
+
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
+
+ QVariant var = object->property("font");
+ QVERIFY(var.isValid());
+
+ QFont actualFont = var.value<QFont>();
+ QCOMPARE(actualFont, expectedFont);
+}
+
+void tst_font::inheritance_data()
+{
+ QTest::addColumn<QString>("testFile");
+
+ QTest::newRow("Control") << "inheritance-control.qml";
+ QTest::newRow("Child Control") << "inheritance-childcontrol.qml";
+ QTest::newRow("Dynamic Control") << "inheritance-dynamiccontrol.qml";
+ QTest::newRow("Dynamic Child Control") << "inheritance-dynamicchildcontrol.qml";
+
+ QTest::newRow("Popup") << "inheritance-popup.qml";
+ QTest::newRow("Child Popup") << "inheritance-childpopup.qml";
+ QTest::newRow("Dynamic Popup") << "inheritance-dynamicpopup.qml";
+ QTest::newRow("Dynamic Child Popup") << "inheritance-dynamicchildpopup.qml";
+}
+
+void tst_font::inheritance()
+{
+ QFETCH(QString, testFile);
+
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl(testFile));
+
+ QScopedPointer<QQuickApplicationWindow> window(qobject_cast<QQuickApplicationWindow *>(component.create()));
+ QVERIFY2(!window.isNull(), qPrintable(component.errorString()));
+
+ QObject *control = window->property("control").value<QObject *>();
+ QObject *child = window->property("child").value<QObject *>();
+ QObject *grandChild = window->property("grandChild").value<QObject *>();
+ QVERIFY(control && child && grandChild);
+
+ QCOMPARE(window->font(), QFont());
+
+ QCOMPARE(control->property("font").value<QFont>(), QFont());
+ QCOMPARE(child->property("font").value<QFont>(), QFont());
+ QCOMPARE(grandChild->property("font").value<QFont>(), QFont());
+
+ QFont childFont;
+ childFont.setFamilies(QStringList{QLatin1String("Arial")});
+ childFont.setPixelSize(80);
+ childFont.setItalic(true);
+ child->setProperty("font", childFont);
+ QCOMPARE(child->property("font").value<QFont>(), childFont);
+ QCOMPARE(grandChild->property("font").value<QFont>(), childFont);
+
+ QFont grandChildFont(childFont);
+ grandChildFont.setFamilies(QStringList{QLatin1String("Times New Roman")});
+ grandChildFont.setUnderline(true);
+ grandChild->setProperty("font", grandChildFont);
+ QCOMPARE(child->property("font").value<QFont>(), childFont);
+ QCOMPARE(grandChild->property("font").value<QFont>(), grandChildFont);
+
+ QFont windowFont;
+ windowFont.setWeight(QFont::Thin);
+ window->setFont(windowFont);
+ QCOMPARE(window->font(), windowFont);
+ QCOMPARE(control->property("font").value<QFont>(), windowFont);
+
+ childFont.setWeight(QFont::Thin);
+ QCOMPARE(child->property("font").value<QFont>(), childFont);
+
+ grandChildFont.setWeight(QFont::Thin);
+ QCOMPARE(grandChild->property("font").value<QFont>(), grandChildFont);
+
+ child->setProperty("font", QVariant());
+ QCOMPARE(child->property("font").value<QFont>(), windowFont);
+ QCOMPARE(grandChild->property("font").value<QFont>(), grandChildFont);
+
+ grandChild->setProperty("font", QVariant());
+ QCOMPARE(grandChild->property("font").value<QFont>(), windowFont);
+}
+
+class TestFontTheme : public QQuickTheme
+{
+public:
+ static const int NFonts = QQuickTheme::Tumbler + 1;
+
+ TestFontTheme()
+ {
+ for (int i = 0; i < NFonts; ++i) {
+ QFont font = QFont();
+ font.setPixelSize(i + 10);
+ setFont(static_cast<Scope>(i), font);
+ }
+ }
+};
+
+Q_DECLARE_METATYPE(QQuickTheme::Scope)
+
+void tst_font::defaultFont_data()
+{
+ QTest::addColumn<QString>("control");
+ QTest::addColumn<QQuickTheme::Scope>("scope");
+
+ QTest::newRow("AbstractButton") << "AbstractButton" << QQuickTheme::System;
+ QTest::newRow("ApplicationWindow") << "ApplicationWindow" << QQuickTheme::System;
+ QTest::newRow("Button") << "Button" << QQuickTheme::Button;
+ QTest::newRow("CheckBox") << "CheckBox" << QQuickTheme::CheckBox;
+ QTest::newRow("CheckDelegate") << "CheckDelegate" << QQuickTheme::ListView;
+ QTest::newRow("ComboBox") << "ComboBox" << QQuickTheme::ComboBox;
+ QTest::newRow("Container") << "Container" << QQuickTheme::System;
+ QTest::newRow("Control") << "Control" << QQuickTheme::System;
+ QTest::newRow("Dial") << "Dial" << QQuickTheme::System;
+ QTest::newRow("Dialog") << "Dialog" << QQuickTheme::System;
+ QTest::newRow("DialogButtonBox") << "DialogButtonBox" << QQuickTheme::System;
+ QTest::newRow("Drawer") << "Drawer" << QQuickTheme::System;
+ QTest::newRow("Frame") << "Frame" << QQuickTheme::System;
+ QTest::newRow("GroupBox") << "GroupBox" << QQuickTheme::GroupBox;
+ QTest::newRow("ItemDelegate") << "ItemDelegate" << QQuickTheme::ItemView;
+ QTest::newRow("Label") << "Label" << QQuickTheme::Label;
+ QTest::newRow("Menu") << "Menu" << QQuickTheme::Menu;
+ QTest::newRow("MenuItem") << "MenuItem" << QQuickTheme::Menu;
+ QTest::newRow("MenuSeparator") << "MenuSeparator" << QQuickTheme::Menu;
+ QTest::newRow("Page") << "Page" << QQuickTheme::System;
+ QTest::newRow("Pane") << "Pane" << QQuickTheme::System;
+ QTest::newRow("Popup") << "Popup" << QQuickTheme::System;
+ QTest::newRow("ProgressBar") << "ProgressBar" << QQuickTheme::System;
+ QTest::newRow("RadioButton") << "RadioButton" << QQuickTheme::RadioButton;
+ QTest::newRow("RadioDelegate") << "RadioDelegate" << QQuickTheme::ListView;
+ QTest::newRow("RangeSlider") << "RangeSlider" << QQuickTheme::System;
+ QTest::newRow("RoundButton") << "RoundButton" << QQuickTheme::Button;
+ QTest::newRow("ScrollBar") << "ScrollBar" << QQuickTheme::System;
+ QTest::newRow("ScrollIndicator") << "ScrollIndicator" << QQuickTheme::System;
+ QTest::newRow("Slider") << "Slider" << QQuickTheme::System;
+ QTest::newRow("SpinBox") << "SpinBox" << QQuickTheme::SpinBox;
+ QTest::newRow("SwipeDelegate") << "SwipeDelegate" << QQuickTheme::ListView;
+ QTest::newRow("Switch") << "Switch" << QQuickTheme::Switch;
+ QTest::newRow("SwitchDelegate") << "SwitchDelegate" << QQuickTheme::ListView;
+ QTest::newRow("TabBar") << "TabBar" << QQuickTheme::TabBar;
+ QTest::newRow("TabButton") << "TabButton" << QQuickTheme::TabBar;
+ QTest::newRow("TextArea") << "TextArea" << QQuickTheme::TextArea;
+ QTest::newRow("TextField") << "TextField" << QQuickTheme::TextField;
+ QTest::newRow("ToolBar") << "ToolBar" << QQuickTheme::ToolBar;
+ QTest::newRow("ToolButton") << "ToolButton" << QQuickTheme::ToolBar;
+ QTest::newRow("ToolSeparator") << "ToolSeparator" << QQuickTheme::ToolBar;
+ QTest::newRow("ToolTip") << "ToolTip" << QQuickTheme::ToolTip;
+ QTest::newRow("Tumbler") << "Tumbler" << QQuickTheme::Tumbler;
+}
+
+void tst_font::defaultFont()
+{
+ QFETCH(QString, control);
+ QFETCH(QQuickTheme::Scope, scope);
+
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.setData(QString("import QtQuick.Controls; %1 { }").arg(control).toUtf8(), QUrl());
+
+ // The call to setData() above causes QQuickBasicTheme to be set as the current theme,
+ // so we must make sure we only set our theme afterwards.
+ QQuickThemePrivate::instance.reset(new TestFontTheme);
+
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
+
+ QVariant var = object->property("font");
+ QVERIFY(var.isValid());
+
+ QFont expectedFont = QQuickTheme::font(scope);
+ QFont actualFont = var.value<QFont>();
+ QCOMPARE(actualFont, expectedFont);
+}
+
+void tst_font::listView_data()
+{
+ QTest::addColumn<QString>("objectName");
+
+ QTest::newRow("Control") << "control";
+ QTest::newRow("Label") << "label";
+ QTest::newRow("TextArea") << "textarea";
+ QTest::newRow("TextField") << "textfield";
+}
+
+void tst_font::listView()
+{
+ QFETCH(QString, objectName);
+
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("listview.qml"));
+
+ QScopedPointer<QQuickApplicationWindow> window(qobject_cast<QQuickApplicationWindow *>(component.create()));
+ QVERIFY2(!window.isNull(), qPrintable(component.errorString()));
+
+ window->show();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+
+ QQuickItem *listView = window->property("listView").value<QQuickItem *>();
+ QVERIFY(listView);
+
+ QQuickItem *contentItem = listView->property("contentItem").value<QQuickItem *>();
+ QVERIFY(contentItem);
+
+ QVERIFY(QMetaObject::invokeMethod(listView, "forceLayout"));
+
+ QQuickItem *column = contentItem->childItems().value(0);
+ QVERIFY(column);
+
+ QQuickItem *control = column->property(objectName.toUtf8()).value<QQuickItem *>();
+ QVERIFY(control);
+
+ QCOMPARE(control->property("font").value<QFont>().pixelSize(), 55);
+}
+
+QTEST_MAIN(tst_font)
+
+#include "tst_font.moc"