[PyQt] Bug in QFileDialog
Hans-Peter Jansen
hpj at urpla.net
Wed Dec 8 22:04:56 GMT 2010
Hi Antonio,
On Wednesday 08 December 2010, 19:37:09 Antonio Valentino wrote:
> Hi Vicent, hi Pete,
>
> Il giorno Wed, 8 Dec 2010 18:41:25 +0100
>
> "Hans-Peter Jansen" <hpj at urpla.net> ha scritto:
> > On Friday 03 December 2010, 11:12:42 Vicent Mas wrote:
> > > Hi,
> > >
> > > the attached script shows a bug in QFileDialog. If on a given
> > > dialog you call setLabelText(QFileDialog.Accept, text) and then
> > > you call setFileMode(FileMode) then the label is not set and the
> > > default label is used. If you call setFileMode(FileMode) first
> > > and then you call setLabelText(QFileDialog.Accept, text) then the
> > > label is set.
> > >
> > > As you can see in the script the problem only happens with the
> > > QFileDialog.Accept constant. Other QFileDialog.DialogLabel
> > > constants work fine.
> > >
> > > I don't know if it is a Qt bug or a PyQt one. Neither I know if
> > > the problem is in the setLabelText method or in th setFileMode
> > > one.
> >
> > Confirmed with:
> > python: 2.6
> > sip: 4.12-snapshot-b202f0d04ba6
> > qt4: 4.7.1
> > pyqt4: snapshot-4.8.2-e73d5045bea5
> >
> > This script is simple enough to do a C++ version, as I doubt that
> > this is a PyQt issue. Then, you need that version anyway to report
> > this to Nokia. ;-)
>
> I agree with Pete, IMHO it is a Qt bug.
>
> Some time ago I had a problem with QFileDialog on Mac OS X
>
> http://bugreports.qt.nokia.com/browse/QTBUG-7086
>
> The bug is now closed but some strange behavior still persist (see
> last comment)
>
> http://bugreports.qt.nokia.com/browse/QTBUG-7086?focusedCommentId=111
>442&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpa
>nel#comment-111442
>
> I wonder if n some manner the two problems are related.
Hmm, first, I cannot reproduce your issue with Qt 4.7.1 here on Linux.
And since QFileDialog have to proxy anything to native dialogs in some
cases (Win, OSX) it might very well be more fragile in such behavior,
especially if you're reusing it, then average builtin or self made
dialogs. I tend to believe, that these are separate issues.
I dimly remember QFileDialog issues with MacOSX Carbon (PPC/i586), too
(but that has been about a year ago, hence I cannot remember all the
gory details.)
Pete
More information about the PyQt
mailing list