Re: [Interest] Q_OS_ANDROID macro

2015-02-05 Thread Francisco Ares
2015-02-04 16:32 GMT-02:00 Giuseppe D'Angelo giuseppe.dang...@kdab.com: Il 04/02/2015 11:18, Reinhardt Behm ha scritto: MOC does not understand and therefor does not respect macros and #ifdef. I'm sorry to be blunt, but this is simply false. moc has had a full C++ preprocessor since Qt 5.0.

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Giuseppe D'Angelo
Il 04/02/2015 11:05, Nuno Santos ha scritto: When compiling for Android, moc file as complaining about not having the implementation of the methods above which means that the preprocessor has passed over Q_OS_ANDROID, however, QtCreator had that area greyed out. Could you please send the

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Nuno Santos
Hi, I have found a workaround for the problem. I have included the BonjourRecord header because it doesn't have any dependency on dns_sd.h. This way I can safely declare the slots on the header. The main problem here is that the moc_ doesn't know about Q_OS_ANDROID when it is generated

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Giuseppe D'Angelo
Il 04/02/2015 11:18, Reinhardt Behm ha scritto: MOC does not understand and therefor does not respect macros and #ifdef. I'm sorry to be blunt, but this is simply false. moc has had a full C++ preprocessor since Qt 5.0. -- Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Software Engineer

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Thiago Macieira
On Wednesday 04 February 2015 19:32:56 Giuseppe D'Angelo wrote: Il 04/02/2015 11:18, Reinhardt Behm ha scritto: MOC does not understand and therefor does not respect macros and #ifdef. I'm sorry to be blunt, but this is simply false. moc has had a full C++ preprocessor since Qt 5.0. The

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Jürgen Hunold
Hi Nuno, Am Mittwoch, 4. Februar 2015, 18:52:52 schrieb Nuno Santos: I have found a workaround for the problem. I have included the BonjourRecord header because it doesn't have any dependency on dns_sd.h. This way I can safely declare the slots on the header. The main problem here is that

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Scott Aron Bloom
] On Behalf Of Nuno Santos Sent: Wednesday, February 04, 2015 2:21 AM To: Reinhardt Behm Cc: interest@qt-project.org Subject: Re: [Interest] Q_OS_ANDROID macro Hi, Thanks for your reply. How can I workaround this situation? Create a specific source file for Android? Any other ideas? Thanks, Nuno

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Giuseppe D'Angelo
Il 04/02/2015 19:52, Nuno Santos ha scritto: The main problem here is that the moc_ doesn't know about Q_OS_ANDROID when it is generated which will generate entry for the slots that shouldn't be there. Right, so it's the compiler complaining about moc-generated code, not moc itself... --

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Constantin Makshin
A bit ugly but simple solution is to remove that #ifndef from the header file and put it to slot method definitions, i.e.: // header file public slots: void recordAdded(const BonjourRecord record); void recordRemoved(const BonjourRecord record); void bonjourRecordResolved(const

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Reinhardt Behm
On Wednesday 04 February 2015 10:05:12 Nuno Santos wrote: Hi, I have been faced with an awkward situation when building an app for android: My app uses Bonjour but that is not available on Android, so basically for android I don’t want to include some slots in a particular class:

[Interest] Q_OS_ANDROID macro

2015-02-04 Thread Nuno Santos
Hi, I have been faced with an awkward situation when building an app for android: My app uses Bonjour but that is not available on Android, so basically for android I don’t want to include some slots in a particular class: #ifndef Q_OS_ANDROID void recordAdded(const BonjourRecord record); void

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Reinhardt Behm
-- Best Regards Reinhardt Behm mailto: rb...@hushmail.com Skype: reinhardt.behm A different header file is possible but a bit messy solution. You can use the macro in the .cpp to create one real slot function and one for android which is just an empty dummy. Moc does not care what you do in

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Nuno Santos
Hi, Thanks for your reply. How can I workaround this situation? Create a specific source file for Android? Any other ideas? Thanks, Nuno On 04 Feb 2015, at 10:18, Reinhardt Behm rb...@hushmail.com wrote: On Wednesday 04 February 2015 10:05:12 Nuno Santos wrote: Hi, I have been faced

Re: [Interest] Q_OS_ANDROID macro

2015-02-04 Thread Francisco Ares
moc conversion will not pre- or post-process anything, so this phase should not be your problem, as moc files are generated from your header files, and only after this generation, the compile phase takes place, and for sure, the compiler should care about macro definitions. could you post how the