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

QGraphicsScene's constructor and destructor assume that qApp is a QApplication.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.2.0
    • Fix Version/s: None
    • Component/s: GUI: Workspace
    • Labels:
      None

      Description

      It seems that QGraphicsScene should be usable when the application type isn't QApplication but merely QGuiApplication. The scene is very much useful on its own, if you want to render it on your own, instead of on a view.

      Yet both QGraphicsScenePrivate::init() and QGraphicsScene::~QGraphicsScene() assume that qApp points to an instance of QApplication, and try to access qApp->d_func()->scene_list. A simple fix is to replace this access with:

      if (qobject_cast<QApplication*>(qApp)) qApp->d_func()->scene_list....

      I don't know whether moving QGraphicsScene & friends to the gui module would keep it binary compatible, but presumably that should be the long term goal?

        Attachments

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

          Activity

            People

            Assignee:
            bibr Andreas Aardal Hanssen
            Reporter:
            kuba Kuba Ober
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes