aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols/qquickmenubar/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quickcontrols/qquickmenubar/data')
-rw-r--r--tests/auto/quickcontrols/qquickmenubar/data/checkHighlightWhenDismissed.qml46
-rw-r--r--tests/auto/quickcontrols/qquickmenubar/data/delegateFromSeparateComponent.qml32
-rw-r--r--tests/auto/quickcontrols/qquickmenubar/data/empty.qml7
-rw-r--r--tests/auto/quickcontrols/qquickmenubar/data/menubar.qml66
4 files changed, 151 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols/qquickmenubar/data/checkHighlightWhenDismissed.qml b/tests/auto/quickcontrols/qquickmenubar/data/checkHighlightWhenDismissed.qml
new file mode 100644
index 0000000000..2f8132e2fc
--- /dev/null
+++ b/tests/auto/quickcontrols/qquickmenubar/data/checkHighlightWhenDismissed.qml
@@ -0,0 +1,46 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+ApplicationWindow {
+ width: 300
+ height: 300
+ visible: true
+ MenuBar {
+ id: mb
+ objectName: "menuBar"
+ width: parent.width
+ Menu {
+ title: "StaticMenu"
+ MenuItem {
+ text: "Cut"
+ }
+ MenuItem {
+ text: "Copy"
+ }
+ MenuItem {
+ text: "Paste"
+ }
+ }
+ }
+ Component {
+ id: cmp
+ Menu {
+ title: "DynamicMenu"
+ MenuItem {
+ text: "Cut"
+ }
+ MenuItem {
+ text: "Copy"
+ }
+ MenuItem {
+ text: "Paste"
+ }
+ }
+ }
+ Component.onCompleted: {
+ mb.addMenu(cmp.createObject(mb))
+ }
+}
diff --git a/tests/auto/quickcontrols/qquickmenubar/data/delegateFromSeparateComponent.qml b/tests/auto/quickcontrols/qquickmenubar/data/delegateFromSeparateComponent.qml
new file mode 100644
index 0000000000..ac03210fa0
--- /dev/null
+++ b/tests/auto/quickcontrols/qquickmenubar/data/delegateFromSeparateComponent.qml
@@ -0,0 +1,32 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+ApplicationWindow {
+ width: 800
+ height: 800
+
+ Component {
+ id: menuBarItemComponent
+
+ MenuBarItem {
+ contentItem: Text {
+ text: parent.text
+ color: "blue"
+ }
+ background: Rectangle {
+ color: "#00ff00"
+ }
+ }
+ }
+
+ menuBar: MenuBar {
+ delegate: menuBarItemComponent
+
+ Menu {
+ title: "Menu"
+ }
+ }
+}
diff --git a/tests/auto/quickcontrols/qquickmenubar/data/empty.qml b/tests/auto/quickcontrols/qquickmenubar/data/empty.qml
new file mode 100644
index 0000000000..870c3a0bc4
--- /dev/null
+++ b/tests/auto/quickcontrols/qquickmenubar/data/empty.qml
@@ -0,0 +1,7 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+MenuBar { }
diff --git a/tests/auto/quickcontrols/qquickmenubar/data/menubar.qml b/tests/auto/quickcontrols/qquickmenubar/data/menubar.qml
new file mode 100644
index 0000000000..9edb7606ba
--- /dev/null
+++ b/tests/auto/quickcontrols/qquickmenubar/data/menubar.qml
@@ -0,0 +1,66 @@
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtQuick.Controls
+
+ApplicationWindow {
+ readonly property Button oopsButton: oopsButton
+
+ width: 400
+ height: 400
+ visible: true
+
+ header: MenuBar {
+ MenuBarItem {
+ menu: Menu {
+ title: "&File"
+ MenuItem { text: "&Open..." }
+ MenuItem { text: "&Save" }
+ MenuItem { text: "Save &As..." }
+ MenuSeparator { }
+ MenuItem { text: "&Quit" }
+ }
+ }
+ MenuBarItem {
+ menu: Menu {
+ title: "&Edit"
+ MenuItem { text: "&Cut" }
+ MenuItem { text: "&Copy" }
+ MenuItem { text: "&Paste" }
+ }
+ }
+ MenuBarItem {
+ menu: Menu {
+ title: "&View"
+ Menu {
+ title: "&Alignment"
+ Menu {
+ title: "&Horizontal"
+ MenuItem { text: "&Left" }
+ MenuItem { text: "&Center" }
+ MenuItem { text: "&Right" }
+ }
+ Menu {
+ title: "&Vertical"
+ MenuItem { text: "&Top" }
+ MenuItem { text: "&Center" }
+ MenuItem { text: "&Bottom" }
+ }
+ }
+ }
+ }
+
+ MenuBarItem {
+ menu: Menu {
+ title: "&Help"
+ MenuItem { text: "&About" }
+ }
+ }
+ }
+
+ Button {
+ id: oopsButton
+ text: "&Oops"
+ }
+}