summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/ConfirmDialog.qml
blob: 6125d0b98624959b5327b85fa6b6a02179337dd2 (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
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQml
import QtTest
import "../../TestParams"

QtObject {
    property string text
    property string title
    signal accepted()
    signal rejected()

    function open() {
        JSDialogParams.dialogTitle = title;
        JSDialogParams.dialogMessage = text;
        JSDialogParams.dialogCount++;
        if (JSDialogParams.shouldAcceptDialog)
            accepted();
        else
            rejected();
    }
}