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

QQuickWidget doesn't handle reparenting properly (e.g. QDockWidget)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 5.3.0 Beta1
    • 5.3.0
    • Quick: Other
    • None
    • Debian 7, X11
    • fdefb96476847a8fd8b7a074016b6de25f87eb95 (qtdeclarative), 8fdd11465cd17006a108a6f04b2fb1bf8fc5de2f (qtbase)

      This is a subtask of QTBUG-36935.

      Take the attached minimal modification of the qquickwidget example and play around with the dock, detaching, attaching and moving around the qquickwidget. Sometimes it will show, sometimes the window will go completely black or completely white. Sometimes the rectangle will spin and sometimes it won't.

      #include <QQuickWidget>
      #include <QtWidgets>
      
      int main(int argc, char **argv)
      {
          QApplication app(argc, argv);
          QMainWindow *toplevel = new QMainWindow;
      
          QDockWidget *lcdDock = new QDockWidget;
          QLCDNumber *lcd = new QLCDNumber;
          lcd->display(1337);
          lcd->setMinimumSize(250,100);
          lcdDock->setWidget(lcd);
          toplevel->addDockWidget(Qt::BottomDockWidgetArea, lcdDock);
      
          QUrl source("qrc:quickwidget/rotatingsquare.qml");
      
          QDockWidget *quickDock = new QDockWidget;
          QQuickWidget *w = new QQuickWidget;
          w->resize(300,300);
          w->setResizeMode(QQuickWidget::SizeRootObjectToView );
          w->setSource(source);
          quickDock->setWidget(w);
          toplevel->addDockWidget(Qt::BottomDockWidgetArea, quickDock);
      
          toplevel->show();
      
          return app.exec();
      }
      

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

            tvete Paul Olav Tvete
            ulherman Ulf Hermann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes