Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, November 2006
QDirModel::setNameFilters


Message 1 in thread

Shouldn't the following only display files with the .nki extension?

  QStringList nameFilters;
  nameFilters << "*.nki";
  m_model->setNameFilters(nameFilters);

I created a listview with a QDirModel, and the listview still shows
all files....

-- 
 [ signature omitted ] 

Message 2 in thread

On Wed, 1 Nov 2006, Patrick Stinson wrote:

> Shouldn't the following only display files with the .nki extension?
>
>   QStringList nameFilters;
>   nameFilters << "*.nki";
>   m_model->setNameFilters(nameFilters);
>
> I created a listview with a QDirModel, and the listview still shows
> all files....
>

	not sure about your specific case, but perhaps it's like
QFileDialog's selectedFilter: "Images (*.png *.xpm *.jpg)" (that const
char*).  so, maybe just add parens and (if you add more) try space
delimiters?


	d
	.

--
 [ signature omitted ] 

Message 3 in thread

actually, QFileDialog parses a string like "Image Files (*.png *.jpg)"
with a regexp and passes a string like "*.png *.jpg" to the QDirModel.

On 11/1/06, david m. richter <richterd@xxxxxxxxxxxxxx> wrote:
> On Wed, 1 Nov 2006, Patrick Stinson wrote:
>
> > Shouldn't the following only display files with the .nki extension?
> >
> >   QStringList nameFilters;
> >   nameFilters << "*.nki";
> >   m_model->setNameFilters(nameFilters);
> >
> > I created a listview with a QDirModel, and the listview still shows
> > all files....
> >
>
>         not sure about your specific case, but perhaps it's like
> QFileDialog's selectedFilter: "Images (*.png *.xpm *.jpg)" (that const
> char*).  so, maybe just add parens and (if you add more) try space
> delimiters?
>
>
>         d
>         .
>


-- 
 [ signature omitted ] 

Message 4 in thread

What I'm looking for is a way to show all directories and only files
matching the passed filters, or to show all directories and only
enable files matching the name filters for selecting.

On 11/1/06, Patrick Stinson <patrickkidd.lists@xxxxxxxxx> wrote:
> actually, QFileDialog parses a string like "Image Files (*.png *.jpg)"
> with a regexp and passes a string like "*.png *.jpg" to the QDirModel.
>
> On 11/1/06, david m. richter <richterd@xxxxxxxxxxxxxx> wrote:
> > On Wed, 1 Nov 2006, Patrick Stinson wrote:
> >
> > > Shouldn't the following only display files with the .nki extension?
> > >
> > >   QStringList nameFilters;
> > >   nameFilters << "*.nki";
> > >   m_model->setNameFilters(nameFilters);
> > >
> > > I created a listview with a QDirModel, and the listview still shows
> > > all files....
> > >
> >
> >         not sure about your specific case, but perhaps it's like
> > QFileDialog's selectedFilter: "Images (*.png *.xpm *.jpg)" (that const
> > char*).  so, maybe just add parens and (if you add more) try space
> > delimiters?
> >
> >
> >         d
> >         .
> >
>
>
> --
> Patrick Kidd Stinson
> http://www.patrickkidd.com/
> http://pkaudio.sourceforge.net/
> http://pksampler.sourceforge.net/
>


-- 
 [ signature omitted ]