summaryrefslogtreecommitdiffstats
path: root/examples/scxml/mediaplayer/thedatamodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/scxml/mediaplayer/thedatamodel.cpp')
-rw-r--r--examples/scxml/mediaplayer/thedatamodel.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/scxml/mediaplayer/thedatamodel.cpp b/examples/scxml/mediaplayer/thedatamodel.cpp
new file mode 100644
index 0000000..641d31d
--- /dev/null
+++ b/examples/scxml/mediaplayer/thedatamodel.cpp
@@ -0,0 +1,17 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#include "thedatamodel.h"
+
+#include <QScxmlEvent>
+
+bool TheDataModel::isValidMedia() const
+{
+ QString eventMedia = eventData().value(QStringLiteral("media")).toString();
+ return eventMedia.size() > 0;
+}
+
+QVariantMap TheDataModel::eventData() const
+{
+ return scxmlEvent().data().value<QVariantMap>();
+}