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

REG->5.12: Windows: QMdiArea: QQuickView and Qt3DWindow widgets jump around when dragging

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.1, 5.14.0 Alpha
    • 5.12.0 Beta 1
    • Widgets: Main Window
    • None
    • Windows 10; Version 1803
    • Windows
    • 29ea287716175b57aa7b050b70eb3eb5c9049464 (qt/qtbase/5.12.1)

    Description

      Widgets created with QWidget::createWindowContainer and put into a QMdiArea jumps erratically around when dragging them around on top of other similar widgets. This gets worse the more windows that there are in the QMdiArea.

      Steps to reproduce:

      1. Create a QMdiArea and put multiple (8+) QQuickView or Qt3DWindow windows into the mdi area using createWindowContainer  and addSubWindow.
      2. Click the title bar of one of the windows and hold the mouse down.
      3. Start moving the mouse to drag the window around.
      4. Drag the window around on top of other widgets.

      Result: The dragged window jumps around when dragging; if releasing the mouse at an unlucky time the window will appear at a random location or somewhere off screen.

      This is an issue in the 5.12.0 alpha and beta 1. The issue is not present in 5.11.2. 

      I can reproduce it with the following code (both with the Qt3D windows and Qml windows):

      #include <QApplication>
      #include <QMainWindow>
      #include <QMdiArea>
      #include <QMdiSubWindow>
      #include <QQuickView>
      #include <QWidget>
      #include <Qt3DWindow>
      
      void add3DWindow(QMdiArea *mdiArea) {
        auto *window = new Qt3DExtras::Qt3DWindow();
        auto *widget = QWidget::createWindowContainer(window);
        auto *mdiWindow = mdiArea->addSubWindow(widget);
        mdiWindow->resize(500, 500);
      }
      
      void addQmlWindow(QMdiArea *mdiArea) {
        QQuickView *window = new QQuickView();
        auto *widget = QWidget::createWindowContainer(window);
        auto *mdiWindow = mdiArea->addSubWindow(widget);
        mdiWindow->resize(500, 500);
      }
      
      void addMdiArea(QMainWindow *window) {
        auto *mdiArea = new QMdiArea(window);
        window->setCentralWidget(mdiArea);
      
        auto addWindow = [&] { addQmlWindow(mdiArea); };
        addWindow();
        addWindow();
        addWindow();
        addWindow();
        addWindow();
        addWindow();
        addWindow();
        addWindow();
        addWindow();
      }
      
      int main(int argc, char *argv[]) {
        QApplication app(argc, argv);
        QMainWindow window;
        addMdiArea(&window);
        window.showMaximized();
        return app.exec();
      }
      

      And with this build file:

      TARGET = mditest
      TEMPLATE = app
      CONFIG += c++11
      
      QT += \
          core \
          gui  \
          widgets \
          3dextras \
          quick
      
      SOURCES += \
              main.cpp
      

      Attachments

        Issue Links

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

          Activity

            People

              anrocha André De La Rocha (Inactive)
              randominequalities randominequalities
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes