summaryrefslogtreecommitdiffstats
path: root/examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml')
-rw-r--r--examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml70
1 files changed, 70 insertions, 0 deletions
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml b/examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml
new file mode 100644
index 000000000..f06079a35
--- /dev/null
+++ b/examples/multimedia/video/qmlvideo/qmlvideo/ErrorDialog.qml
@@ -0,0 +1,70 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+
+Rectangle {
+ id: root
+ color: "transparent"
+ opacity: 0.0
+ property alias enabled: mouseArea.enabled
+ property int dialogWidth: 300
+ property int dialogHeight: 200
+ state: enabled ? "on" : "baseState"
+
+ states: [
+ State {
+ name: "on"
+ PropertyChanges {
+ root.opacity: 1.0
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ properties: "opacity"
+ easing.type: Easing.OutQuart
+ duration: 500
+ }
+ }
+ ]
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"
+ opacity: 0.75
+ }
+
+ Rectangle {
+ anchors.centerIn: parent
+ width: root.dialogWidth
+ height: root.dialogHeight
+ radius: 5
+ color: "white"
+
+ Text {
+ id: text
+ anchors.fill: parent
+ anchors.margins: 10
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "black"
+ wrapMode: Text.WordWrap
+ }
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: root.enabled = false
+ }
+
+ function show(msg) {
+ text.text = "<b>Error</b><br><br>" + msg
+ root.enabled = true
+ }
+}