summaryrefslogtreecommitdiffstats
path: root/tests/manual/examples/quick/customdialogs/forms/Authentication.qml
blob: 151a7c4aac7031eb75824720da93aeaa2fcb8c5e (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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick
import QtWebEngine

AuthenticationForm {
    property QtObject request
    signal closeForm()

    cancelButton.onClicked: {
        request.dialogReject();
        closeForm();
    }

    loginButton.onClicked: {
        request.dialogReject();
        closeForm();
    }

    Component.onCompleted: {
        switch (request.type) {
        case  AuthenticationDialogRequest.AuthenticationTypeHTTP:
            console.log("HTTP Authentication Required. Host says: " + request.realm);
            break;
        case  AuthenticationDialogRequest.AuthenticationTypeProxy:
            console.log("Proxy Authentication Required for: " + request.proxyHost);
            break;
        }
    }
}