I need a similar to .NET method for safely combining path parts without worrying for platform specifics of the path separator.
Is there such class and method in QT4?
I don't know of anything exactly like that, but you can get close by using QDir::cd()
:
QDir path("base_path");
path.cd("subdir");
Unfortunately, I think that only works for directories, not files. For files, you could use QDir::filePath()
:
QDir path("base_path");
QString file_path = path.filePath("file.txt");