strange phenomenon when use QFile with character ~
i want to create a file in /home/username/ so i write some codes like this
#define CONFIG_FILE_PATH "~/.config/xmlfile
QFile file(CONFIG_FILE_PATH);
if (!file.open(QFile:ReadOnly | QFile::Text))
{
if (!file.open(QFile::WriteOnly | QFile::Text))
{
//print error message
}
else
{
//dosomething
file.close();
}
}
but when i run the program, i cannot find "xmlfile" i tried
sudo find / -name *xmlfile*
but found nothing and the program do not show any error messages.
is there some rules with the character ~ when using QFile?
Thanks in advance.
No comments:
Post a Comment