Hello Jojain,
We prefer QtQuick + Qml for UI development over the last few years already. This technology allows implementing a brand look-and-feel in a much simpler and convenient way in comparison to Qt Widgets.
The sample application provided by Open Cascade company seems to be a good point to start if you need a 3D viewer to occupy the whole application window. The code given there can be mostly reused for desktop applications as well as the approach is the same for all platforms. To put the long story short, the principle is that:
- On the C++ level create an instance of QQuickItem class where you are going to initialize AIS and V3d stuff.
- When the beforeSynchronizing() event is triggered, the OCCT view, viewer and context should be initialized.
- The rendering itself must be done inside the handler of beforeRendering() event. The Qt/Qml triggeres this event to let the custom code to be performed before it redraws the UI item. Keep eyes open on the fact that rendering is done in a dedicated thread so be careful with read/write access to the data source - make sure it's thread-safe.
- Register the instance of QQuickItem created at the first step for QmlEngine using the dedicated qmlRegisterType() method.
- Place the instance of just registered class somewhere in the Qml part of your application, for example, inside the ApplicationWindow{}.
In case if the AIS renderer should draw the scene on just a piece of application area - not the whole window - then the Android sample isn't the solution. Here you'll need to utilize another approach and deal with frame buffer rendering.
You might want to experiment a bit with QtQuick and OCCT and put here the more narrow down questions how to overcome one or another problem. Good luck and fun!