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

Proxied child widgets won't receive events inside QGraphicsWidget(Qt::pop up)

    XMLWordPrintable

Details

    Description

      Here is a small example that reproduce the problem...Create a QGraphicsWidget(0,Qt::Popup) with a proxy inside...The widget inside the proxy doesn't work properly because the QGraphicsWidget seems to grab the mouse. With Qt::Window as the flag it works perfectly. All kind of childs don't receive events properly.

      #include <QtGui>

      class Popup : public QGraphicsWidget
      {
      public:
      Popup() : QGraphicsWidget(0, Qt::Popup) // <--- Qt::Window "works" but loses popup functionality

      { QGraphicsProxyWidget* widget = new QGraphicsProxyWidget(this); widget->setWidget(new QCalendarWidget); }

      void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0)

      { painter->fillRect(option->rect, Qt::yellow); }

      };

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

      QGraphicsScene scene;
      Popup* popup = new Popup;
      popup->setGeometry(0, 0, 320, 200);
      scene.addItem(popup);
      QGraphicsView view(&scene);
      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
            menard Alexis Menard (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes