Details
-
Bug
-
Resolution: Cannot Reproduce
-
P1: Critical
-
None
-
4.8.0
-
None
-
Windows 7 x64
Windows 7 x86
Microsoft Visual C++ express 2010
MinGW32 4.4.0 toolchain
Description
Qt configured with these options: "-no-qt3support -opensource -graphicssystem opengl -no-dsp -no-vcproj -mp"
Just open LineEdits example program, you will see the incorrectly rendered glyphs, there're always some pixels under each line of text.
But if not use -graphicssystem opengl option, everything works well.
Well this bug can also be reproducible by drawing text on a QGLWidger. For example, compile a version without -graphicssystem opengl option, then launch OpenGL-2D Painting program from qtDemo, you will see the same problem.
Here's the code for testing
#include <QtGui> #include <QGLWidget> class GLWidget:public QGLWidget { protected: void paintEvent(QPaintEvent *event) { QPainter painter(this); QString text1 = "ABCDE abcde\n"; QString text2 = "\nABCDE abcde"; QRect rect=this->rect(); QFont font1("Arial",30); QFont font2("Tahoma"); painter.begin(this); painter.setFont(font1); painter.drawText(rect, Qt::AlignCenter, text1); painter.setFont(font2); painter.drawText(rect, Qt::AlignCenter, text2); painter.end(); } }; int main(int argc, char **argv) { QApplication app(argc, argv); GLWidget w; w.show(); app.exec(); return 0; }
Then I try to change the point size of font. Then I found that, you will see the different result when the point size larger than 47. See picture "new".
Here's the code.
#include <QtGui> #include <QGLWidget> class GLWidget:public QGLWidget { protected: void paintEvent(QPaintEvent *event) { QPainter painter(this); QString text1 = "ABCDE abcde\n"; QString text2 = "\nABCDE abcde"; QRect rect=this->rect(); QFont font1("Tahoma",47); QFont font2("Tahoma",48); painter.begin(this); painter.setFont(font1); painter.drawText(rect, Qt::AlignCenter, text1); painter.setFont(font2); painter.drawText(rect, Qt::AlignCenter, text2); painter.end(); } }; int main(int argc, char **argv) { QApplication app(argc, argv); GLWidget w; w.show(); app.exec(); return 0; }
Now I have a "raster" version of qt, and try glwidget program, then I got the same result. See picture "rasterResult". Set graphicssystem option to raster could not fix this problem for me.
I tried this program on another machine, it's a win7 x86 system. The dots gone, but there're still some problem. I uploaded a picture, so you can see the different between size 47 and 48. With 48 point size, smooth seems disabled.