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 app.style()->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.
    Regards,
    David.



  • QProxyStyle solved problem, here is sample code (from http://harmattan-dev.nokia.com/docs/library/html/qt4/qproxystyle.html)
    @
    class MyProxyStyle : public QProxyStyle
    {
    public:
    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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.