QOpenGlWidget as viewport of QGraphicsView
In my Application i use a QGraphicsView to display several Text(rendered with QGraphicsTextItem) and image items.
I would like to migrate my application to Qt Version 5.4.
With Qt 5.3 i used a QGLWidget as viewport for my graphics view to enable open gl rendering.
Thats simply done by adding the following lines :
What is the correct usage with QOpenGLWidget ?
When i try to set it with :
everything looks very fuzzy. The Text is rendered too big and thin lines(1 pixel) are not even displayed.
When i use another QSurfaceFormat for my QOpenGLWidget it get a little bit better but i have no idea what are the correct settings.
QOpenGLWidget* widget = new QOpenGLWidget(this);
Can anybody tell me how i have to configure my QOpenGLWidget to have quite the same results as with QGLWidget.
Yes, the snippet with setSamples() is the correct way to enable 4x antialiasing.
Which platform is this? Windows? Mac?
The Platform is Mac.
It seems that since Qt 5.4 fonts gets bigger when displaying in an opengl Widget (even with QGLWidget).
Here are three screenshots that show the differences.
Without Open GL :
QOpenGLWidget with qt 5.4 :
QGLWidget with qt 5.3.2
Is there any other setting than setSamples that could improve antialiasing ?
You are most likely seeing https://bugreports.qt.io/browse/QTBUG-42861
Okay Thank you very much !
Then i will wait until 5.4.1.
Hopefully this includes this patch.
Will this patch also fix the issues with QOpenGLWidget ? Seems that there is only a qtquick file fixed.
5.4.1 won't help, it's too late to get any fix in to that.
Also, the QOpenGLWidget issue needs some more investigation. The fixes only cover Qt Quick for now.
Could you please create a new Bug Report for QOpenGlWidget and post the link here ?
I Think you can describe the bug better as i do.
I've created the Bug Report with a little example.