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

When doing a drag from a QWidget that might go over a top level QQuickWidget it can cause a crash

    XMLWordPrintable

Details

    • Android
    • 2e86b652b789374ed9e0ddb15b0f60dd24b99fe8 (qt/qtbase/5.12)

    Description

      When doing a drag from a QWidget that might go over a top level QQuickWidget it can cause a crash. This is due to QSimpleDrag detecting that the top level window is a QQuickWindow which when handle() is called on returns 0. The line:

      const QPoint pos = nativeGlobalPos - window->handle()->geometry().topLeft();
      

      in QSimpleDrag::move is the issue here. This works on desktop platforms just fine. To reproduce just drag from the bottom widget over to the drop area, it might take a few attempts but it will crash.

      Update: It may be something further than that, comparing to the desktop, it does not matter that QQuickWindow has a 0 handle here, so it has to be because it is using this when it should not be, therefore the code that is getting the window is not correct for Android as opposed to desktop.

      Note that in the example, when comparing to the desktop, the QQuickWidget does not appear right away until something triggers an update so this might be related too.

      Attachments

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

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            andysh Andy Shaw
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes