[SailfishDevel] RegExpValidator - different behaviour between Emulator and Jolla device

Pekka Vuorela pekka.vuorela at jolla.com
Wed Jan 21 14:11:34 UTC 2015


ke, 2015-01-21 kello 15:02 +0100, Thomas Amler kirjoitti:
> Hi,
> 
> I have a problem concerning the RegExpValidator of a TextField. This is 
> the code:
> 
>              TextField {
>                  id: cameraManufacturer
>                  width: parent.width
>                  label: qsTr("Manufacturer")
>                  placeholderText: label
>                  text: editCameraManufacturer
>                  validator: RegExpValidator { regExp: /^.{3,60}$/ }
>                  EnterKey.enabled: errorHighlight === false ? true : 
> false
>                  EnterKey.iconSource: "image://theme/icon-m-enter-next"
>                  EnterKey.onClicked: cameraModel.focus = true
> 
>                  onErrorHighlightChanged: checkContent()
> 
>                  onTextChanged: console.log(errorHighlight + "#" + 
> acceptableInput)
>              }
> 
> The validator works as expected on the Emulator. It reacts on every text 
> change in the field and changes the errorHighlight Status to false if 
> the regExp matches and vice versa. Also the field gets marked red if 
> errorHighlight is true and so on.

Predictive text input doesn't play that nicely with validator. You could
try adding 
inputMethodHints: Qt.ImhNoPredictiveText




More information about the Devel mailing list