Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I point a folder in Documents folder?

Tags:

c++

qt

qt5

How can I point a folder or file which stored in Documents folder?

So in my case that would be C:/Users/Vanya/Documents/ATFolder (AT Folder is folder I need)

What should I put instead "Vanya" to get into Documents folder, on any PC not just mine

In case it matters I'm trying to do this:

QDir().mkdir("C:/Users/%USERPROFILE%/Documents/ATFolder");

It responds as false and doesn't create folder.

like image 251
Vanya Ryanichev Avatar asked Apr 19 '26 16:04

Vanya Ryanichev


1 Answers

Qt solution - QStandardPaths

Use QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); to get Documents directory.

like image 169
Macias Avatar answered Apr 23 '26 20:04

Macias



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!