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-unsubscr...@lists.sailfishos.org
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to