Qt World Summit: Submit your Presentation

When in a QWidget and Input Widget ?

  • I have an application that uses a QWizard and a virtual keyboard.

    The QWizard has a series of QWizardPage derived classes for pages, in each case the form has a QWidget as its top item.

    For some pages, making the form visible causes the virtual keyboard to appear, but not in others.

    So my question would be, why ? When looking up inputMethodHints, it comments how this applies to input widgets. I am assuming that being an "input widget" is why the virtual keyboard is deciding to show up, but I cannot see any property difference between that QWidget based pages where the keyboard shows, and the QWidget based pages where the keyboard does not show.

    I am hoping someone has an idea so I can fix this is a more proper manner.

    Dale Pennington

  • Lifetime Qt Champion


    What are the difference between these pages ?
    Which type of widgets do you have on them ?

  • An example of a non-keyboard page is relatively simple, it just has a collection of labels and buttons.

    An example of a keyboard generating page is more complex.

    1. Several buttons
    2. A widget with a label and some buttons
    3. Another widget (replicated several times) with buttons, labels, and a list widget
    4. A widget with labels buttons and a list widget.

    Neither screen has any text input fields.

    Oddly enough on the QT4 version of these, while we have a QInputContext based virtual keyboard for some text edit fields we have, we do not get keyboard on these pages.


  • Lifetime Qt Champion

    I am wondering whether it's to allow changing the focus with the tab button of the keyboard.

  • That might be possible, as we are basically on the default settings on the Widets.

    But in both cases, the top widget is set No Focus, but the Buttons within are set to Strong Focus.

  • Lifetime Qt Champion

    Strong focus might be the key here. Try without it just to check.

  • I adjusted all the widgets in the window from Strong Focus to Click Focus. That had no effect.

    I should also note that the window that does not generate a virtual keyboard has Strong Focus settings on its buttons as well.

  • Lifetime Qt Champion

    Which version of Qt are you using ?
    Can you provide a minimal compilable example that shows this behaviour ?

  • I am using QT 5.12.5. I doubt I can provide a good example as this is in a complicated app and without a clue as to why distilling down to an distributable example would be difficult, unforunately.

  • Lifetime Qt Champion

    In that case the other possibility is to replace your existing widget with an empty one and rebuild the interface on widget after the other see where it starts acting up.

Log in to reply