[PyKDE] Problem with PyQt4

Detlev Offenbach detlev at die-offenbachs.de
Mon Mar 20 19:48:52 GMT 2006


I would rather leave the current "Filter" variants. However, the 
"selectedFilter" parameter should be settable to select a filter in the list 
and the method should return a tuple as it does right now. I always found the 
old way a bit strange (create a QString, pass it in to the method and getting 
back the selected string). The current solution with the mentioned extension 
would be much clearer.


Am Montag, 20. März 2006 10:36 schrieb Phil Thompson:
> 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

Detlev Offenbach
detlev at die-offenbachs.de

More information about the PyQt mailing list