[Qt-interest] QCompleter with QDirModel on OS X can not reach External Disk Drives?
Mike Jackson
imikejackson at gmail.com
Fri Aug 21 16:41:23 CEST 2009
On 2009-08-21 10:25:05 -0400, Mike Jackson <imikejackson at gmail.com> said:
> I have the following bit of code:
>
> QCompleter *completer = new QCompleter(this);
> QDirModel* model = new QDirModel(completer);
> QStringList nameFilters;
> nameFilters << "*.mxa" << "*.h5" << "*.hdf5";
> model->setNameFilters(nameFilters);
> model->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot |
> QDir::System);
> completer->setModel(model);
> mxaFile->setCompleter(completer);
> // mxaFile is a QLineEdit
>
> The problem is that none of my External disk drives are listed. They
> are mounted in /Volumes on OS X. The /Volumes isn't even listed as a
> possible completion either.
>
> Is there a way to have QDirModel list the all the mounted Disk Drives on OS X?
>
> Thanks
> _________________________________________________________
> Mike Jackson mike.jackson at bluequartz.net
> BlueQuartz Software www.bluequartz.net
> Principal Software Engineer Dayton, Ohio
Just to follow up a bit. I had to add "QDir::Hidden" to the list of
filters to be able to see the mounted drives. Except now I see _all_
the hidden directories. Probably have to subclass QDirModel to
customize it to my liking.
--
Mike
More information about the Qt-interest-old
mailing list