diff options
Diffstat (limited to 'tests/auto/quickcontrols/font/data')
16 files changed, 377 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols/font/data/font-appwindow-custom.qml b/tests/auto/quickcontrols/font/data/font-appwindow-custom.qml new file mode 100644 index 0000000000..fa621ae6a0 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/font-appwindow-custom.qml @@ -0,0 +1,15 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/font-appwindow-default.qml b/tests/auto/quickcontrols/font/data/font-appwindow-default.qml new file mode 100644 index 0000000000..f9c767b876 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/font-appwindow-default.qml @@ -0,0 +1,8 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls + +ApplicationWindow { +} diff --git a/tests/auto/quickcontrols/font/data/font-control-custom.qml b/tests/auto/quickcontrols/font/data/font-control-custom.qml new file mode 100644 index 0000000000..c7ee583d04 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/font-control-custom.qml @@ -0,0 +1,15 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/font-control-default.qml b/tests/auto/quickcontrols/font/data/font-control-default.qml new file mode 100644 index 0000000000..7cd58e12b3 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/font-control-default.qml @@ -0,0 +1,8 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls + +Control { +} diff --git a/tests/auto/quickcontrols/font/data/font-popup-custom.qml b/tests/auto/quickcontrols/font/data/font-popup-custom.qml new file mode 100644 index 0000000000..fcf942e3a5 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/font-popup-custom.qml @@ -0,0 +1,15 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/font-popup-default.qml b/tests/auto/quickcontrols/font/data/font-popup-default.qml new file mode 100644 index 0000000000..b9db73c9fb --- /dev/null +++ b/tests/auto/quickcontrols/font/data/font-popup-default.qml @@ -0,0 +1,8 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls + +Popup { +} diff --git a/tests/auto/quickcontrols/font/data/inheritance-childcontrol.qml b/tests/auto/quickcontrols/font/data/inheritance-childcontrol.qml new file mode 100644 index 0000000000..f476020517 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/inheritance-childcontrol.qml @@ -0,0 +1,29 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/inheritance-childpopup.qml b/tests/auto/quickcontrols/font/data/inheritance-childpopup.qml new file mode 100644 index 0000000000..8b7a033bd7 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/inheritance-childpopup.qml @@ -0,0 +1,29 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/inheritance-control.qml b/tests/auto/quickcontrols/font/data/inheritance-control.qml new file mode 100644 index 0000000000..2cd5c125f4 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/inheritance-control.qml @@ -0,0 +1,27 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/inheritance-dynamicchildcontrol.qml b/tests/auto/quickcontrols/font/data/inheritance-dynamicchildcontrol.qml new file mode 100644 index 0000000000..18305058bc --- /dev/null +++ b/tests/auto/quickcontrols/font/data/inheritance-dynamicchildcontrol.qml @@ -0,0 +1,28 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/inheritance-dynamicchildpopup.qml b/tests/auto/quickcontrols/font/data/inheritance-dynamicchildpopup.qml new file mode 100644 index 0000000000..6b16f1a46b --- /dev/null +++ b/tests/auto/quickcontrols/font/data/inheritance-dynamicchildpopup.qml @@ -0,0 +1,33 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/inheritance-dynamiccontrol.qml b/tests/auto/quickcontrols/font/data/inheritance-dynamiccontrol.qml new file mode 100644 index 0000000000..df0e13bf2c --- /dev/null +++ b/tests/auto/quickcontrols/font/data/inheritance-dynamiccontrol.qml @@ -0,0 +1,24 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/inheritance-dynamicpopup.qml b/tests/auto/quickcontrols/font/data/inheritance-dynamicpopup.qml new file mode 100644 index 0000000000..76b7d7cbda --- /dev/null +++ b/tests/auto/quickcontrols/font/data/inheritance-dynamicpopup.qml @@ -0,0 +1,29 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/inheritance-popup.qml b/tests/auto/quickcontrols/font/data/inheritance-popup.qml new file mode 100644 index 0000000000..a5010f0f11 --- /dev/null +++ b/tests/auto/quickcontrols/font/data/inheritance-popup.qml @@ -0,0 +1,27 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/listview.qml b/tests/auto/quickcontrols/font/data/listview.qml new file mode 100644 index 0000000000..aa07a337cf --- /dev/null +++ b/tests/auto/quickcontrols/font/data/listview.qml @@ -0,0 +1,32 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +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/quickcontrols/font/data/resolve.qml b/tests/auto/quickcontrols/font/data/resolve.qml new file mode 100644 index 0000000000..00e5c767bb --- /dev/null +++ b/tests/auto/quickcontrols/font/data/resolve.qml @@ -0,0 +1,50 @@ +// Copyright (C) 2022 yeshanshan <yeshanshan@uniontech.com>. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls + +ApplicationWindow { + id: window + property alias control1: control1 + property alias control2: control2 + property alias control2ChildControl: control3 + property alias control4: control4 + + font {family: "Helvetica"; pointSize: 10; weight: 10} + + Control { + id: control1 + } + + function changeFont1(font) { + control1.font.pointSize = font.pointSize + window.font.weight = font.weight + } + + Control { + id: control2 + + Control { + id: control3 + // The font's resolve mask of control4 should be is 0, the + // controls3's font is same thing. because control3's font + // resolve mask is 0 also, so the font's all value equal to + // the parent font values. + font: control4.font + } + } + + Control { + font.pointSize: 10 + + Control { + id: control4 + } + } + + function changeFont2(font) { + control2.font.pointSize = font.pointSize + control2.font.weight = font.weight + } +} |