Qt - How to get the "Temp" dir for an arbitrary user?

Narek picture Narek · Jun 22, 2010 · Viewed 13.8k times · Source

For each OS there is a location for storing temporary data. It could be like: C:/Users/[user name]/AppData/Temp (or so). How can I get this path independently from OS with QT?

Answer

mtvec picture mtvec · Jun 22, 2010

It is not possible to get the temp directory for an arbitrary user, but for the current user you can use QDir::temp() or QDir::tempPath().