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

Different shift behavior

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.11, 5.12
    • Fix Version/s: None
    • Component/s: Virtual Keyboard
    • Labels:
      None
    • Platform/s:
      All

      Description

      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;
          engine.load(QUrl(QStringLiteral("./main.qml")));
      
          QQuickWindow *window = qobject_cast<QQuickWindow*>(engine.rootObjects().first());
          window->show();
          
          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.

        Attachments

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

          Activity

            People

            Assignee:
            jakoivik Jarkko Koivikko
            Reporter:
            andy99 A -
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes