-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.1.1, 5.2.0 Beta1
-
Qt 5.2-beta1. On Windows I tried with both mingw32 (32 bit) and msvc 2010, nvida GPU.
When trying to render some text using a QOpenglPaintDevice, I get a correct result on linux as well as my Kindle Fire and my Sony Xperia J, but scrambled text on windows and my Samsung Galaxy W. I attach 2 screenshots that shows the incorrect rendering.
Here is a the code that I used:
#include <QGuiApplication>
#include <QQuickWindow>
#include <QOpenGLPaintDevice>
#include <QPainter>
void render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
QOpenGLPaintDevice device;
device.setSize(QSize(200, 200));
QPainter painter(&device);
painter.beginNativePainting();
painter.setPen(QColor(0, 0, 255, 255));
painter.drawText(100, 100, "hello");
painter.endNativePainting();
}
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
QQuickWindow window;
window.setClearBeforeRendering(false);
QObject::connect(&window, &QQuickWindow::beforeRendering, &render);
window.show();
return app.exec();
}