Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.7.2
-
None
-
MacBook Pro with
OS: Mac OS X 10.6.6
CPU: 2.7GHz Intel Core i7
Compiler info.:
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)MacBook Pro with OS: Mac OS X 10.6.6 CPU: 2.7GHz Intel Core i7 Compiler info.: Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Apple Inc. build 5664)
Description
I wrote some code for test:
#include <QtGui/QApplication> #include <QtOpenGL/QGLWidget> #include <QtOpenGL/QGLFramebufferObject> class GLWidget : public QGLWidget { public: GLWidget() { m_big = font(); m_big.setPixelSize(100); makeCurrent(); m_fbo = new QGLFramebufferObject(500, 150); m_fbo->bind(); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); QPainter painter(m_fbo); painter.setFont(m_big); painter.drawText(QRect(0, 0, 500, 150), "Test Text"); m_fbo->release(); } ~GLWidget() { delete m_fbo; } private: void paintEvent(QPaintEvent *) { QPainter painter(this); painter.setFont(m_big); painter.drawText(QRect(0, 0, 500, 150), "Test Text"); drawTexture(QPointF(0.0, 150.0), m_fbo->texture()); } QFont m_big; QGLFramebufferObject *m_fbo; }; int main(int argc, char *argv[]) { QApplication app(argc, argv); GLWidget w; w.show(); return app.exec(); }
To copy to clipboard, switch view to plain text mode
The above codes do drawing two lines of "Test Text" on QGLWidget.
Upper one is done by directly onto QGLWidget with QPainter,
and the lower one is done by drawTexture whose texture is drawn in QGLFramebufferObject.
The result is attached.
Click image for larger version Name: result.png Views: 3 Size: 22.1 KB ID: 6070
Both of them have problems.
Upper one(drawn by QGLWidget with QPainter) is not anti-aliased.
Lower one(drawn by QGLFramebufferObject) just shows black box.
Also, when I tried with multi-sampled QGLWidget(with like QGLFormat::setSamples(4)),
Upper one looks as same as lower one, that is, only black box.
If you try with small font size, both of them display the texts normally.
Is this a bug? or Did I mistake something?