diff options
author | Michal Klocek <michal.klocek@theqtcompany.com> | 2016-07-06 13:55:31 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2016-10-04 11:50:43 +0000 |
commit | 33348994de656361942456834ac0c719ff5d87b8 (patch) | |
tree | be9dd0c863d7a87575183d7484f5fad9cc830e4c /src/webengine/ui/AuthenticationDialog.qml | |
parent | 7f763e5fd0ba5481040d08f97034fec0dac61236 (diff) |
Clean up qt quick controls 1 dialogs
Based on code review for qqc2 integration,
apply cleanup changes to qqc1.
Change-Id: I9752ce944385a529a1d999a5419638868e18d799
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/webengine/ui/AuthenticationDialog.qml')
-rw-r--r-- | src/webengine/ui/AuthenticationDialog.qml | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/webengine/ui/AuthenticationDialog.qml b/src/webengine/ui/AuthenticationDialog.qml index 6a703b7df..a7eedd14d 100644 --- a/src/webengine/ui/AuthenticationDialog.qml +++ b/src/webengine/ui/AuthenticationDialog.qml @@ -44,8 +44,8 @@ import QtQuick.Layouts 1.0 import QtQuick.Window 2.2 Window { - signal accepted(string user, string password); - signal rejected; + signal accepted(string user, string password) + signal rejected property alias text: message.text title: qsTr("Authentication Required") @@ -75,7 +75,7 @@ Window { anchors.margins: 4 property int doubleMargins: anchors.margins * 2 Text { - id: message; + id: message color: palette.windowText } GridLayout { @@ -88,7 +88,10 @@ Window { id: userField focus: true Layout.fillWidth: true - onAccepted: acceptDialog() + onAccepted: { + if (userField.text && passwordField.text) + acceptDialog(); + } } Label { text: qsTr("Password:") @@ -98,7 +101,10 @@ Window { id: passwordField Layout.fillWidth: true echoMode: TextInput.Password - onAccepted: acceptDialog() + onAccepted: { + if (userField.text && passwordField.text) + acceptDialog(); + } } } Item { |