Browse Source

Prevent virtual keyboard from popping up on combo box entry

QGC4.4
Don Gagne 2 years ago committed by Don Gagne
parent
commit
bee8528c2b
  1. 12
      src/QmlControls/ParameterEditorDialog.qml

12
src/QmlControls/ParameterEditorDialog.qml

@ -38,6 +38,7 @@ QGCPopupDialog {
property bool _editingParameter: fact.componentId != 0 property bool _editingParameter: fact.componentId != 0
property bool _allowForceSave: QGroundControl.corePlugin.showAdvancedUI || !_editingParameter property bool _allowForceSave: QGroundControl.corePlugin.showAdvancedUI || !_editingParameter
property bool _allowDefaultReset: fact.defaultValueAvailable && (QGroundControl.corePlugin.showAdvancedUI || !_editingParameter) property bool _allowDefaultReset: fact.defaultValueAvailable && (QGroundControl.corePlugin.showAdvancedUI || !_editingParameter)
property bool _showCombo: fact.enumStrings.length !== 0 && fact.bitmaskStrings.length === 0 && !validate
ParameterEditorController { id: controller; } ParameterEditorController { id: controller; }
@ -114,11 +115,11 @@ QGCPopupDialog {
text: validate ? validateValue : fact.valueString text: validate ? validateValue : fact.valueString
unitsLabel: fact.units unitsLabel: fact.units
showUnits: fact.units != "" showUnits: fact.units != ""
focus: setFocus focus: setFocus && visible
inputMethodHints: (fact.typeIsString || ScreenTools.isiOS) ? inputMethodHints: (fact.typeIsString || ScreenTools.isiOS) ? // iOS numeric keyboard has no done button, we can't use it
Qt.ImhNone : // iOS numeric keyboard has no done button, we can't use it Qt.ImhNone :
Qt.ImhFormattedNumbersOnly // Forces use of virtual numeric keyboard Qt.ImhFormattedNumbersOnly // Forces use of virtual numeric keyboard
visible: fact.enumStrings.length === 0 || validate || manualEntry.checked visible: !_showCombo || validate || manualEntry.checked
} }
QGCComboBox { QGCComboBox {
@ -126,8 +127,7 @@ QGCPopupDialog {
width: _editFieldWidth width: _editFieldWidth
model: fact.enumStrings model: fact.enumStrings
visible: _showCombo visible: _showCombo
focus: setFocus && visible
property bool _showCombo: fact.enumStrings.length !== 0 && fact.bitmaskStrings.length === 0 && !validate
Component.onCompleted: { Component.onCompleted: {
// We can't bind directly to fact.enumIndex since that would add an unknown value // We can't bind directly to fact.enumIndex since that would add an unknown value

Loading…
Cancel
Save