[PyKDE] Problem with PyQt4

Phil Thompson phil at riverbankcomputing.co.uk
Mon Mar 20 09:36:04 GMT 2006


On Saturday 18 March 2006 6:31 pm, Detlev Offenbach wrote:
> Hi,
>
> the parameter "selectedFilter" of
> QFileDialog.getOpenFileNameFilter, ...getOpenFileNamesFilter
> and ...getSaveFileNameFilter should be an in and out parameter. If this is
> not possible or not right, please let me know how to select the initial
> filter programatically. In eric4 I am used to have code like:
>
> filter = QString("Python Files (*.py)"
> filename, selectedFilter = QFileDialog.getSaveFileNameFilter(\
> 	self, QString("Save source"), startdir,
> 	QString("Python CGI Files (*.cgi);;Python Files (*.py)"),
> 	filter)
>
> However, the above code gives an error about a wrong type for parameter 5.
> Please help.

It looks like I misunderstood what "selectedFilter" meant. I had assumed it 
only meant "the filter that the user selected" when it also means "the filter 
initially selected" and the QString is modified in situ.

Go back to using the normal static functions - they work as they always have 
done - and I will remove the extra "Filter" variants.

Thanks,
Phil




More information about the PyQt mailing list