# HOOPS Envision for Desktop with Qt

Qt (https://qt.io or https://qt-project.org) is the primary toolkit used at HOOPS Envision for creating applications. HOOPS Envision Analyzer and HOOPS Envision VTFx Viewer uses Qt. This page describes how to integrate HOOPS Envision for Desktop 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 HOOPS Envision apps need 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 HOOPS Envision 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 Envision 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 HOOPS Envision for Desktop 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 HOOPS Envision for Desktop.

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 HOOPS Envision 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.

QtDemoApp

| Location: Examples/Qt/QtDemoApp A small Post Processor written in Qt to showcase some of the features in the UnstructGrid component.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...