python - Pyqt 5.4.1 - how to use QOpenGLWindow? -


the following simple code outputs none twice, reason that? can see black window, cannot draw since have no access gl functions.

from pyqt5.qtgui import qopenglwindow pyqt5.qtwidgets import qapplication import sys   class mainwindow(qopenglwindow):     def paintgl(self):         print self.context().versionfunctions()  if __name__ == '__main__':     app = qapplication(sys.argv)     window = mainwindow()     window.show()     sys.exit(app.exec_()) 

i found nice example here: https://github.com/pbouda/stuff/blob/master/opengl/pyqt/chocolux.py

the issue in incorrect gl profile: despite fact video card has 4.4, pyqt supports 2.0 , 2.1. sad honest...

1.0 failed: no module named _qopenglfunctions_1_0 1.1 failed: no module named _qopenglfunctions_1_1 1.2 failed: no module named _qopenglfunctions_1_2 1.3 failed: no module named _qopenglfunctions_1_3 1.4 failed: no module named _qopenglfunctions_1_4 1.5 failed: no module named _qopenglfunctions_1_5 2.0 ok 2.1 ok 3.0 failed: no module named _qopenglfunctions_3_0 3.1 failed: no module named _qopenglfunctions_3_1 

i got following code:

def paintgl(self):         in xrange(0, 5):             j in xrange(0, 1000):                 version = qtgui.qopenglversionprofile()                 version.setversion(i, j)                 try:                     if self.context().versionfunctions(version) not none: print '{}.{} ok'.format(i, j)                 except exception e:                     print '{}.{} failed: {}'.format(i, j, e) 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -