PyQt4 QFileDialog freezes when qt4reactor is running

To use the twisted reactor inside a Qt gui application, I’m using the qt4reactor package:

app = QtGui.QApplication(sys.argv)

import qt4reactor

from twisted.internet import reactor
factory = Factory()

gui = Gui(app)


But I realized that after the “reactor.runReturn()” line, each QFileDialog freezes the complete program.

filename = QtGui.QFileDialog.getOpenFileName()

A solution is to use the non-native dialog instead:

filename = QtGui.QFileDialog.getOpenFileName(options=QtGui.QFileDialog.DontUseNativeDialog)
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>