[Qt-creator] Determine if started through Qt Creator

Tobias Hunger tobias.hunger at gmail.com
Sun Mar 6 12:25:40 CET 2016


Hello Stefan,

On Sun, Mar 6, 2016 at 11:19 AM, Walter Stefan <Stefan.Walter at lisec.com> wrote:
> Thanks, but is there not a more generic way. I don't want to set this in every single project.

We try hard to make sure there is *no* difference between running a
application in Qt Creator and outside of Qt Creator:-)

If you need one, then you need to define your own conventions. Setting
a environment variable is one convenient way to do that, just as Nikos
suggested.

You can set those variables in build-/run settings of the project
itself. This offers a very fine-grained control over what is run in
"QtCreator mode" and what not.

You can also defined environment variables on our kits. That way they
will be set by default in all projects that use those kits.

You can set the variable before starting Qt Creator (e.g. in a
script/bat-file) and the variable will be handed down to any build/run
using the system environment. By default all projects are built using
a slightly modified systems environment and will then use the same
environment to run the applications later.

There are probably more ways to accomplish what you want. You are a
programmer, you will figure out the best approach for your individual
setup:-)

Best Regards,
Tobias



More information about the Qt-creator mailing list