Revert "qt4: Updated to v4.7.3"
[openembedded.git] / recipes / qt4 / qt-4.6.0 / 1136-Disable-depth-testing-during-the-2D-QGLWidget-render.patch
1 From 7371d787d9b2667132c0caadb9964189b1d8c9fc Mon Sep 17 00:00:00 2001
2 From: Rhys Weatherley <rhys.weatherley@nokia.com>
3 Date: Thu, 17 Dec 2009 11:17:11 +1000
4 Subject: [PATCH 1136/1244] Disable depth testing during the 2D QGLWidget::renderText()
5
6 Also document the depth testing conditions for the 2D and 3D
7 versions of the function.
8
9 Task-number: QTBUG-5041
10 Reviewed-by: Daniel Pope
11 ---
12  src/opengl/qgl.cpp |   12 ++++++++++++
13  1 files changed, 12 insertions(+), 0 deletions(-)
14
15 diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
16 index 32534aa..466e851 100644
17 --- a/src/opengl/qgl.cpp
18 +++ b/src/opengl/qgl.cpp
19 @@ -4302,6 +4302,7 @@ static void qt_save_gl_state()
20      glDisable(GL_CULL_FACE);
21      glDisable(GL_LIGHTING);
22      glDisable(GL_STENCIL_TEST);
23 +    glDisable(GL_DEPTH_TEST);
24      glEnable(GL_BLEND);
25      glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
26  }
27 @@ -4355,6 +4356,10 @@ static void qt_gl_draw_text(QPainter *p, int x, int y, const QString &str,
28     \note This function clears the stencil buffer.
29  
30     \note This function is not supported on OpenGL/ES systems.
31 +
32 +   \note This function temporarily disables depth-testing when the
33 +   text is drawn.
34 +
35     \l{Overpainting Example}{Overpaint} with QPainter::drawText() instead.
36  */
37  
38 @@ -4445,6 +4450,13 @@ void QGLWidget::renderText(int x, int y, const QString &str, const QFont &font,
39      have the labels move with the model as it is rotated etc.
40  
41      \note This function is not supported on OpenGL/ES systems.
42 +
43 +    \note If depth testing is enabled before this function is called,
44 +    then the drawn text will be depth-tested against the models that
45 +    have already been drawn in the scene.  Use \c{glDisable(GL_DEPTH_TEST)}
46 +    before calling this function to annotate the models without
47 +    depth-testing the text.
48 +
49      \l{Overpainting Example}{Overpaint} with QPainter::drawText() instead.
50  */
51  void QGLWidget::renderText(double x, double y, double z, const QString &str, const QFont &font, int)
52 -- 
53 1.6.5
54