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

QGraphicsScene::addWidget() does not respect default window flags

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.6.0
    • 4.5.0
    • Widgets: GraphicsView
    • None
    • c520a4c75d16948417f6c1a3f42508510be0b5f4 90a362519e119ee93dc5cabeb318b4d16da94e82 30c0f2ea782239eb5165cc3f12cabc3da5b9eae0

      Consider the following:

      QLabel *label = new QLabel("foobar");
      QGraphicsScene *scene = new QGraphicsScene;
      scene->addWidget(label, Qt::Window);

      The expected result is that the embedded label is shown with a window frame.

      The actual result is that the embedded label is shown without a window frame.

      QGraphicsScene::addWidget() calls setWidget() on the graphics proxy widget, which overrides any window flags passed to addWidget().

      Workaround: set the window flags on the graphics proxy widget after it has been constructed.

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

            hanssen Andreas Aardal Hanssen (closed Nokia identity) (Inactive)
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes