How to Make QVTKOpenGLNativeWidget Background Transparent in Qt?
-
Hi everyone,
I'm currently working on a project in a Windows 11 environment using Visual Studio 2019, Qt 6.6.3, and VTK 9.1.0. I'm trying to make the background of a QVTKOpenGLNativeWidget transparent, but I'm having some trouble.
After checking the source code of QVTKOpenGLNativeWidget, I noticed that it inherits from QOpenGLWidget. I tried to set the parent window attribute using setAttribute(Qt::WA_TranslucentBackground), hoping it would make the background of QVTKOpenGLNativeWidget transparent. Unfortunately, this method didn't work for QVTKOpenGLNativeWidget, even though it works perfectly fine for QOpenGLWidget.
Has anyone encountered this issue before or knows a workaround to achieve a transparent background with QVTKOpenGLNativeWidget? Any advice or suggestions would be greatly appreciated!
Thanks in advance for your help!