문제

I want qmake to create a sub directory in /home for my own config files like /home/user/.myapp. But how can I get the home directory path in qmake?

도움이 되었습니까?

해결책

QMake is a build system only available on the development machine at build time, and such won't help you to create directories on the machine where your software is deployed. To get storage locations at application runtime, use QStandardPaths (Qt 5) or QDesktopServices::storageLocation() (Qt 4). To get the user's home directory, use QDir::homePath(). Then simply create the required directories and files programmatically, in your program.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top