我正在python和pyqt4中为我的覆盆子pi做一个程序。 现在我开始在我的树莓上的程序,它给出了错误,它并没有显示我所做的按钮。 我已经设计成qtdesinger,它显示窗口,但没有任何关于它。Pyqt4 X启动应用程序时发生错误
这是错误我有:
X Error: BadAccess (attempt to access private resource denied) 10
Extension: 129 (MIT-SHM)
Minor opcode: 1 (X_ShmAttach)
Resource id: 0x2800001
X Error: BadShmSeg (invalid shared segment parameter) 128
Extension: 129 (MIT-SHM)
Minor opcode: 5 (X_ShmCreatePixmap)
Resource id: 0x280000a
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 62 (X_CopyArea)
Resource id: 0x280000b
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 62 (X_CopyArea)
Resource id: 0x280000b
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 62 (X_CopyArea)
Resource id: 0x280000b
从qtdesigner这是我的Python代码:
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(480, 640)
self.pushButton = QtGui.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(120, 140, 83, 24))
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.toolButton = QtGui.QToolButton(Form)
self.toolButton.setGeometry(QtCore.QRect(350, 250, 27, 20))
self.toolButton.setObjectName(_fromUtf8("toolButton"))
self.buttonBox = QtGui.QDialogButtonBox(Form)
self.buttonBox.setGeometry(QtCore.QRect(150, 280, 156, 24))
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDia$
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.commandLinkButton = QtGui.QCommandLinkButton(Form)
self.commandLinkButton.setGeometry(QtCore.QRect(160, 230, 168, 41))
self.commandLinkButton.setObjectName(_fromUtf8("commandLinkButton"))
self.checkBox = QtGui.QCheckBox(Form)
self.checkBox.setGeometry(QtCore.QRect(130, 380, 84, 19))
self.checkBox.setObjectName(_fromUtf8("checkBox"))
self.toolButton_2 = QtGui.QToolButton(Form)
self.toolButton_2.setGeometry(QtCore.QRect(160, 470, 27, 20))
self.toolButton_2.setObjectName(_fromUtf8("toolButton_2"))
self.listView = QtGui.QListView(Form)
self.listView.setGeometry(QtCore.QRect(60, 460, 256, 192))
self.listView.setObjectName(_fromUtf8("listView"))
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtG$
self.pushButton.setText(QtGui.QApplication.translate("Form", "Lamp", None,$
self.toolButton.setText(QtGui.QApplication.translate("Form", "...", None, $
self.commandLinkButton.setText(QtGui.QApplication.translate("Form", "Comma$
self.checkBox.setText(QtGui.QApplication.translate("Form", "CheckBox", Non$
self.toolButton_2.setText(QtGui.QApplication.translate("Form", "...", None$
,这我的文件显示窗口: 进口SYS 从PyQt4的进口QtCore ,QtGui from test import Ui_Widget
class StartQT4(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_Widget()
self.ui.setupUi(self)
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
myapp = StartQT4()
myapp.show()
sys.exit(app.exec_())
对我有没有annybody解决方案? 我GOOGLE了错误,但没有找到我的问题的答案。
谢谢...
这有可能是真正的VNC问题吗?我想将程序启动到vnc会话中。在互联网上他们说这个问题可能是真实的vnc是?有可能吗? – Stijnb