Qt3DWindow inside WindowContainer crash when deleted



  • Trying to use Qt3D inside a dialog so embedding the Qt3DWindow in a widget and inserting the widget in a layout of the dialog, but the program crash randomly when closing the dialog, this looks similar to this bug:
    https://bugreports.qt.io/browse/QTBUG-53834
    if not what i'm doing wrong?

    DIALOG_TEST::DIALOG_TEST(QWidget *parent):
        QDialog(parent),
        ui(new Ui::DIALOG_TEST)
    {
        ui->setupUi(this);
        Qt3DExtras::Qt3DWindow *view=new Qt3DExtras::Qt3DWindow();
        if(view)
        {
            view->defaultFramegraph()->setClearColor(Qt::black);
            QWidget *container=QWidget::createWindowContainer(view);
            if(container)
            {
                QSize screen_size(view->screen()->size());
    
                container->setMinimumSize(QSize(200,100));
                container->setMaximumSize(screen_size);
                container->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
                ui->layout_area->insertWidget(0,container);
            }
        }
    }
    
    
    DIALOG_TEST::~DIALOG_TEST()
    {
        delete ui;
    }

  • Lifetime Qt Champion

    Hi,

    Before speculating, it would be better to test your code against the latest version of the Qt3D module that includes the fixe mentioned in the bug report. Meaning building Qt3D from sources.



  • Thanks, my doubt was that i missed something but if the code above is correct way of using Qt3D in a dialog than i'll just wait for the next release, can practice with the 3d module anyway.



  • @Keyos I meet the same problem,and when i launch my app,the memory usage become 50% even the dialog is not actived,maybe the next release will be better.



Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.