[Qt-interest] How to override qt_gl_draw_text?

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Thu Mar 11 15:27:17 CET 2010


Konstantin Tokarev wrote on Thursday, March 11, 2010 2:30 PM:

> ...
> internal functions of qgl.cpp and I don't want to copy them all into
> my code What is the proper way to "replace" qt_gl_draw_text?      

qt_gl_draw_text is an internal method and is not supposed to be "visible" for the "outside world". And even if it was (I did not check the actual Qt code) you should not call it from application code, because you have no guarantees that this method will remain the same in the next minor Qt release etc.

That said, there is no "clean way" to override the behaviour. So either

- hack the Qt code directly and ship that modified Qt library together with your app (not a very practical solution, especially for Open Source apps)

- override the "public QGLWidget API" (and re-implement most of what is already there in the Qt source code)

- Use an external "GL font rendering" library maybe altogether?

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list