Using Ceetron Desktop Components with Qt

Qt (http://qt.io or http://qt-project.org) is the primary toolkit used at Ceetron for creating applications. Ceetron Analyzer and Ceetron 3D Viewer uses Qt. This page describes how to integrate Ceetron Desktop Components with Qt and how to get your application up and running with Qt. The description applies to Qt4, Qt5 and Qt6.

Creating a Viewer

All Ceetron Desktop Components apps needs one (or more) viewers in order to visualize the 3D data. We have example implementations that you can find in the PlatformIntegration/Qt folder of the distribution. We provide both QGLWidget and QOpenGLWidget based viewers. The legacy QtOpenGL module (classes prefixed with QGL) provides QGLWidget. QOpenGLWidget is intended to be a modern replacement for it. Therefore, especially in new applications, the general recommendation is to use QOpenGLWidget. All examples also derive from cee::vis::ViewerUIFramework.

ViewerGLWidget/ViewerOpenGLWidget: ceeqtViewer(Open)GLWidget.h/.cpp
This is a bare bone example with the minimum requirements for showing Ceetron Desktop Components in Qt. There is no support for navigation/picking etc., just the minimum. To create your own Viewer, you should derive from this class.

ViewerGLWidgetDemo/ViewerOpenGLWidgetDemo: ceeqtViewer(Open)GLWidgetDemo.h/.cpp
This is a demo application oriented implementation which adds Ceetron style navigation in addition to what is in ViewerGLWidget. This is the one used in the QtMinimal and QtMultiView examples which you can find in the Examples/Qt folder of the distribution. This is a good starting point for adding Ceetron Desktop Components to your app. The class derives from ViewerGLWidget and might be a good starting point for a Viewer in your application. We recommend copying the source code of this Viewer and modifying it to suit your needs in your application.

Please make sure that the cee::vis::OpenGLContextGroup instance outlives the life of any viewers, i.e. all viewers must be deleted before the context group is deleted.

Utilities

The PlatformIntegration/Qt folder also contains some support classes to help developers in integrating Qt with Ceetron Desktop Components.

The static classes in ceeqtUtilsCore.h and ceeqtUtilsGui.h contain methods for converting Qt types to and from cee types (e.g. QString <-> cee::Str). There are also conversion functions to translate from Qt mouse events to cee::vis::MouseEvent, cee::vis::MouseButton and cee::vis::WheelEvent.

Example programs

To compile and run the example programs, use the .pro file in the example folder. If you are using Qt Creator you can just open this file. If you are using Visual Studio, you need to generate a .vcxproj file using qmake:

qmake -tp vc

On Linux, just do:

qmake 
make

QtMinimal

Location: Examples/Qt/QtMinimal

A very small example showing the basic requirements for a Qt application.

QtMultiView

Location: Examples/Qt/QtMultiView

A small example showing how to do multiple views/windows with Ceetron Desktop Components in Qt.

QtSendToCloud

Location: Examples/Qt/QtSendToCloud

An example showing how to send a VTFx file to Ceetron Cloud (using Qt).

QtReport

Location: Examples/Qt/QtReport

An example showing how to create simple reports from the current model.

QtRepositoryManager

Location: Examples/Qt/QtRepositoryManager

An example which is a simple manager for a repository file. This allows you to open a repository file and view the actual snapshot content. (There is an example repository in the "Examples/ReportTemplates" folder in the distribution.) The QtRepositoryManager example lets you select your own template file (or use one of the predefined found in the Examples/ReportTemplates folder).

QtDemoApp

Location: Examples/Qt/QtDemoApp

A small Post Processor written in Qt to showcase some of the features in the UnstructGrid component.