Skip to content

Add open gl example and fix #717 #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

zyrkiel
Copy link

@zyrkiel zyrkiel commented Mar 20, 2025

Fix issue #717

Add an OpenGL example to check/test how ADS handles widgets that include OpenGL rendering.

In order to fix weird behavior and crashes, some winId() have been added to the code. It forces some widgets/windows to be managed as native widgets instead of aliens (non-native).
Some doc about native and aliens: https://doc.qt.io/qt-6/qwidget.html#native-widgets-vs-alien-widgets

These changes can theoreticaly induced a drop of performances, but I didn'tt noticed them. I have observed a speedup of the UI launch and reaction on both Ubuntu 24.04 and Windows 11.

These changes should not affect how the lib is working under Windows, the demo example has been run under Windows and Ubuntu and all seems to work well.

On Ubuntu, the handling of OpenGL is now working thanks to these modifications.

The OpenGL example has been developped with components from the following Qt examples:

  • hellogl2
  • hellogles3
  • qquickwidgetversuswindow_opengl

The example has been tested on Ubuntu 24.04, Windows 11 with QtCreator and cmake.

Some weird behaviors are still present on Ubuntu (docking a QOpenGLWiidget/QQuickWidget floating window in a QOpenGLWindow/QQuickView container floating window seems to destroy the contained window) but globaly it's working fine.

It has taking quite a while to achieve this result. I hope this will suit you.

Please give it a try.

@zyrkiel zyrkiel force-pushed the Add-OpenGl-example branch from 9870cfd to d57448b Compare March 20, 2025 14:22
@githubuser0xFFFF
Copy link
Owner

Thank you for your pull request. Do you really thing this is necessary to make the widgets to native widgets. In our application we use the OpenGL based Coin3D library without any problems in the ADS docking system (see the Robot visualization on the front page). Also other user seem to use ADS to display 3D content without any problems so I'm not really convinced from this change.

@zyrkiel
Copy link
Author

zyrkiel commented Mar 21, 2025

Yes the fix seems mandatory to use OpenGL on Ubuntu.
You have a very good example of a crash in the issue #717 description. It should also fix #281 you mentioned.
A lot of other undesired behavior happen too.
Please test the 2 first commits of the OpenGL example on Ubuntu (without the fix) to understand what could goes wrong.

If you have better fixes to make OpenGL widgets working on Ubuntu, I would be pleased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants