Results 1 to 1 of 1

Thread: Qt/OSG GrahpicsWindowQt

  1. #1
    Join Date
    Jun 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt/OSG GrahpicsWindowQt

    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:

    Qt Code:
    1. QWidget *widget;
    2. LoadingDialog *loading;
    3. if(ConstructionObject::getConstructionType() == Ui::BUILDING)
    4. widget = new BuildingOSGWidget(this, loading);
    5. else
    6. widget = new CaveOSGWidget(this, loading);
    7.  
    8. if(windowAlreadyCreated)
    9. {
    10. delete ui->threeD->layout();
    11. ui->threeD = widget;
    12. }
    13.  
    14. ui->threeD->setLayout(widget->layout());
    15. ui->threeD->update();
    To copy to clipboard, switch view to plain text mode 

    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.

    Thanks!

    Braden


    Side Node: When I say GraphicsWindowQT I'm referring to the OpenSceneGraph class.
    Last edited by bradenedmunds; 20th June 2012 at 18:08.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.