summaryrefslogtreecommitdiffstats
path: root/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp')
-rw-r--r--doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp b/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp
index dca1292..c9b7d91 100644
--- a/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp
+++ b/doc/codesnippets/doc/src/snippets/code/src_gui_painting_qpainter.cpp
@@ -193,3 +193,19 @@ image = QImage(":/images/myImage.png")
painter = QPainter(self)
painter.drawImage(target, image, source)
//! [20]
+
+//! [21]
+painter = QPainter(self)
+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]