Mixing Qt with Cocoa/MacOS X specific code

  • Hello,

    I'm fresh with Qt on Windows since 1 week and never developed with Xcode/Cocoa.

    The problem is the following: the behavior of the developed Qt application is not the same with Windows and Mac OS X, so I would need to tweak the code by adding a couple of Cocoa's lines of code when compiling the project on MacOS X. Since Cocoa is in Objective-C and not the main code application, do you have any idea or references pointing how to do that?


  • Many of the Objective C API can be used with C/C++ bindings in regular C. Also, Objective C++ should be usable within regular C++.

    As a last restort you can put your Objective C code into a separate source file and call the methods from C++.

  • Thanks Volker, I'll do this way and keep this thread updated.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.