summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/mock-delegates/QtWebEngine/ControlsDelegates/FilePicker.qml
blob: 247088bcba64bc072818bff612e86966ace6ee8a (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 QtQuick
import "../../TestParams"

QtObject {
    property bool selectMultiple: false
    property bool selectExisting: false
    property bool selectFolder: false
    property var nameFilters: []

    signal filesSelected(var fileList)
    signal rejected()

    function open() {
        FilePickerParams.filePickerOpened = true;
        FilePickerParams.nameFilters = nameFilters;
        if (FilePickerParams.selectFiles)
            filesSelected(FilePickerParams.selectedFilesUrl);
        else
            rejected();
    }
}