Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top