Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Regarding using QFile::readAll
Indrajeet last edited by
Is it a good idea to read the complete file using QFile::readAll and store in QString variable.
lgeyer last edited by
It heavily depends on your use case, the size of the file, the amount of memory available - and probably many other parameters. But in general it is perfectly legitimate to read files as a whole.
Yes, it can be a good idea to read a whole file using QFile::readAll().
No, it can be a bad idea to read a whole file using QFile::readAll().
dangelog last edited by
Which kind of question is that? It's not a matter of one-size-fits-all rules. If it makes sense for you (esp. regarding the memory allocation of such a thing) then do it. Just remember to properly decode the bytes of the file.