summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-09-03 12:19:05 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-09-03 12:19:05 (GMT)
commit6147b21f92b9101f69ed2d916ed005aeb378bdc1 (patch)
treee684f880a7af0267bb756b7d5a2b7eed66eebfb9 /demos
parent77bc072f5b93e43f38eeb31d966fa76a3f6bd61c (diff)
parent5699577461e75093222d6bcd7ce22b0c24a74095 (diff)
downloadQt-6147b21f92b9101f69ed2d916ed005aeb378bdc1.zip
Qt-6147b21f92b9101f69ed2d916ed005aeb378bdc1.tar.gz
Qt-6147b21f92b9101f69ed2d916ed005aeb378bdc1.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6
Diffstat (limited to 'demos')
-rw-r--r--demos/composition/composition.cpp14
-rw-r--r--demos/textedit/textedit.doc18
-rw-r--r--demos/textedit/textedit.qdoc59
3 files changed, 70 insertions, 21 deletions
diff --git a/demos/composition/composition.cpp b/demos/composition/composition.cpp
index bb8a02c..8061908 100644
--- a/demos/composition/composition.cpp
+++ b/demos/composition/composition.cpp
@@ -377,7 +377,9 @@ void CompositionRenderer::paint(QPainter *painter)
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(QRect(0, 0, m_pbuffer->width(), m_pbuffer->height()), Qt::transparent);
- p.save();
+ p.save(); // Needed when using the GL1 engine
+ p.beginNativePainting(); // Needed when using the GL2 engine
+
glBindTexture(GL_TEXTURE_2D, m_base_tex);
glEnable(GL_TEXTURE_2D);
glColor4f(1.,1.,1.,1.);
@@ -399,16 +401,21 @@ void CompositionRenderer::paint(QPainter *painter)
glEnd();
glDisable(GL_TEXTURE_2D);
- p.restore();
+
+ p.endNativePainting(); // Needed when using the GL2 engine
+ p.restore(); // Needed when using the GL1 engine
drawSource(p);
p.end();
m_pbuffer->updateDynamicTexture(m_compositing_tex);
}
- glWidget()->makeCurrent();
+ painter->beginNativePainting(); // Needed when using the GL2 engine
+ glWidget()->makeCurrent(); // Needed when using the GL1 engine
glBindTexture(GL_TEXTURE_2D, m_compositing_tex);
glEnable(GL_TEXTURE_2D);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1.,1.,1.,1.);
glBegin(GL_QUADS);
{
@@ -426,6 +433,7 @@ void CompositionRenderer::paint(QPainter *painter)
}
glEnd();
glDisable(GL_TEXTURE_2D);
+ painter->endNativePainting(); // Needed when using the GL2 engine
} else
#endif
{
diff --git a/demos/textedit/textedit.doc b/demos/textedit/textedit.doc
deleted file mode 100644
index 53279b9..0000000
--- a/demos/textedit/textedit.doc
+++ /dev/null
@@ -1,18 +0,0 @@
-/*! \page textedit-example.html
-
- \ingroup examples
- \title Text Edit Example
-
- This example displays a text editor with the user interface written
- in pure C++.
-
- A similar example which uses \link designer-manual.book Qt
- Designer\endlink to produce the user interface is in the \link
- designer-manual.book Qt Designer manual\endlink.
-
-
- See \c{$QTDIR/examples/textedit} for the source code.
-
-*/
-
-
diff --git a/demos/textedit/textedit.qdoc b/demos/textedit/textedit.qdoc
new file mode 100644
index 0000000..c9b06e8
--- /dev/null
+++ b/demos/textedit/textedit.qdoc
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*! \page textedit-example.html
+
+ \ingroup examples
+ \title Text Edit Example
+
+ This example displays a text editor with the user interface written
+ in pure C++.
+
+ A similar example which uses \link designer-manual.book Qt
+ Designer\endlink to produce the user interface is in the \link
+ designer-manual.book Qt Designer manual\endlink.
+
+
+ See \c{$QTDIR/examples/textedit} for the source code.
+
+*/
+
+