QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
FactTextField.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Dialogs
4
5import QGroundControl
6import QGroundControl.Controls
7
8QGCTextField {
9 id: control
10 text: fact ? fact.valueString : ""
11 unitsLabel: fact ? fact.units : ""
12 showUnits: true
13 showHelp: false
14 numericValuesOnly: fact && !fact.typeIsString
15
16 signal updated()
17
18 property Fact fact: null
19
20 onEditingFinished: _onEditingFinished()
21
22 function _onEditingFinished() {
23 var errorString = fact.validate(text, false /* convertOnly */)
24 if (errorString === "") {
25 clearValidationError()
26 fact.value = text
27 control.updated()
28 } else {
29 showValidationError(errorString, fact.valueString)
30 }
31 }
32
33 onHelpClicked: helpDialogFactory.open()
34
35 QGCPopupDialogFactory {
36 id: helpDialogFactory
37
38 dialogComponent: helpDialogComponent
39 }
40
41 Component {
42 id: helpDialogComponent
43
44 ParameterEditorDialog {
45 title: qsTr("Value Details")
46 fact: control.fact
47 }
48 }
49}