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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.2.0
    • GUI: Workspace
    • None

      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?

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes