[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] User selected filter in QFileDialog
From:       barmanoo <olivier.friard () gmail ! com>
Date:       2009-06-30 15:36:04
Message-ID: 24274183.post () talk ! nabble ! com
[Download RAW message or body]




Phil Thompson-5 wrote:
> 
> 
> getSaveFileName() is a static method that creates its own dialog. In other
> words the dialog the user is using isn't the same one you have created.
> 
> selected_filter = QString()
> projectFileName = QFileDialog.getSaveFileName(self, 'Save the current
> project', '',
> 'your;;filters', selected_filter)
> 
> selected_filter will be updated with the selected filter (a horribly
> unpythonic API).
> 
> Phil
> 
> 

Thank you for your reply.
Unfortunately your suggestion do not fixed my problem...

I modified my code to:

filter=QString()
self.projectFileName=QFileDialog.getSaveFileName(self,'Save the current
AnnHyb project','','pyAnnHyb project (*.pyannhyb);;AnnHyb project
(*.annhyb);;All files (*)',filter)
print str(filter)

The filter QString variable is now always empty and no more "All files (*)" 
(?)

I am using Python 2.6.2, Qt 4.5.0 and PyQt 4.4.4 on Linux

The full code is available at
http://www.bioinformatics.org/pyannhyb/download.php
(file: pyannhyb.py , line 915)

Thank you
Olivier
-- 
View this message in context: \
http://www.nabble.com/User-selected-filter-in-QFileDialog-tp24270454p24274183.html \
Sent from the PyQt mailing list archive at Nabble.com.

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic