how to get sharing document directory is something different with other qt platforms. IOS app always use files only in app's sandbox. So we just need to find it's sandbox directory. we may think following would work: QString docPath;
QDir dir;
docPath=dir.currentPath();
however in qt 5.5 IOS, it return only root directory "/", then we use another way: docPath=QCoreApplication::applicationDirPath(); result is "/private/var/mobile/Containers/Bundle/Application/D31978DF-1A05-4AB9-9C36-18EA2B9E5294/testXXX.app", is that the real sandbox directory? The answer is still no, because we can not show any files sync-in iPhone to testXXX app by iTunes. (in qt .pro file,
we add lines QMAKE_INFO_PLIST += aaa.plist in aaa.plist we add "UIFileSharingEnabled true" to enable file sharing with iTunes.) We have no patience to find other qt traditional way to solve this problem. We use mix IOS obj-c and qt c++ as follows: QString iOSObj::getDocDir(void) {
iOSObj::g_iOSObj = this;
//get Documents path NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *path=[paths objectAtIndex:0]; NSLog(@"path:%@",path);
QString temp = QString::fromNSString(path);
return temp; } Finally, the result is “/var/mobile/Containers/Data/Application/BB26B5E6-3340-4601-A81B-DE5362B1C938/Documents”