QGLWidget::renderText => incomplete text
Hi all,
I am new to the Qt and so far I am enjoying it.
Qt version: 4.7.4
Here is what I am printing on the screen:
Everything else (other than text) is being drawn correctly.
But only first three characters “Hel” are being printed.
Can someone point me to an area from where this problem can come from or how to solve it?
Thanks,
Tomas
6 replies
I have noticed one more thing.
Even if I use QPainter to draw text, it draws only first three chars as well.
I did not. Documentation says that in case the font parameter is omitted a default one is used.
However, I have tried to set it as well, but with no effect other than font has changed.
Only first three characters are being drawn.Is there some hidden limit that could be set or something?
I have created a small example. Here is the code which produces this behavior.
- #include <QtGui>
- #include <QtOpenGL>
- #include "glwidget.h"
- {
- }
- GLWidget::~GLWidget()
- {
- }
- {
- }
- {
- }
- void GLWidget::initializeGL()
- {
- }
- void GLWidget::resizeGL(int width, int height)
- {
- glViewport (0, 0, (GLsizei)width, (GLsizei)height);
- glLoadIdentity ();
- glMatrixMode (GL_PROJECTION);
- glLoadIdentity ();
- GLdouble winRatio = (GLdouble)height/(GLdouble)width;
- glOrtho(-1.0, 1.0, -winRatio, winRatio, -10.0, 10.0);
- glMatrixMode (GL_MODELVIEW);
- }
- void GLWidget::paintGL()
- {
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glLoadIdentity();
- glEnable(GL_DEPTH_TEST);
- }
You must log in to post a reply. Not a member yet? Register here!

