PDA

View Full Version : Get the 'My documents' directory or similar



qt_developer
24th April 2013, 12:29
Hi all,

I know the QDir::home() method and I get the next path:


C:/Users/qt_developer I want C:/Users/qt_developer/Documents

Is it possible to obtain the documents directory?

Kind regards.

Rhayader
24th April 2013, 12:49
In Qt 4 there is the QDesktopServices::storageLocation(StandardLocation type) where in your case StandardLocation is QDesktopServices:: DocumentsLocation

In Qt 5 there is something similar in QStandardPaths class

qt_developer
24th April 2013, 17:37
Thank you!