Please nominate your Qt Champions for 2021!

Qt and OSG GraphicsWindowQt

  • Hi,

    In my application I have two different GraphicsWindowQT classes. On startup a user can select a mode and the window is loaded. My problem is if a user selects "New.." and changes to the opposite mode.

    Below is the code I've written to swap between the two GraphicsWindowQT classes:

    @QWidget *widget;
    LoadingDialog *loading;
    if(ConstructionObject::getConstructionType() == Ui::BUILDING)
    widget = new BuildingOSGWidget(this, loading);
    widget = new CaveOSGWidget(this, loading);

    delete ui->threeD->layout();
    ui->threeD = widget;


    After this code runs, I get a blank blue screen. I know I can always shut down the application and reopen it, but I was hoping for a more elegant solution. If anyone has any suggestions I would appreciate it.



Log in to reply