PDA

View Full Version : Using QCompleter with QFileSystemModel



Marga
21st October 2011, 10:52
Hello all!

I have a problem using QCompleter with QFileSystemModel.
My code is:



dirModel = new QFileSystemModel(this);
dirModel->setRootPath(QDir::currentPath());
lineEdit = new QLineEdit(/*here a tool bar I am using*/);
completer = new QCompleter(lineEdit);
lineEdit->setCompleter(completer);
completer->setModel(dirModel);


When I type something in the lineEdit, all I the suggestions I get from the completer is the root "/".

Does someone know what I am missing here??

Thanks a lot in advance!!!!!!