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

Crash after deleting a QGraphicsItem containing a QGraphicsProxyWidget which has focus (which embeds a QTableWidget)

    XMLWordPrintable

Details

    Description

      Deleting a QGraphicsItem that contains a QGraphicsProxyWidget having focus seems to cause the application to crash.

      In the example attached, I launch the application with a simple QMainWindow containing a QGraphicsView and a QGraphicsScene.

      In the scene, I have only one top-level item which is a QGraphicsItemGroup.

      This QGraphicsItemGroup item contains a QGraphicsProxyWidget item, which embeds a QTableWidget (a 2x2 table containing "x" strings).

      Using an action in the menu bar of the main window, I delete the  QGraphicsItemGroup item.

      1) if the QGraphicsProxyWidget did not have focus, the deletion happen gracefully and the application does not crash.

      2) if the QGraphicsProxyWidget have focus (e.g. I clicked on it before clicking on the menu action), the application crashes. I am not using QT sources at the moment so I have only a limited amount of debug info, but it seems related with the findFocusChild method of the QGraphicsProxyWidget, which calls isEnabled() on a child that maybe does not exit ?

       

       

       

       

      Attachments

        1. bug_proxyWidget.pro
          1 kB
        2. bug_proxyWidget.pro.user
          23 kB
        3. mainwindow.cpp
          2 kB
        4. mainwindow.h
          0.7 kB
        5. mainwindow.ui
          0.6 kB
        6. main.cpp
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bibr Andreas Aardal Hanssen
            alex85 Alexandre Hucher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes