user3819226
user3819226

Reputation: 481

How to get the ios document/library path through Qt5?

I used find my ios app's document/library path by going up starts from QApplication::applicationDirPath().

However from iOS 7/8, the bundle path is moved away from data path.

So how can I get my app's writable paths through Qt C++ only? Is there a correct way that packed with Qt?

I don't want to write on APPROOT's document. And I understand that I can write objective-c codes to find the path.

So my app is installed at:

/var/mobile/Containers/Bundle/Application/XXXX/

What I want to get is

/var/mobile/Containers/Data/Application/YYYY/Documents

/var/mobile/Containers/Data/Application/YYYY/Library

note that the bundle's long id (the XXXX) is different from Data's (the YYYY)

Upvotes: 0

Views: 723

Answers (1)

VP.
VP.

Reputation: 16705

If you need to take the document or any other standard library directories path, use QStandardPaths from Qt5:

QStandardPaths::AppDataLocation

For other paths consider to read the official Qt docs about QStandardPaths

Upvotes: 1

Related Questions