[PyQt] Qfiledailoug multiple file selection

Detlev Offenbach detlev at die-offenbachs.de
Sat Mar 7 09:58:16 GMT 2009


On Samstag, 7. März 2009, klia wrote:
> Detlev Offenbach wrote:
> > On Freitag, 6. März 2009, klia wrote:
> >> Hey folks;
> >>
> >> How can i be able to select multiple files whenever i browse my
> >> directory using QfileDailoug?
> >>
> >> this is the code to call up the filedailoug
> >>
> >> files = QtGui.QFileDialog.getOpenFileName(self,  'Open file','/home/',
> >> ("Images (*.png *.tiff *.jpg)"))
> >
> > Just use "getOpenFileNames(...)". See the docs for more details.
> >
> >> Thank you
> >
> > --
> > Detlev Offenbach
> > detlev at die-offenbachs.de
> >
> > _______________________________________________
> > PyQt mailing list    PyQt at riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
> Thank you Detlev Offenbach it worked but python complaining that there's no
> buffer or string to hold the selected files in order to process
> them...............Any idea

Just call it like this:

        fileNames = QFileDialog.getOpenFileNames(\
            self,
            self.trUtf8("Add Documentation"),
            QString("/home"),
            self.trUtf8("Qt Compressed Help Files (*.qch)"))

Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de



More information about the PyQt mailing list