This version of MotionBuilder uses Qt 4.7.x, which compared to earlier versions means:
- You no longer need to build the QT source code with Visual Studio. Alternatively, you can download it directly.
- You don’t need to create QT GUI classes manually.
- The way of cooperation of xxx_ui.h and xxx.h has changed. xxx define a (Ui::xxx ui;) and use ui to manage UI code.
Knowledge background:
- Start MotionBuilder, and choose from the Open Reality menu FBQtTest. The Open Reality menu is not present by default; it is
added when MotionBuilder detects the presence of plugins in [MotionBuilder]\bin\[win32|x64]\plugins.
- The Qt callback system uses what they call signals and slots. This system is generated by a precompiler called moc.exe.
- Classes deriving from Qt::QObject requiring signals/slots must have the Q_Object macros in their declaration (see xxx.h).
Each header using the Q_OBJECT macro must have a Custom Build Step operation to ensure the file is correctly parsed by moc.exe.
This generates a "moc file" (moc_xxx.cpp) containing all runtime information (signals/slots, etc.) and it must be included
in your project so that linking works properly.
- You can use Qt Designer or Qt Assistant to generate xxx.ui files (XML files). These must be processed by moc.exe. This operation
generates ui_xxx.h, and this generated file must be included in your project.
- To bridge between Qt UI and ORSDK UI, we have created a control called FBWidgetHolder (see qtsample.h). This must be used
to contain your Qt UI. This control must have a Creator function assigned. The Creator function is called, when needed, to
instantiate a Qt widget.
Resources:
- QT source code built by VS: where you can download QT SDK. And no need to compile QT source code.
- QT home: where you can learn QT.
- QtSample.zip. This is a sample project. To use it, unzip it to …\MB\Opus\OpenRealitySDK\Samples\tools\; change the path in
“Project Property\General\Command” to right path; run Mobu; run the plugin.