Why Qt's creators uses two methods to provide OpenGL support( QGLWidget, QWindow)?
-
One of those are provided early when Qt4.2(or earlier) released, which can integrate well with Qt' graphics - view framework;
But the new comer( QWindow, QSurface, QOpenGL*) seems have little in common with our old friend QWidget, and seems impossible to integrate with Qt‘s graphics - view framework.
Why is that, why let developers make a decision about which to choose from? -
why? I want to know too. thanks.
-
Basically QGLWidget is the old way of doing it, it's stable and mature but it's deprecate, and we should not expect new functionally to be added to it.
For new code it is advised to start with QWindow.
This "video":http://www.youtube.com/watch?v=GYa5DLV6ADQ explains it better. -
Yes, but QWindow is only window. QT was the best framework for game editors etc (like my 2D editor: http://www.youtube.com/watch?v=__EGoLDSBv8).
Before a few days I started new project based on QT 5.1 It is another game editor for internal use. But QGLWidget is deprecated, pure OpenGL castrated, ...why??? Yes, I know, because of default Windows OpenGL drivers, but is not problem for my application....
Please, Is there any correct solution, without deprecated functionality?
-
[quote author="semos" date="1380273239"]Yes, but QWindow is only window. QT was the best framework for game editors etc (like my 2D editor: http://www.youtube.com/watch?v=__EGoLDSBv8).
Before a few days I started new project based on QT 5.1 It is another game editor for internal use. But QGLWidget is deprecated, pure OpenGL castrated, ...why??? Yes, I know, because of default Windows OpenGL drivers, but is not problem for my application....
Well, although deprecated, I still use Qt4's API for my game demo. Because it's not until the fulfillment of Qt5 that I'll transport my code into pure Qt5.
If possible, you can visit my blog at "Here":http://blog.csdn.net/gamesdev/article/details/12073065
Please, Is there any correct solution, without deprecated functionality?[/quote] -
There is nothing wrong using QWindow. But when you need QGLWidget functionality, you must use "createWindowContainer":http://qt-project.org/doc/qt-5.1/qtwidgets/qwidget.html#createWindowContainer. I did not know this function, when I wrote the post.