Changeset View
Changeset View
Standalone View
Standalone View
lookandfeelexplorer/package/contents/ui/FormField.qml
Show All 14 Lines | |||||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.3 | 20 | import QtQuick 2.3 | ||
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 | ||
22 | import QtQuick.Controls 1.2 | 22 | import QtQuick.Controls 1.2 | ||
23 | import org.kde.kirigami 2.0 as Kirigami | 23 | import org.kde.kirigami 2.3 as Kirigami | ||
24 | 24 | | |||
25 | TextField { | 25 | TextField { | ||
26 | id: field | 26 | id: field | ||
27 | property string key | 27 | property string key | ||
28 | property string label | ||||
29 | Kirigami.FormData.label: label | ||||
28 | text: lnfLogic[key] | 30 | text: lnfLogic[key] | ||
29 | Layout.minimumWidth: Kirigami.Units.gridUnit * 15 | 31 | Layout.minimumWidth: Kirigami.Units.gridUnit * 15 | ||
30 | onAccepted: { | 32 | onAccepted: { | ||
31 | lnfLogic.name = text; | 33 | lnfLogic.name = text; | ||
32 | timer.running = false; | 34 | timer.running = false; | ||
33 | } | 35 | } | ||
34 | onTextChanged: timer.restart() | 36 | onTextChanged: timer.restart() | ||
35 | Timer { | 37 | Timer { | ||
36 | id: timer | 38 | id: timer | ||
37 | interval: 1000 | 39 | interval: 1000 | ||
38 | onTriggered: lnfLogic[key] = field.text | 40 | onTriggered: lnfLogic[key] = field.text | ||
39 | } | 41 | } | ||
40 | } | 42 | } |