July 6, 2010

rule rule
Lab Rat
5 posts

macro for Qt Simulator in .pro and source files.

 

Hello, I just want to know is there are any way to know, that we are building application for Qt Simulator target.
For example, for Maemo5 device in .pro file I can make branch by maemo5 directive:

  1. maemo5 {
  2.     dosomething
  3. }

and in the .cpp and .h files I can check by Q_WS_MAEMO_5 macro:
  1. #if defined(Q_WS_MAEMO_5)
  2.  dothomething
  3. #endif

But what about Qt Simulator, is there any predefined macro and directive for it?
Surely, I can pass something like “DEFINES+=QT_SIMULATOR” to qmake, and check it in the .pro and sources.

  1. contains($$DEFINES,"QT_SUMULATOR") {
  2. doSomething
  3. }

But it’s not good solution, it’s only workaround.

4 replies

July 6, 2010

QtK QtK
Lab Rat
1045 posts

It seems as of now there are only workarounds

Another one is discussed here [discussion.forum.nokia.com].

July 9, 2010

silvansky silvansky
Lab Rat
7 posts

for now there is QT_SIMULATOR macro for source files (in the latest Nokia Qt SDK)
but I don’t know if there is somethong for .pro files

UPD:
in .pro files you can use

simulator { # do something
}

July 9, 2010

rule rule
Lab Rat
5 posts

silvansky wrote:
for now there is QT_SIMULATOR macro for source files (in the latest Nokia Qt SDK)
but I don't know if there is somethong for .pro files

UPD:
in .pro files you can use

simulator { # do something
}

O, It’s brilliant, Just I need. Thank you a lot.

July 10, 2010

QtK QtK
Lab Rat
1045 posts

silvansky wrote:
for now there is QT_SIMULATOR macro for source files (in the latest Nokia Qt SDK)
but I don't know if there is somethong for .pro files

UPD:
in .pro files you can use

simulator { # do something
}

Thank you

 
  ‹‹ Timing diagram like a things.....      Android platform ››

You must log in to post a reply. Not a member yet? Register here!