[英]PyQt: QFileDialog close directly after opening
I am using QFileDialog
(both getOpenFileName
and getSaveFileName
) but have a strange behavior: 我正在使用QFileDialog
( getOpenFileName
和getSaveFileName
),但是有一个奇怪的行为:
QtGui.QFileDialog.DontUseNativeDialog
在Mac 10.6中,如果我使用QtGui.QFileDialog.DontUseNativeDialog
,它将正常工作 DontUseNativeDialog
option 在win xp(在virtualbox中)中,无需DontUseNativeDialog
选项即可使用 DontUseNativeDialog
option, the dialog close right after opening 在win xp中,使用DontUseNativeDialog
选项,对话框在打开后立即关闭 My questions: 我的问题:
I found out that this problem comes from a strange conflict with ipython and its --pylab
start option. 我发现此问题来自与ipython及其--pylab
start选项的奇怪冲突。 It can thus be avoided by either 因此可以避免
python xxxx.py
直接使用python xxxx.py
执行代码 In both cases, the qapplication should be started manually: 在这两种情况下,都应手动启动qapplication:
qapp = QtGui.QApplication([])
my_app = MyQtAppWindow(...)
my_app.exec_()
However, I still don't know why there is a conflict. 但是,我仍然不知道为什么会发生冲突。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.