aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/platform/data/tst_systemtrayicon.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-11-03 18:26:22 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-11-06 14:26:29 +0000
commitf0f66c1aa001c630a6b246e312bef7f8e83958d2 (patch)
tree388cd87156d06120ee2bdef444213a3c49b165ce /tests/auto/platform/data/tst_systemtrayicon.qml
parent430fe83ecb7106118cbebd735637aee9e9253914 (diff)
Qt.labs.platform: declare and register enums to the meta system
To make them correctly available in QML so that they also work as signal arguments. Task-number: QTBUG-64259 Change-Id: I5fa00871f96357d924661c4b8af323a0f1748c9d Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'tests/auto/platform/data/tst_systemtrayicon.qml')
-rw-r--r--tests/auto/platform/data/tst_systemtrayicon.qml32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/platform/data/tst_systemtrayicon.qml b/tests/auto/platform/data/tst_systemtrayicon.qml
index 62e231c0..ea6f731a 100644
--- a/tests/auto/platform/data/tst_systemtrayicon.qml
+++ b/tests/auto/platform/data/tst_systemtrayicon.qml
@@ -97,4 +97,36 @@ TestCase {
spy.clear()
icon.destroy()
}
+
+ function test_messageIcon() {
+ // Q_ENUMS(QPlatformSystemTrayIcon::ActivationReason)
+ compare(SystemTrayIcon.NoIcon, 0)
+ compare(SystemTrayIcon.Information, 1)
+ compare(SystemTrayIcon.Warning, 2)
+ compare(SystemTrayIcon.Critical, 3)
+ }
+
+ function test_activationReason() {
+ // Q_ENUMS(QPlatformSystemTrayIcon::ActivationReason)
+ compare(SystemTrayIcon.Unknown, 0)
+ compare(SystemTrayIcon.Context, 1)
+ compare(SystemTrayIcon.DoubleClick, 2)
+ compare(SystemTrayIcon.Trigger, 3)
+ compare(SystemTrayIcon.MiddleClick, 4)
+ }
+
+ function test_activated() {
+ var icon = systemTrayIcon.createObject(testCase)
+ verify(icon)
+
+ spy.target = icon
+ spy.signalName = "activated"
+
+ icon.activated(SystemTrayIcon.Trigger)
+ compare(spy.count, 1)
+ compare(spy.signalArguments[0][0], SystemTrayIcon.Trigger)
+
+ spy.clear()
+ icon.destroy()
+ }
}