⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

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
    #include "./MainWindow.h"
    #include <QDockWidget.h>

    MainWindow::MainWindow() {

    dx9Widget = new myDX9Widget();
     QDockWidget *dockWidget = new QDockWidget(tr("Dock Widget"), this);
      dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea |
      addDockWidget(Qt::LeftDockWidgetArea, dockWidget);


    MainWindow::~MainWindow() {
    delete dx9Widget;

    no working


  • Lifetime Qt Champion


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

    Hope it helps

  • Wow, that's really nice.

Log in to reply