Important: Please read the Qt Code of Conduct -

QQuickWidget inside QDockWidget: move not working

  • Re: QQuickWidget inside QDockWidget: resize() not working

    In qt3d's example widgets-scene3d I added following code and add quickWidget as QDockWidget:

        QDockWidget * dockWidget = new QDockWidget;
        mainWindow.addDockWidget ( Qt::RightDockWidgetArea, dockWidget );

    instead of adding to MDI area.
    And after trying to move it (make floating, then move to another DockWidget area) app totally crashes.
    I invented some crutch:

        dockWidget->setFeatures(dockWidget->features() & QDockWidget::DockWidgetFeature::DockWidgetFloatable);

    And after that app not crashes but I can't move the Dock Widget with 3D scene.
    I may add screenshots of crashes (Windows, MinGW, MSVC 2017).

  • I get similar issue from Python.
    It seems it works now using QQuickView instead .
    Try something like this :

    QQuickView * view = new QQuickView("yourfile.qml");
    QWidget * quickWidget = QWidget::createWindowContainer(view);
    mainWindow.addDockWidget ( Qt::RightDockWidgetArea, dockWidget );

Log in to reply