[SailfishDevel] RegExpValidator - different behaviour between Emulator and Jolla device
Thomas Amler
armadillo at penguinfriends.org
Wed Jan 21 14:29:51 UTC 2015
That did the trick.
Thank you very much! :-)
Am 21.01.2015 15:11, schrieb Pekka Vuorela:
> 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
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
More information about the Devel
mailing list