Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946
OpenGLWidget in QDockWidget stays black while floating
I have a class derived from QOpenGLWidget. When I put it on the mainwindow or in a QDialog it works as intend.
However when I add the same widget to a QDockWidget it stays black, but only when its floating. As long as it is docked it also works.
I've also tried to subclass QDockWidget and add
QSurfaceFormat fmt; QSurfaceFormat::setDefaultFormat(fmt);
To the constructor, but that does not help.
Any ideas how to solve this?
(I'm using Qt5.15 on Debian)
Dariusz last edited by
+1 from me too. Had that problem since start. Docket widgets with OpenGL works, but floating are just black.
Please provide a minimal compilable example that shows the behaviour.
gde23 last edited by gde23
However in the example the OpenGL widget is getting gray not black when undocked, so it differs a bit from the other project.
I still hope it can show the problem.
EDIT: also what I noticed. When I directly set it flaoting in the constructor its fine as well. So its not the floating, but the docking/undocking that kills it.
Can anybody confirm this is a bug?
Then I'll submit it to the bug tracker.
Sorry missed your post.
Download it and it ran fine
as soon as i drag the caption
Win 10, Qt 5.15.1, visual stud. compiler 2019
@mrjj Thanks a lot for checking.
I'll submit it to the bug tracker then.
Also I just found a work around how it can be fixed.
Will solve the problem. I though haven't tested out if this will lead to other problems yet.
Np, when providing a full project that i can just run :) any time then.
Ah that kinda makes sense when you show it :)
So when in Mainwindow they are part of the same context but when in a window (floating)
they need to share the context. ( or something like that )
I dont think you will get any issues with it as it seems to be made for such case.
Sorry, I lost track of your post. But glad you found a workaround !
I agree with @mrjj, it should not bring you trouble.
Thanks for opening the issue. Please post the link here so it's easier to find :-)