Qt-interest Archive, April 2007
QtGui macro defined?
Message 1 in thread
Is there a macro defined automatically as a result of using "QT += gui".
Specifically, I have a set of code that needs to compile as both a
client-side library and a server-side library. On the server side, I use
"QT -= gui", and there is one part of the API I want to hide at compile
time, since it uses things like QSizePolicy that are only available in
the QtGui module. What I was hoping for would look like this:
class MyServerFoo
{
public:
#ifdef QT_GUI
QSizePolicy getSizePolicy() const;
#endif
};
Any ideas? I've searched through QtGlobal in Assistant with no luck.
--Dave
--
[ signature omitted ]
Message 2 in thread
On 04.04.07 15:37:43, Dave Smith wrote:
> Is there a macro defined automatically as a result of using "QT += gui".
> Specifically, I have a set of code that needs to compile as both a client-side
> library and a server-side library. On the server side, I use "QT -= gui", and
> there is one part of the API I want to hide at compile time, since it uses
> things like QSizePolicy that are only available in the QtGui module. What I was
> hoping for would look like this:
Look at the compiler commands generated and executed, they contain stuff
like -DFOO, one of them is QT_GUI_LIB, which you can use to check
Andreas
--
[ signature omitted ]
Message 3 in thread
Andreas Pakulat wrote:
> On 04.04.07 15:37:43, Dave Smith wrote:
>
>> Is there a macro defined automatically as a result of using "QT += gui".
>> Specifically, I have a set of code that needs to compile as both a client-side
>> library and a server-side library. On the server side, I use "QT -= gui", and
>> there is one part of the API I want to hide at compile time, since it uses
>> things like QSizePolicy that are only available in the QtGui module. What I was
>> hoping for would look like this:
>>
>
> Look at the compiler commands generated and executed, they contain stuff
> like -DFOO, one of them is QT_GUI_LIB, which you can use to check
>
Wonderful! Thanks. I should have been looking at the command line
instead of qglobal.h. :)
--Dave
--
[ signature omitted ]
Message 4 in thread
Hi,
> Wonderful! Thanks. I should have been looking at the command line
> instead of qglobal.h. :)
Note however that these macros are no part of the Qt API as far as I
know, so they could disappear from a future version.
--
[ signature omitted ]