[Qt-creator] Determine if started through Qt Creator

Walter Stefan Stefan.Walter at lisec.com
Sun Mar 6 12:41:34 CET 2016


Dear Tobias,

I was also thinking as a workaround to use a startup script that defines a environment variable. I was just asking for a probably existing out of the box solution, instead of inventing my own solution.

Thanks and Regard,
Stefan

-----Original Message-----
From: Tobias Hunger [mailto:tobias.hunger at gmail.com] 
Sent: Sonntag, 6. März 2016 15:26
To: Walter Stefan <Stefan.Walter at lisec.com>
Cc: Nikos Chantziaras <realnc at gmail.com>; qt-creator at qt-project.org
Subject: Re: [Qt-creator] Determine if started through Qt Creator

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