当我在终端中运行以下 PyQt 代码示例时:
#coding = utf8
import sys
from PyQt4 import QtGui
app = QtGui.QApplication(sys.argv)
widget = QtGui.QWidget()
widget.resize(250, 150)
widget.setWindowTitle('simple')
widget.show()
sys.exit(app.exec_())
我收到以下消息:
Got bus address: "unix:abstract=/tmp/dbus-i0C7rhmhFB,guid=6b91faa5b449dbb3ca941d6e0000001d"
Connected to accessibility bus at: "unix:abstract=/tmp/dbus-i0C7rhmhFB,guid=6b91faa5b449dbb3ca941d6e0000001d"
Registered DEC: true
Error in contacting registry
"org.freedesktop.DBus.Error.NoReply"
"Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken."
Could not query active accessibility event listeners.
Registered event listener change listener: true
窗口在大约 20 秒后显示。我认为显示一个空窗口应该很快。如何解决这个问题呢?
以下是版本信息:
- Ubuntu 12.04 LTS 64 位
- Python 2.7.3rc2
- QT 4.8.0 和 PyQT 4.9.1