在我的 PyQt4 应用程序中,有一个功能允许用户保存avi文件。为此,在主窗口中实现了saveMovie方法:
def saveMovie(self):
    """ Let the user make a movie out of the current experiment. """
    filename = QtGui.QFileDialog.getSaveFileName(self, "Export Movie", "",
                                                 'AVI Movie File (*.avi)')
    if filename != "":
        dialog = QtGui.QProgressDialog('',
                                       QtCore.QString(),
                                       0, 100,
                                       self,
                                       QtCore.Qt.Dialog |
                                       QtCore.Qt.WindowTitleHint)
        dialog.setWindowModality(QtCore.Qt.WindowModal)
        dialog.setWindowTitle('Exporting Movie')
        dialog.setLabelText('Resampling...')
        dialog.show()
        make_movie(self.appStatus, filename, dialog)
        dialog.close()
我的想法是使用QProgressDialog来显示视频编码工作是如何进行的。
然而,选择文件名后,QFileDialog不会消失,整个应用程序保持无响应,直到make_movie函数完成。  
我应该怎么做才能避免这种情况?