[PyKDE] Unexplained delay calling Python method- correction/repost

Tony Cappellini cappy2112 at gmail.com
Thu Mar 1 06:58:30 GMT 2007


Sorry- I pasted the wrong code in the previous mail

I'm using Pyqt 4.2.2 on Win XP, SP2.

I've got a menu action which is connected to a method I've written.
Here is the connect line

       QDialog.connect(self.ui.actionOpen, SIGNAL("triggered()"),self.fileOpen)

here is the method it calls

   def fileOpen(self):
       '''
       Displays the file open dialogue, allows the user to select patches
       to be converted.
       '''
       FileDialog = QFileDialog()
       FileDialog.setFilters(['*.pch', '*.*'])
       msg = QApplication.translate("MainWindow", "Select patch files
To Convert",  None, QApplication.UnicodeUTF8 )
       #self.ui._TargetFilesToConvert =
QFileDialog.getOpenFileNames(None, msg , os.getcwd(), '*.pch *.*')
       self._TargetFilesToConvert =
list(FileDialog.getOpenFileNames(None, msg , os.getcwd()))
       if self._TargetFilesToConvert:
           self._DisplayFilesToConvert()

When I click on File Open in the menu, the FileOpen dialog takes almost 10
seconds before it appears.

I've tried running this in WigIDE, and set a breakpoint in the FileOpen method.
I see the same behavior. There is a unexplained long delay between the
time the button is clicked, and the time the breakpoint in FileOpen is
hit.


I just don't understand this.




More information about the PyQt mailing list