[PyKDE] QFileDialog problems

Dave S eric3 at pusspaws.net
Wed Sep 20 21:24:01 BST 2006


OK I am a bit stuck. I am trying to use QFileDialog to allow users to select 
where they want to save a file to, by default the Desktop


            desktop = self.config.get('dbase','desktop')
            file_selector = QFileDialog(desktop, "dBase Files (*.adb)", 
self.parent, '', True)
            file_selector.setSelection(self.gsr_name + '.adb')
            file_selector.setCaption('dBase Backup')
            file_selector.exec_loop()
            print file_selector.selectedFiles()

(1) When I select the 'OK' button the dialog does not close ! I expected it to 
close and return the selection - thats a problem

(2) Is it possible to change the 'OK' to a 'save' button or is it fixed 
as 'OK' ?

(2) When I select 'cancel' the dialog does close and I get a ...
<qt.QStringList object at 0xb61733ac>
Which I am struggling to turn into a straight Python list.

Any help much appreciated

Dave






More information about the PyQt mailing list