diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-07-27 06:32:57 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-07-27 07:58:10 (GMT) |
commit | e7c239407698f2a5d4f4b4000ecdd5969025fe1c (patch) | |
tree | 29df59f4269439f6d11f89ce80127d7e7ccbd73b /src/plugins | |
parent | c984a856ccf72731da052ff8bdae88fe3921fc83 (diff) | |
download | Qt-e7c239407698f2a5d4f4b4000ecdd5969025fe1c.zip Qt-e7c239407698f2a5d4f4b4000ecdd5969025fe1c.tar.gz Qt-e7c239407698f2a5d4f4b4000ecdd5969025fe1c.tar.bz2 |
Made QPlatformWidnow::glContext a const function
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfswindow.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfswindow.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/openkode/qopenkodewindow.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/openkode/qopenkodewindow.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/testlite/qglxintegration.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/testlite/qtestlitewindow.cpp | 11 | ||||
-rw-r--r-- | src/plugins/platforms/testlite/qtestlitewindow.h | 3 |
7 files changed, 10 insertions, 15 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index db15862..86cc98b 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -71,7 +71,7 @@ WId QEglFSWindow::winId() const -QPlatformGLContext *QEglFSWindow::glContext() +QPlatformGLContext *QEglFSWindow::glContext() const { #ifdef QEGL_EXTRA_DEBUG qWarning("QEglWindow::glContext %p\n", m_screen->platformContext()); diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h index f605cf4..0c3bc84 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.h +++ b/src/plugins/platforms/eglfs/qeglfswindow.h @@ -56,11 +56,12 @@ class QEglFSWindow : public QPlatformWindow { public: QEglFSWindow(QWidget *w, QEglFSScreen *screen); - QPlatformGLContext *glContext(); void setGeometry(const QRect &); WId winId() const; + QPlatformGLContext *glContext() const; + private: QEglFSScreen *m_screen; WId m_winid; diff --git a/src/plugins/platforms/openkode/qopenkodewindow.cpp b/src/plugins/platforms/openkode/qopenkodewindow.cpp index 2ad9238..81f38d2 100644 --- a/src/plugins/platforms/openkode/qopenkodewindow.cpp +++ b/src/plugins/platforms/openkode/qopenkodewindow.cpp @@ -169,7 +169,7 @@ void QOpenKODEWindow::setVisible(bool visible) } } -QPlatformGLContext *QOpenKODEWindow::glContext() +QPlatformGLContext *QOpenKODEWindow::glContext() const { return m_platformGlContext; } diff --git a/src/plugins/platforms/openkode/qopenkodewindow.h b/src/plugins/platforms/openkode/qopenkodewindow.h index d11c0d8..3e7ee56 100644 --- a/src/plugins/platforms/openkode/qopenkodewindow.h +++ b/src/plugins/platforms/openkode/qopenkodewindow.h @@ -62,7 +62,7 @@ public: void setVisible(bool visible); WId winId() const { return WId(m_eglWindow); } - QPlatformGLContext *glContext(); + QPlatformGLContext *glContext() const; private: struct KDWindow *m_kdWindow; diff --git a/src/plugins/platforms/testlite/qglxintegration.cpp b/src/plugins/platforms/testlite/qglxintegration.cpp index 4d807b0..e554e8d 100644 --- a/src/plugins/platforms/testlite/qglxintegration.cpp +++ b/src/plugins/platforms/testlite/qglxintegration.cpp @@ -181,7 +181,7 @@ QGLXGLContext::QGLXGLContext(MyDisplay *display, Drawable drawable, GLXContext c QGLXGLContext::~QGLXGLContext() { if (m_context) { - qDebug("Destroying GLX context 0x%x", m_context); + qDebug("Destroying GLX context 0x%p", m_context); glXDestroyContext(m_xd->display, m_context); } } diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index f774458..67ec97c 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -1011,20 +1011,15 @@ void QTestLiteWindow::setCursor(QCursor * cursor) XFlush(xd->display); } -QPlatformGLContext *QTestLiteWindow::glContext() +QPlatformGLContext *QTestLiteWindow::glContext() const { if (!mGLContext) { - mGLContext = createGLContext(); + QTestLiteWindow *that = const_cast<QTestLiteWindow *>(this); + that->mGLContext = new QGLXGLContext(x_window, xd, widget()->platformWindowFormat()); } return mGLContext; } -QPlatformGLContext *QTestLiteWindow::createGLContext() -{ - QPlatformGLContext *context = new QGLXGLContext(x_window, xd, widget()->platformWindowFormat()); - return context; -} - Cursor QTestLiteWindow::createCursorBitmap(QCursor * cursor) { XColor bg, fg; diff --git a/src/plugins/platforms/testlite/qtestlitewindow.h b/src/plugins/platforms/testlite/qtestlitewindow.h index d405578..dc628f1 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.h +++ b/src/plugins/platforms/testlite/qtestlitewindow.h @@ -127,7 +127,7 @@ public: void setCursor(QCursor * cursor); - QPlatformGLContext *glContext(); + QPlatformGLContext *glContext() const; private: int xpos, ypos; @@ -138,7 +138,6 @@ private: GC createGC(); Cursor createCursorShape(int cshape); Cursor createCursorBitmap(QCursor * cursor); - QPlatformGLContext *createGLContext(); int currentCursor; |