diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-08 11:21:11 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-09-08 11:21:11 +0200 |
commit | 2adb0ca74ac2a3f993824ea86e9a3233dcacb9e5 (patch) | |
tree | f7c4d31ac12c436760a872c86d8f8605c0e357e0 /framework/qml | |
parent | 6f4e9230a88bc2262a1093ae9f2507f1160bff54 (diff) | |
download | kube-2adb0ca74ac2a3f993824ea86e9a3233dcacb9e5.tar.gz kube-2adb0ca74ac2a3f993824ea86e9a3233dcacb9e5.zip |
RequiredTextField with some basic validation
Diffstat (limited to 'framework/qml')
-rw-r--r-- | framework/qml/RequiredTextField.qml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/framework/qml/RequiredTextField.qml b/framework/qml/RequiredTextField.qml new file mode 100644 index 00000000..2e3512a4 --- /dev/null +++ b/framework/qml/RequiredTextField.qml | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Michael Bohlender, <bohlender@kolabsys.com> | ||
3 | * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | import QtQuick 2.7 | ||
21 | import org.kube.framework 1.0 as Kube | ||
22 | |||
23 | Kube.TextField { | ||
24 | id: root | ||
25 | validator: RegExpValidator { regExp: /.*\S.*/ } | ||
26 | Rectangle { | ||
27 | anchors.fill: parent | ||
28 | opacity: 0.2 | ||
29 | color: Kube.Colors.warningColor | ||
30 | visible: !root.acceptableInput | ||
31 | } | ||
32 | } | ||