aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/quickcontrols/testbench/controls/Dialog.qml
blob: 1a25fbdfb96852c62cd845035e1879db921678da (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) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

// TODO
QtObject {
    property string customControlName: qsTr("Dialog")

    property var supportedStates: [
        [],
        ["modal"],
        ["dim"]
    ]

    property Component component: Button {
        id: dialogButton
        text: qsTr("Dialog")
        hoverEnabled: true

        onClicked: dialog.open()

        Dialog {
            id: dialog
            x: (window.width - width) / 2
            y: (window.height - height) / 2
            standardButtons: Dialog.Ok | Dialog.Cancel
            parent: window.contentItem
            modal: is("modal")
            dim: is("dim") || is("modal")

            Label {
                text: "Lorem ipsum dolor sit amet, \nconsectetuer adipiscing elit, \n"
                    + "sed diam nonummy nibh euismod tincidunt ut \nlaoreet dolore magna aliquam erat volutpat."
            }
        }
    }
}