summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-04-15 10:11:39 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-04-15 16:14:17 (GMT)
commitaa082287ab51dd42c749e92431527c69f6adc078 (patch)
tree5e49e37c1eb4411ed03b6ceec7af1543937c44ba /src/opengl/qgl.cpp
parent87a19963529a3974ae5fda3822c49cdc9a973a93 (diff)
downloadQt-aa082287ab51dd42c749e92431527c69f6adc078.zip
Qt-aa082287ab51dd42c749e92431527c69f6adc078.tar.gz
Qt-aa082287ab51dd42c749e92431527c69f6adc078.tar.bz2
BT: Fix Cocoa bug w/OpenGL widgets in dock widgets would disappear.
The NSOpenGLContext seems to be tied to the window. So if the view changes from one window to another, the OpenGL context needs to be cleared. We can do this by hooking into the viewWillChangeWindow and viewDidChangeWindow events and clear and reset the drawable respectively. We also found out that QCocoaOpenGLView was not being used at all, so just remove it to get rid of any confusion. Task-number: 250066 Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 303b5e2..99df658 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -3235,6 +3235,10 @@ bool QGLWidget::event(QEvent *e)
update();
}
return true;
+# if defined(QT_MAC_USE_COCOA)
+ } else if (e->type() == QEvent::MacGLClearDrawable) {
+ d->glcx->d_ptr->clearDrawable();
+# endif
}
#endif