質問

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