PDA

View Full Version : Need qml component to get ip address from user



mut
5th October 2016, 18:16
Hello

The user of my qml app needs to enter an ip address;

I'm looking for a qml editbox (or text input,...) with
the dot already included and ip address validation.

Any ideas?

Thanks

Mut.

anda_skoa
6th October 2016, 16:45
You could use a TextInput or TextField with a RegExpValidator to restrict the general pattern, and then valdiate the values inside the pattern.

Cheers,
_

mut
6th October 2016, 18:01
Thanks for the reply.
Could you be more precise. Any example code that you know?

anda_skoa
7th October 2016, 10:34
There is an example for using an IntValidator right there in the documentation of TextInput's validator property.

A Google query for "qml textinput validator" returns this (http://developer.ubuntu.com/api/qml/sdk-14.10/QtQuick.qtquick-input-textinput/) as its first hit.

Cheers,
_