How to plug a Ogre (Game Engine) canvas to the QWidget based Widget?



  • Currently, I am encountering a problem, when I start writing a new class
    called myDXWidget, it derives from QWidget and BaseApplication of the OGRE project.
    When I fire myDX9Widget->go() (BaseApplication method), this function merely start the program pipeline.
    Loading in all the resources, cameras etc
    But the problem arises, I found the myDX9Widget->go is actually new'ing a Window
    so that there are 2 windows for my application, one for the game, one for the QT
    How can I make the myDX9Widget runs as a child wndow inside of QT, rather than 2 separate windows?

    I tried
    [code]
    #include "./MainWindow.h"
    #include <QDockWidget.h>

    MainWindow::MainWindow() {

    widget.setupUi(this);
    
    
     
    dx9Widget = new myDX9Widget();
    //dx9Widget->go();
    
     QDockWidget *dockWidget = new QDockWidget(tr("Dock Widget"), this);
      dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea |
                                     Qt::RightDockWidgetArea);
       dockWidget->setWidget(dx9Widget);
      addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
    

    }

    MainWindow::~MainWindow() {
    delete dx9Widget;
    }
    [/code]

    no working

    Thanks
    Jack


  • Lifetime Qt Champion

    Hi,

    Not an Ogre professional but "this":http://www.ogre3d.org/tikiwiki/QtOgre might be interesting

    Hope it helps



  • Wow, that's really nice.
    Thanks
    Jack


Log in to reply
 

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