Qt 6.11 is out! See what's new in the release
blog
Problem with drawing text by QOpenGlFunctions
General and Desktop
5
Posts
2
Posters
2.1k
Views
1
Watching
-
Hi all!
I have some problem with drawing text by QOpenGlFunctions.
QOpenGlFunctions vs QGraphicsItem
See img:
OpenGlTest.png
QGraphicsItemTest.png//your code here
if (!m_device) m_device = new QOpenGLPaintDevice;
m_device->setSize(size());
QPainter painter(m_device);
painter->drawText(QPoint(100, 200), "Hello world!");
How can I solve this problem? Where can I dig? I look forward to any proposal.
Sorry for my bad English, please write if it have mistakes.Answer:
problem is solving by clearning bufferglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);