PDA

View Full Version : QtFileDialog: Mode Question!



Mokster
21st April 2006, 21:41
Hi,

I am trying to implement a "delete folder" button as an addition to the existing File Manager. I am using QT: 3.3.4

I get the following problem:

When a user clicks on a folder in "AnyFile" mode, I get the following string back from selectedFile()

"/"

Yep just a slash. So what I try to do is switch back to the Directory mode and get the string back this time hopefully with a folder's name in it. Do my directory operation and then switch back to AnyFile mode.



if (selectedFile() == "/")
{
setMode(QFileDialog::Directory);
qDebug(selectedFile());
}


However instead of the just the "/", I just get back the working directory and nothing else. I get the absolute path of where the directory I clicked on is located but no name of the directory itself. Has anyone else ran into this problem when trying to use a delete folder operation?

Thanks in advance.