Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-92537

Different shift behavior



    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11, 5.12
    • Virtual Keyboard
    • None
    • All


      Hello everyone,

      I've founded a different shift behavior on Textinput fields based on echo mode like basic text, passwords and search.

      When shift is pressed on normal textboxes, it's just activated one time. After double-click it goes into caps-lock. This is expected behavior.

      On the password fields (search) it goes imidiatelly into caps-lock after activation. There is no option to be active only one time, like on the general textboxes.

      I would like to have the same behaviour on the all controllers.

      Testing scenario

      // main.cpp
      #include <QtGui/QGuiApplication>
      #include <QtCore/QCoreApplication>
      #include <QtQml/QQmlApplicationEngine>
      #include <QtQuick/QQuickWindow>
      int main(int argc, char **argv) {
          qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
          QGuiApplication app(argc, argv);
          QQmlApplicationEngine engine;
          QQuickWindow *window = qobject_cast<QQuickWindow*>(engine.rootObjects().first());
          return app.exec();
      // main.qml
      import QtQuick 2.0
      import QtQuick.Controls 2.3
      import QtQuick.VirtualKeyboard 2.1
      import QtQuick.Window 2.0
      Window {
          id: window
          width: 800
          height: 480
          color: "#F6F6F6"
          MouseArea  {
              id: content
              width: window.width
              Column {
                  id: textEditors
                  spacing: 15
                  x: 12
                  y: 12
                  width: parent.width - 26
                  Label {
                      color: "#565758"
                      text: "Tap fields to enter text"
                      anchors.horizontalCenter: parent.horizontalCenter
                  TextField {
                      width: parent.width
                      placeholderText: "One line field"
                      onTextChanged: {
                          console.log("shift:" + InputContext.shift + " caps:" + InputContext.capsLock)
                  TextField {
                      id: passwordField
                      width: parent.width
                      echoMode: TextField.PasswordEchoOnEdit
                      placeholderText: "Password field"
                      inputMethodHints: Qt.ImhAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
                      onTextChanged: {
                          console.log("shift:" + InputContext.shift + " caps:" + InputContext.capsLock)
                          // very dirty fix
                          // InputContext.capsLock = false
          InputPanel {
              id: inputPanel
              z: 2
              y: window.height
              width: window.width
              states: State {
                  name: "visible"
                  when: inputPanel.active
                  PropertyChanges {
                      target: inputPanel
                      y: window.height - inputPanel.height
              transitions: Transition {
                  from: ""
                  to: "visible"
                  reversible: true
                  ParallelAnimation {
                      NumberAnimation {
                          properties: "y"
                          duration: 250
                          easing.type: Easing.InOutQuad

       Console outputs

      Basic textbox

      none-active shift: shift:false caps:false
      active shift: shift:true caps:false
      active caps: shift:true caps:true // shouldn't be active only caps?

      password textbox

      none-active shift: shift:false caps:false
      active shift: shift:true caps:true // not possible to activate only one time shift
      active caps: shift:true caps:true

      So where is specified the shift behavior for each controller type?

      Looks like, that is little bit buggy.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            jakoivik Jarkko Koivikko
            andy99 A -
            0 Vote for this issue
            1 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes