summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-01-18 17:22:03 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:51:47 -0300
commita3cf9b0a3cdf5ced4a12e44240c84ef8696a222b (patch)
treebbb24a7b8bed5a939d5480441e8809d6eb82aa97
parent3e0b9e52deae29e6e7e463603db9a5f5847e826a (diff)
Fix bug#623 - "QGLWidget.bindTexture(QPixmap, GLenum, GLenum) is missing"
-rw-r--r--CMakeLists.txt1
-rw-r--r--PySide/CMakeLists.txt4
-rw-r--r--PySide/QtOpenGL/typesystem_opengl.xml1
-rw-r--r--PySide/global.h.in1
-rw-r--r--tests/QtOpenGL/CMakeLists.txt1
-rw-r--r--tests/QtOpenGL/qglwidget_test.py18
6 files changed, 24 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 856ed6a9..c7582d03 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Macros/
find_package(GeneratorRunner 0.6.3 REQUIRED)
find_package(Shiboken 1.0.0 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
+find_file(GL_H "gl.h" PATH_SUFFIXES "GL")
include(FindQt4Extra)
set(XVFB_EXEC "")
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 35baf3c5..573bd8a6 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -21,7 +21,9 @@ HAS_QT_MODULE(QT_QTWEBKIT_FOUND QtWebKit)
HAS_QT_MODULE(QT_QTSVG_FOUND QtSvg)
HAS_QT_MODULE(QT_QTXML_FOUND QtXml)
HAS_QT_MODULE(QT_QTTEST_FOUND QtTest)
-HAS_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)
+if (GL_H)
+ HAS_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)
+endif()
HAS_QT_MODULE(QT_QTSQL_FOUND QtSql)
if(QT_QTDESIGNER_FOUND)
HAS_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index 86a6d7b6..f58d8494 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -20,7 +20,6 @@
-->
<typesystem package="PySide.QtOpenGL">
<load-typesystem name="typesystem_gui.xml" generate="no" />
- <primitive-type name="GLuint" target-lang-api-name="PyLong" />
<rejection class="QGLColormap::QGLColormapData"/>
<rejection class="QGLWidget" function-name="setMouseTracking"/>
diff --git a/PySide/global.h.in b/PySide/global.h.in
index 0e76e468..88817b80 100644
--- a/PySide/global.h.in
+++ b/PySide/global.h.in
@@ -1490,6 +1490,7 @@ QT_END_HEADER
/* For compatibility with OpenGL v1.0 */
#define GL_LOGIC_OP GL_INDEX_LOGIC_OP
#define GL_TEXTURE_COMPONENTS GL_TEXTURE_INTERNAL_FORMAT
+#include <@GL_H@>
#include <QtOpenGL/QtOpenGL>
#endif // QT_NO_OPENGL
diff --git a/tests/QtOpenGL/CMakeLists.txt b/tests/QtOpenGL/CMakeLists.txt
index 3064edfb..7c709853 100644
--- a/tests/QtOpenGL/CMakeLists.txt
+++ b/tests/QtOpenGL/CMakeLists.txt
@@ -1,3 +1,4 @@
if(${QTVERSION} VERSION_GREATER 4.6.9)
PYSIDE_TEST(qglbuffer_test.py)
endif()
+PYSIDE_TEST(qglwidget_test.py)
diff --git a/tests/QtOpenGL/qglwidget_test.py b/tests/QtOpenGL/qglwidget_test.py
new file mode 100644
index 00000000..515b8f52
--- /dev/null
+++ b/tests/QtOpenGL/qglwidget_test.py
@@ -0,0 +1,18 @@
+import unittest
+from PySide.QtGui import *
+from PySide.QtOpenGL import *
+
+class TestQGLWidget (unittest.TestCase):
+ def testIt(self):
+ """Just test if the bindTexture(*, GLenum, GLint) methods overloads exists"""
+ app = QApplication([])
+ img = QImage()
+ w = QGLWidget()
+ a = w.bindTexture(img, 0, 0) # ok if it throws nothing.. :-)
+
+
+
+
+
+if __name__ == "__main__":
+ unittest.main()