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

InputPanels defaults z value should be lower than max value for overlays

    XMLWordPrintable

Details

    • All
    • 916bf3025355653e16a4df209d4e08ec385a4f57 (qt/qtvirtualkeyboard/dev)

    Description

      InputPanels defaults z value should be lower than max value, so it is not possible to set a z value for other components which are supposed to be shown over the InputPanel, like bottom bar.
      5000 would be an acceptable value and it should be also documented.

      The problem is here:
      https://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp?h=5.15.2#n224

      void QVirtualKeyboardInputContextPrivate::registerInputPanel(QObject *inputPanel)
      {
          VIRTUALKEYBOARD_DEBUG() << "QVirtualKeyboardInputContextPrivate::registerInputPanel():" << inputPanel;
          Q_ASSERT(!this->inputPanel);
          this->inputPanel = inputPanel;
          if (QQuickItem *item = qobject_cast<QQuickItem *>(inputPanel))
              item->setZ(std::numeric_limits<qreal>::max());
      }
      

      workaround is to set a timer to set the z value:

      InputPanel {
              id: inputPanel
              Timer
              {
                  repeat: false
                  running: true
                  interval: 60
                  onTriggered: inputPanel.z = 99
              }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              karimpinter Karim Pinter (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: