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

For each OS, there is a place to store temporary data. It can be like: C: / Users / [username] / AppData / Temp (or so). How can I get this path regardless of OS with QT?

+7
c ++ qt temporary-files dir
source share
2 answers

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

+18
source share

You want to get QDesktopServices::TempLocation . See http://doc.trolltech.com/qtextended4.4/qdesktopservices.html#StandardLocation-enum for details.

+4
source share

All Articles