Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Solved QtVirtualKeyboard over my widget

    General and Desktop
    2
    3
    1137
    Loading More Posts
    • 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.
    • A
      addebito last edited by

      Hello to everyone,

      I'm trying to understand how to move the QtVirtaulKeyboard or my widget because when the keyboard show up hide my widgets.
      Do you know a way to work around the problem?
      The application is a Qt Widget (C++).

      To enable the Qt virtual keyboard add the "virtualkeyboard" in .pro file.

      QT       += core gui virtualkeyboard
      

      and add the "qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));" line to the main.cpp.

      int main(int argc, char *argv[])
      {
          qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
      
          QApplication a(argc, argv);
          MainWindow w;
          w.show();
          return a.exec();
      }
      

      Run the application and... this is the problem.
      Thank you for any advice.

      ![alt text](60f10a01-4826-42d6-8664-5660bc9487b8-immagine.png image url)

      ![alt text](c0d3036c-1148-4d53-b88b-e1bdd896804e-immagine.png image url)

      Pl45m4 1 Reply Last reply Reply Quote 0
      • Pl45m4
        Pl45m4 @addebito last edited by

        @addebito

        Hi,

        have you seen this (https://stackoverflow.com/questions/57161308/virtual-keyboard-or-onscreen-keyboard-for-qtwidgets-applications)?

        This solution moves your widget upwards until your input field is above the virtual keyboard bounding rect.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        A 1 Reply Last reply Reply Quote 3
        • A
          addebito @Pl45m4 last edited by

          @Pl45m4 WOW!
          This is exactly what I was looking for.
          Thank you very much!

          1 Reply Last reply Reply Quote 1
          • First post
            Last post