Newer
Older
import QtQuick 2.3
import QtQuick.Controls 1.2
import QGroundControl.FactSystem 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
text: fact ? fact.valueString : ""
unitsLabel: fact ? fact.units : ""
inputMethodHints: ((fact && fact.typeIsString) || ScreenTools.isiOS) ?
Qt.ImhNone : // iOS numeric keyboard has no done button, we can't use it
Qt.ImhFormattedNumbersOnly // Forces use of virtual numeric keyboard
Gus Grubba
committed
var errorString = fact.validate(text, false /* convertOnly */)
if (errorString === "") {
Gus Grubba
committed
} else {
_validateString = text
mainWindow.showComponentDialog(validationErrorDialogComponent, qsTr("Invalid Value"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
onHelpClicked: mainWindow.showComponentDialog(helpDialogComponent, qsTr("Value Details"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
ParameterEditorDialog {
validate: true
validateValue: _validateString
fact: _textField.fact
}
}
Component {
id: helpDialogComponent
ParameterEditorDialog {
fact: _textField.fact
}
}