import QtQuick 2.14
import QtQuick.Window 2.14
import QtQuick.Controls 2.12
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Item {
anchors.fill: parent
Column{
spacing: 10
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 20
TextField{
id: text_field
// inputMethodHints: Qt.ImhNoPredictiveText|Qt.ImhSensitiveData | Qt.ImhDigitsOnly
inputMethodHints: Qt.ImhDigitsOnly
inputMask: "+7(###)-###-####"
onTextChanged: {
console.log("text changed")
}
Keys.onPressed: {
console.log("keys presed "+ event.key)
text_event.text= "keys presed "+ event.key
}
onFocusChanged: {
if(focus){
cursorPosition=0
}
}
}
Text {
text: text_field.text
}
Text {
id: text_event
}
}
}
}
inputMask: ">NNNNNN-NNNNNN-NNNNNN-NNNNNN-NNNNNN-NNNNNN;#"
inputMethodHints: Qt.ImhSensitiveData | Qt.ImhPreferUppercase | Qt.ImhNoPredictiveText