-
Bug
-
Resolution: Done
-
P1: Critical
-
5.9.2, 5.10.0 Beta 4
-
None
-
Compiler: g++ (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
OS: Kubuntu 16.04 amd64
Qt from SDK, versions 5.6.3, 5.7.1, 5.8.0, 5.9.0, 5.9.1, 5.9.2 and 5.10 Beta 4
-
5a10cf060e6c843f05d8bd820a4be4bb08f277ec
TextInput control allows to input text that is not accepted by validator but accepted by inputMask.
main.qml
//// 5.6.3 - works fine
//import QtQuick 2.6
//import Qt.labs.controls 1.0
//// 5.7.1 - works fine
//import QtQuick 2.7
//import QtQuick.Controls 2.0
//// 5.8.0 - works fine
//import QtQuick 2.8
//import QtQuick.Controls 2.1
//// 5.9.0 - works fine
//import QtQuick 2.9
//import QtQuick.Controls 2.2
//// 5.9.1 - works fine
//import QtQuick 2.9
//import QtQuick.Controls 2.2
//// 5.9.2 - validator ignored, able to input "33", "f2", " 9"
//import QtQuick 2.9
//import QtQuick.Controls 2.2
// 5.10 Beta 4 - validator ignored, able to input "33", "f2", " 9"
import QtQuick 2.10
import QtQuick.Controls 2.3
ApplicationWindow {
title: "validator ignored with input mask"
width: 350; height: 90
visible: true
TextInput {
id: input
anchors.fill: parent
horizontalAlignment: TextInput.AlignHCenter; verticalAlignment: TextInput.AlignVCenter
text: "+1"
inputMask: "X9;_"
validator: RegExpValidator { regExp: /[+-][0-9]/ }
}
}

Also tried custom validator inherited from QValidator, same behavior.
| For Gerrit Dashboard: QTBUG-64616 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 212066,2 | Prevent invalid characters being entered at the appropriate times | 5.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |