Sergex
5th April 2013, 16:16
Hello,
I have an application in which I need to save files into a directory. First I have a QDialog in which I fill in some information through combo-boxes and Line edits and when hitting the OK button I want to create a directory with a specified name in the home directory.
So if I set the name to "myDirectory" I want to be able to see (in Windows explorer for example) a folder created with the name "myDirectory" to later save files into that folder. The whole path would be C:/Users/home/myDirectory
I tried doing something like this:
void myDialog::createDirectory()
{
QString filePath = QDir::homePath() + "/" + m_Name;
QDir dir;
dir.mkdir(m_Name);
}
What am I missing to make this work??
Thank you.
I have an application in which I need to save files into a directory. First I have a QDialog in which I fill in some information through combo-boxes and Line edits and when hitting the OK button I want to create a directory with a specified name in the home directory.
So if I set the name to "myDirectory" I want to be able to see (in Windows explorer for example) a folder created with the name "myDirectory" to later save files into that folder. The whole path would be C:/Users/home/myDirectory
I tried doing something like this:
void myDialog::createDirectory()
{
QString filePath = QDir::homePath() + "/" + m_Name;
QDir dir;
dir.mkdir(m_Name);
}
What am I missing to make this work??
Thank you.