-1
我正在使用Debian 8和python 2.7,anaconda环境。PyQt5 + QtOpenGL:QXcbIntegration错误
这是我的代码:
from PyQt5 import QtCore, QtWidgets, QtOpenGL
import sys
class Ui_MainWindow(QtWidgets.QMainWindow):
def __init__(self, parent=None):
super(Ui_MainWindow, self).__init__(parent, flags=QtCore.Qt.FramelessWindowHint)
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.setupUi(self)
def setupUi(self, MainWindow):
MainWindow.setWindowModality(QtCore.Qt.ApplicationModal)
MainWindow.setFixedSize(800, 600)
self.map = Map(self)
class Map(QtOpenGL.QGLWidget):
def __init__(self, parent=None):
super(Map, self).__init__(parent)
self.move(11, 148)
self.setFixedSize(545, 416)
app = QtWidgets.QApplication(sys.argv)
form = Ui_MainWindow()
form.show()
sys.exit(app.exec_())
我得到这个错误:
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
难道我做错了什么?
在此先感谢。
编辑:
这是我的Qt的./configure。
这是我glxinfo
但仍然没有工作。
该代码适用于python3.5 + win7 + pyqt5.7,问题在于opengl方面.... glxinfo说什么? – BPL
http://pastebin.com/tgQVrpFj。谢谢! –