Hi Everyone,
I know this topic has been discussed a lot in last decade but believe me I am posting my problem after reading all that stuff.
Motive of my program:
Fetch a file (basically image file) from the directory which I am doing using getOpenNewFile, which returns the name of file in QString format.
I want to convert that QString name in char* format.
Now the Problem
I have applied all techniques:
1) str[i] = static_cast<char>(Qstr.at(i).toAscii())
2) str[i] = static_cast<char>(Qstr.at(i).toLatin1())
and similarly for whole string.
but no success. My program is taking the file name successfully but returns segmentation fault just after that.
Please do tell me if there's any other method for doing this.
Thanks in advance.
Regards,
Prashant
Bookmarks