summaryrefslogtreecommitdiff
path: root/share/qtcreator/qmldesigner/assetsLibraryQmlSources/ErrorDialog.qml
blob: 58e1910b1845375f6ac97b22654b943796ae5a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQuick
import QtQuick.Controls
import HelperWidgets as HelperWidgets
import StudioTheme as StudioTheme

Dialog {
    id: root

    required property string message

    anchors.centerIn: parent
    closePolicy: Popup.CloseOnEscape
    implicitWidth: 300
    modal: true

    contentItem: Column {
        spacing: 20
        width: parent.width

        Text {
            text: root.message
            color: StudioTheme.Values.themeTextColor
            wrapMode: Text.WordWrap
            width: root.width
            leftPadding: 10
            rightPadding: 10
        }

        HelperWidgets.Button {
            text: qsTr("Close")
            anchors.right: parent.right
            onClicked: root.reject()
        }
    }

    onOpened: root.forceActiveFocus()
}