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

[VKB] Switching style at runtime causes keys to go blank

    XMLWordPrintable

Details

    • ab5d93c87 (tqtc/lts-5.15)

    Description

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Controls 2.15
      import QtQuick.VirtualKeyboard 1.2
      import QtQuick.VirtualKeyboard.Settings 2.2
      
      Window {
          id: window
          width: 640
          height: 480
          visible: true
      
          Column {
              Button {
                  text: "Toggle Style"
                  checkable: true
                  onClicked: VirtualKeyboardSettings.styleName = checked ? "retro" : "default"
              }
              TextField { placeholderText: "Type here" }
          }
      
          InputPanel {
              id: inputPanel
              z: 99
              x: 0
              y: window.height
              width: window.width
      
              states: State {
                  name: "visible"
                  when: inputPanel.active
                  PropertyChanges {
                      target: inputPanel
                      y: window.height - inputPanel.height
                  }
              }
          }
      }
      

       

      Steps to reproduce

      1. Run the application above
      2. Click on the TextField to bring up the virtual keyboard
      3. Click "Toggle Style"
      4. Repeat Steps #2 and #3 a few times

       

      Outcomes
      After Step #3, the keys turn blank and never come back (although the graphical style does switch correctly).

       

      Fix
      Qt 6 has already fixed this issue. We only need to change 1 line in BaseKey.qml: https://codereview.qt-project.org/c/qt/qtvirtualkeyboard/+/337986/25/src/virtualkeyboard/content/components/BaseKey.qml

       

      It would be great to backport this to Qt 5.15.

      Attachments

        1. vkb-startup.png
          vkb-startup.png
          17 kB
        2. vkb-toggle-1.png
          vkb-toggle-1.png
          33 kB
        3. vkb-toggle-2.png
          vkb-toggle-2.png
          10 kB
        For Gerrit Dashboard: QTBUG-118758
        # Subject Branch Project Status CR V

        Activity

          People

            jakoivik Jarkko Koivikko
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes