Details
-
Suggestion
-
Resolution: Out of scope
-
P4: Low
-
None
-
4.5.3
-
None
Description
It would be nice if it was possible to open a file through a QFile object by passing the file's path through a QDir object. For example, something like:
QFile file; QDir dir("/home/user/Documents"); file.setFileName(dir,"test.txt"); // this would point to "/home/user/Documents/test.txt" file.open(QIODevice::ReadOnly | QIODevice::Text);
Another alternative which would be excellent would be if QDir offered a method that returned a QFile object that pointed to a file in QDir's directory. So, for example:
QFile file; QDir dir("/home/user/Documents"); file = dir.getFile("test.txt"); // this would returnn a QFile object pointing to "/home/user/Documents/test.txt" file.open(QIODevice::ReadOnly | QIODevice::Text);