Skip to main content

History: Integrating Ogre into QT5

Source of version: 7

Copy to clipboard
            __Work in Progress__

Original forum link: http://www.ogre3d.org/forums/viewtopic.php?p=515314#p515314

The following document is an up-to-date method of integrating Ogre3D into the latest version of Qt (5.4 as of this writing).

Previous methods of integrating Ogre3D with Qt focused on [http://www.ogre3d.org/tikiwiki/QtOgre|using a QWidget] and overriding the paint methods for drawing.

The method proposed in this document uses a QWindow as opposed to a QWidget. There are several reasons for using a QWindow over a QWidget:

*__Smaller memory and processing footprint__. Simply put, [http://stackoverflow.com/questions/17860604/what-is-the-difference-between-a-qwindow-and-qwidget|QWidgets use a lot of resources in comparison to QWindows] and thus adds a lot of unnecessary overhead. Ogre3D doesn't require much from Qt besides a surface to draw upon and the input/window events from the underlying OS and windowing system that a QWindow provides. As a related sidenote, QWidget actually inherits from QWindow as shown in the below inheritance chain.
*__Easier integration__. Because of the simplicity of QWindow it is actually much easier to integrate Ogre3D into Qt using a QWindow versus using a QWidget. QWidget by default creates a surface to draw on which Ogre3D doesn't need to draw upon. Thus, as shown in earlier Qt-Ogre3D implementation documents you need to override Qt methods to prevent the default QWidget methods from "drawing over" Ogre3D. Using a QWindow this is unnecessary as with a QWindow no "surface" is automatically created; you can simply supply QWindow's native "Window ID" (whether it is a HWND on Windows or the equivalent representations on Linux/Mac OS) and Ogre3D takes care of the rest.
*
        

History

Information Version
Sun 19 of Apr, 2020 20:52 GMT-0000 paroj 26
Fri 25 of Nov, 2016 14:17 GMT-0000 saftschachtel 25
Thu 12 of Mar, 2015 08:02 GMT-0000 Transporter fix wheelEvent 24
Thu 12 of Mar, 2015 08:02 GMT-0000 Transporter fix wheelEvent 23
Sat 07 of Mar, 2015 16:10 GMT-0000 Transporter Improved version from the forum thread. 22
Tue 03 of Mar, 2015 00:00 GMT-0000 tmason 21
Sun 01 of Mar, 2015 22:17 GMT-0000 spacegaier added TOC and sections 20
Sun 01 of Mar, 2015 21:23 GMT-0000 tmason 19
Sun 01 of Mar, 2015 21:22 GMT-0000 tmason 18
Sun 01 of Mar, 2015 21:10 GMT-0000 tmason 17
Sun 01 of Mar, 2015 21:01 GMT-0000 tmason 16
Sun 01 of Mar, 2015 20:47 GMT-0000 tmason 15
Sun 01 of Mar, 2015 20:30 GMT-0000 tmason 14
Sun 01 of Mar, 2015 20:22 GMT-0000 tmason 13
Sun 01 of Mar, 2015 20:14 GMT-0000 tmason 12
Sun 01 of Mar, 2015 20:11 GMT-0000 tmason 11
Sun 01 of Mar, 2015 19:03 GMT-0000 tmason 10
Sun 01 of Mar, 2015 19:02 GMT-0000 tmason 9
Sun 01 of Mar, 2015 18:44 GMT-0000 tmason 8
Sun 01 of Mar, 2015 18:39 GMT-0000 tmason 7
Sun 01 of Mar, 2015 18:31 GMT-0000 tmason 6
Sun 01 of Mar, 2015 18:15 GMT-0000 tmason 5
Sun 01 of Mar, 2015 18:15 GMT-0000 tmason 4
Sun 01 of Mar, 2015 18:08 GMT-0000 tmason 3
Sun 01 of Mar, 2015 18:07 GMT-0000 tmason 2