Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-5072

Qt::AA_NativeWindows flag prevents GraphicsProxyWidget from receiving enter/leave & friends

    XMLWordPrintable

Details

    Description

      Customer ID: 40776

      Hello Team

      I'm developing an advanced and high intuitive mobile medical application.
      The target system is Windows with mobility sdk installed.
      The application is mainly operated by pen.

      Because it is required to disable context menues that appear on right mouse
      button click (long pen press), I need access to the window handle of all
      widgets (for setting some specific property on it).

      As a result, I have to run my application with Qt::AA_NativeWindows flag.

      Now I found out, that using this flag prevents QGraphicsProxyWidget event
      forwarding thus subwidgets do not receive enter and leave events - cursor
      state and alike do no more work.

      I have attached some sample code that shows this behavior.
      Start with param -style=plastique to see effect on mouseOver events.

      I urgently need a fix for this problem as I found no workaround up to now.

      Thanx for your help
      Frank

      #include <QApplication>
      #include <QtGui>
      #include <QGraphicsGridLayout>

      class MyTest : public QFrame {
      Q_OBJECT;
      public:
      MyTest () : QFrame ()

      { setMinimumSize (300, 100); setMaximumSize (300, 100); QHBoxLayout * l = new QHBoxLayout (this); b = new QPushButton ("Test", this); connect (b, SIGNAL (clicked ()), this, SLOT (slot_clicked ())); te = new QTextEdit (this); l->addWidget (b); l->addWidget (te); }

      virtual ~MyTest () {}

      private slots:
      void slot_clicked ()

      { te->viewport ()->setCursor (Qt::CrossCursor); }

      private:
      QTextEdit * te;
      QPushButton * b;
      };

      #include "main.moc"

      int main (int argc, char** argv)
      {
      QApplication app (argc,argv);

      // comment following line to see bug!!!
      QCoreApplication::setAttribute (Qt::AA_NativeWindows);

      QGraphicsScene scene;
      QGraphicsView view (&scene);

      MyTest * mt = new MyTest ();
      QGraphicsProxyWidget * gpw = scene.addWidget (mt);
      gpw->setPos (0, 0);

      QPushButton * pb = new QPushButton ("ATest");
      gpw = scene.addWidget (pb);
      gpw->setPos (100, 100);

      view.show ();

      return app.exec ();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            frankhem Frank Hemer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes