Nominate our 2022 Qt Champions!

How to set QStyle::RequestSoftwareInputPanel to QStyle::RSIP_OnMouseClick ?

  • Hi all,

    I would like to modify the "QStyle::RequestSoftwareInputPanel" in my application. For my desktop, the default value seems to be fixed to "QStyle::RSIP_OnMouseClickAndAlreadyFocused". I would like to change this state to "QStyle::RSIP_OnMouseClick" value.

    We are able to read the current value with the line : QApplication>styleHint( QStyle::SH_RequestSoftwareInputPanel ) but I don't find any solution to modify it.

    My config : Qt 4.8.0/W7 on desktop.

    Thanks for any suggestion.

  • QProxyStyle solved problem, here is sample code (from
    class MyProxyStyle : public QProxyStyle
    int styleHint(StyleHint hint, const QStyleOption *option = 0,
    const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const
    if (hint == QStyle::SH_RequestSoftwareInputPanel)
    return QStyle::RSIP_OnMouseClick;
    return QProxyStyle::styleHint(hint, option, widget, returnData);

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    a.setStyle(new MyProxyStyle);

  • Works a treat! :-)

  • Hello @Gim6626 ,

    Thank you for your relevant answer, this helped me enormously for the display virtual keyboard (maliit)

    best regards !

Log in to reply