diff options
Diffstat (limited to 'tests/auto/quickcontrols/palette/data')
18 files changed, 459 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols/palette/data/bindings.qml b/tests/auto/quickcontrols/palette/data/bindings.qml new file mode 100644 index 0000000000..a584007e54 --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/bindings.qml @@ -0,0 +1,53 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Window +import QtQuick.Controls +import QtQuick.Layouts + +ApplicationWindow { + id: window + objectName: "window" + width: 600 + height: 800 + visible: true + + property alias disabledButton: disabledButton + property alias enabledButton: enabledButton + + palette { + active { + button: "khaki" + buttonText: "bisque" + } + + inactive { + button: "khaki" + buttonText: "bisque" + } + + disabled { + buttonText: "lavender" + button: "coral" + } + } + + ColumnLayout { + Button { + id: disabledButton + text: "Disabled" + enabled: false + + palette.disabled.button: "aqua" + palette.disabled.buttonText: "azure" + } + + Button { + id: enabledButton + text: "Enabled" + + palette: disabledButton.palette + } + } +} diff --git a/tests/auto/quickcontrols/palette/data/inheritance-childcontrol.qml b/tests/auto/quickcontrols/palette/data/inheritance-childcontrol.qml new file mode 100644 index 0000000000..f476020517 --- /dev/null +++ b/tests/auto/quickcontrols/palette/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/palette/data/inheritance-childpopup.qml b/tests/auto/quickcontrols/palette/data/inheritance-childpopup.qml new file mode 100644 index 0000000000..8b7a033bd7 --- /dev/null +++ b/tests/auto/quickcontrols/palette/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/palette/data/inheritance-control.qml b/tests/auto/quickcontrols/palette/data/inheritance-control.qml new file mode 100644 index 0000000000..2cd5c125f4 --- /dev/null +++ b/tests/auto/quickcontrols/palette/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/palette/data/inheritance-dynamicchildcontrol.qml b/tests/auto/quickcontrols/palette/data/inheritance-dynamicchildcontrol.qml new file mode 100644 index 0000000000..18305058bc --- /dev/null +++ b/tests/auto/quickcontrols/palette/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/palette/data/inheritance-dynamicchildpopup.qml b/tests/auto/quickcontrols/palette/data/inheritance-dynamicchildpopup.qml new file mode 100644 index 0000000000..6b16f1a46b --- /dev/null +++ b/tests/auto/quickcontrols/palette/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/palette/data/inheritance-dynamiccontrol.qml b/tests/auto/quickcontrols/palette/data/inheritance-dynamiccontrol.qml new file mode 100644 index 0000000000..df0e13bf2c --- /dev/null +++ b/tests/auto/quickcontrols/palette/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/palette/data/inheritance-dynamicpopup.qml b/tests/auto/quickcontrols/palette/data/inheritance-dynamicpopup.qml new file mode 100644 index 0000000000..76b7d7cbda --- /dev/null +++ b/tests/auto/quickcontrols/palette/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/palette/data/inheritance-popup.qml b/tests/auto/quickcontrols/palette/data/inheritance-popup.qml new file mode 100644 index 0000000000..a5010f0f11 --- /dev/null +++ b/tests/auto/quickcontrols/palette/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/palette/data/listview.qml b/tests/auto/quickcontrols/palette/data/listview.qml new file mode 100644 index 0000000000..92816fde19 --- /dev/null +++ b/tests/auto/quickcontrols/palette/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 + + palette.highlight: "red" + + 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/palette/data/palette-appwindow-custom.qml b/tests/auto/quickcontrols/palette/data/palette-appwindow-custom.qml new file mode 100644 index 0000000000..22876b90fa --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/palette-appwindow-custom.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 { + palette.alternateBase: "aqua" + palette.base: "azure" + palette.brightText: "beige" + palette.button: "bisque" + palette.buttonText: "chocolate" + palette.dark: "coral" + palette.highlight: "crimson" + palette.highlightedText: "fuchsia" + palette.light: "gold" + palette.link: "indigo" + palette.linkVisited: "ivory" + palette.mid: "khaki" + palette.midlight: "lavender" + palette.shadow: "linen" + palette.text: "moccasin" + palette.toolTipBase: "navy" + palette.toolTipText: "orchid" + palette.window: "plum" + palette.windowText: "salmon" + palette.placeholderText: "magenta" +} diff --git a/tests/auto/quickcontrols/palette/data/palette-appwindow-default.qml b/tests/auto/quickcontrols/palette/data/palette-appwindow-default.qml new file mode 100644 index 0000000000..f9c767b876 --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/palette-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/palette/data/palette-control-custom.qml b/tests/auto/quickcontrols/palette/data/palette-control-custom.qml new file mode 100644 index 0000000000..4c4206cdfd --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/palette-control-custom.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 + +Control { + palette.alternateBase: "aqua" + palette.base: "azure" + palette.brightText: "beige" + palette.button: "bisque" + palette.buttonText: "chocolate" + palette.dark: "coral" + palette.highlight: "crimson" + palette.highlightedText: "fuchsia" + palette.light: "gold" + palette.link: "indigo" + palette.linkVisited: "ivory" + palette.mid: "khaki" + palette.midlight: "lavender" + palette.shadow: "linen" + palette.text: "moccasin" + palette.toolTipBase: "navy" + palette.toolTipText: "orchid" + palette.window: "plum" + palette.windowText: "salmon" + palette.placeholderText: "magenta" +} diff --git a/tests/auto/quickcontrols/palette/data/palette-control-default.qml b/tests/auto/quickcontrols/palette/data/palette-control-default.qml new file mode 100644 index 0000000000..7cd58e12b3 --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/palette-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/palette/data/palette-popup-custom.qml b/tests/auto/quickcontrols/palette/data/palette-popup-custom.qml new file mode 100644 index 0000000000..c534d30156 --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/palette-popup-custom.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 + +Popup { + palette.alternateBase: "aqua" + palette.base: "azure" + palette.brightText: "beige" + palette.button: "bisque" + palette.buttonText: "chocolate" + palette.dark: "coral" + palette.highlight: "crimson" + palette.highlightedText: "fuchsia" + palette.light: "gold" + palette.link: "indigo" + palette.linkVisited: "ivory" + palette.mid: "khaki" + palette.midlight: "lavender" + palette.shadow: "linen" + palette.text: "moccasin" + palette.toolTipBase: "navy" + palette.toolTipText: "orchid" + palette.window: "plum" + palette.windowText: "salmon" + palette.placeholderText: "magenta" +} diff --git a/tests/auto/quickcontrols/palette/data/palette-popup-default.qml b/tests/auto/quickcontrols/palette/data/palette-popup-default.qml new file mode 100644 index 0000000000..b9db73c9fb --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/palette-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/palette/data/resolve.qml b/tests/auto/quickcontrols/palette/data/resolve.qml new file mode 100644 index 0000000000..78cf091848 --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/resolve.qml @@ -0,0 +1,21 @@ +// Copyright (C) 2022 zccrs <zccrs@live.com>, JiDe Zhang <zhangjide@uniontech.com>. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls + +ApplicationWindow { + id: window + property alias control: control + + palette {window: "blue"; windowText: "white"} + + Control { + id: control + } + + function changeColors(color) { + control.palette.window = color + window.palette.windowText = color + } +} diff --git a/tests/auto/quickcontrols/palette/data/set-palette.qml b/tests/auto/quickcontrols/palette/data/set-palette.qml new file mode 100644 index 0000000000..b987a7d6b1 --- /dev/null +++ b/tests/auto/quickcontrols/palette/data/set-palette.qml @@ -0,0 +1,19 @@ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Controls + +Control { + palette { + active { + buttonText: "azure" + button: "khaki" + } + + disabled { + buttonText: "lavender" + button: "coral" + } + } +} |