How to set QStyle::RequestSoftwareInputPanel to QStyle::RSIP_OnMouseClick ?
-
wrote on 2 Oct 2012, 21:50 last edited by
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. -
wrote on 11 Jul 2013, 07:15 last edited by
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);
...
}
@ -
wrote on 12 Oct 2016, 12:05 last edited by
Works a treat! :-)
-
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);
...
}
@