setInputMask("000.000.000.000;_");
To get range control (e.g. for an IP address) use masks together with validators.
QLineEdit *m_ip = ...;m_ip->setInputMask( "000.000.000.000;0" );QRegExp rx( "\\b(([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d?\\d|2[0-4]\\d|25[0-5])\\b" );m_ip->setValidator( new QRegExpValidator( rx, this ) );