summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-11 17:32:43 +0200
committerSamuel Rødal <sroedal@trolltech.com>2009-09-11 18:57:00 +0200
commit1aa4cfab2d437210b8c0b064fa3bd071e53374c1 (patch)
treeb894976753dd3cddde2d0a373d7cea061af21157 /doc/src/snippets
parent04ee935a67b4f4296c31655d625cc3e45cb31b9b (diff)
Added example to docs for QPainter::beginNativePainting().
Hopefully this helps clarify the use of beginNativePainting(). Reviewed-by: Trond
Diffstat (limited to 'doc/src/snippets')
-rw-r--r--doc/src/snippets/code/src_gui_painting_qpainter.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/src/snippets/code/src_gui_painting_qpainter.cpp b/doc/src/snippets/code/src_gui_painting_qpainter.cpp
index 8dfda662b9..02261614ef 100644
--- a/doc/src/snippets/code/src_gui_painting_qpainter.cpp
+++ b/doc/src/snippets/code/src_gui_painting_qpainter.cpp
@@ -241,3 +241,20 @@ QImage image(":/images/myImage.png");
QPainter painter(this);
painter.drawImage(target, image, source);
//! [20]
+
+
+//! [21]
+QPainter painter(this);
+painter.fillRect(0, 0, 128, 128, Qt::green);
+painter.beginNativePainting();
+
+glEnable(GL_SCISSOR_TEST);
+glScissor(0, 0, 64, 64);
+
+glClearColor(1, 0, 0, 1);
+glClear(GL_COLOR_BUFFER_BIT);
+
+glDisable(GL_SCISSOR_TEST);
+
+painter.endNativePainting();
+//! [21]