Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set QStyle::RequestSoftwareInputPanel to QStyle::RSIP_OnMouseClick ?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 3.0k Views
  • 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.
  • D Offline
    D Offline
    draimond
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Gim6626
      wrote on last edited by
      #2

      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);
      ...
      }
      @

      M 1 Reply Last reply
      2
      • McLionM Offline
        McLionM Offline
        McLion
        wrote on last edited by
        #3

        Works a treat! :-)

        1 Reply Last reply
        1
        • G Gim6626

          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);
          ...
          }
          @

          M Offline
          M Offline
          mostefa
          wrote on last edited by
          #4

          Hello @Gim6626 ,

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

          best regards !

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved