Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to get pointer to QQuickWindow with keyboard

How to get pointer to QQuickWindow with keyboard

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 266 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kubikula
    wrote on last edited by
    #1

    Hi,

    I'm using qt widgets on embedded device and using qml virtual keyboard. I .pro file I have

    CONFIG += disable-desktop
    

    I have problem that keyboard is shown as a fullscreen and overlap all my application

    Operation system is yocto. I found some topics and bug reports about this.
    For example here:
    https://bugreports.qt.io/browse/QTBUG-65884

    At article https://stackoverflow.com/questions/61608431/virtual-keyboard-top-black-screen-in-yocto
    is described a hack how to solve this problem. So now I know what I must do, but don't know exactly how to do it.

    My problem is how to find pointer to QQuickWindow wich contains virtual keyboard. I tried use

    QApplication::allWidgets()
    

    but the window isn't here.

    Thank you for your help.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kubikula
      wrote on last edited by
      #2

      Finally I found a solution.

      QGuiApplication::allWindows()
      

      Is the trick. Code like this solved my problem.

       for(QWindow * w: QGuiApplication::allWindows()) {
              if(std::strcmp(w->metaObject()->className(), "QtVirtualKeyboard::InputView") == 0){
                  if(QObject *keyboard = w->findChild<QObject *>("keyboard")){
                      QRect r = w->geometry();
                      r.moveTop(keyboard->property("y").toDouble());
                      w->setMask(r);
                      return;
                  }
             }
        }
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved