开发者

Qt or wxWidgets on Cocoa?

I was told that the newest Qt is Cocoa based, and as so, it's 64 bit. And Cocoa is Object-C based, whereas Qt is C++ based.

  • How is that possible? I mean, how C++ based library can turn into Objective-C related one? Is this just using Objective-C++?
  • Can any C++ library b开发者_如何转开发e Cocoa based using Objective-C++?


Objective-C++ lets you combine C++ and Objective-C in the same source file. So you can do interesting things here. For example, I've created C++ classes that call Cocoa things like NSNotification before.

So I suspect you'd just write in C++, calling C++ objects... which are implemented as C++ wrappers of Objective-C methods.

wxWidgets has a similar thing going on, wxCocoa, but last I heard that was the Mac platform of the future, meaning that they are still building it.


Objective C is a strict superset of C. That means any valid C program is compilable with an Objective C compiler. Since C++ is backwards compatible with C, connecting them is fairly trivial. The C++ part just needs to be aware of some of Objective C's runtime libraries.


Qt is C++, period. Interfacing one language with another (in this case C/C++/Objective-C/Objective-C++) can be quite straightforward.

Qt uses Cocoa by default, but can still be 32-bit, see http://doc.qt.nokia.com/4.7-snapshot/developing-on-mac.html for some general mac specific info.


Qt. Mixing Cocoa and Qt is easy peasy: http://www-sop.inria.fr/dream/blog/2009/03/mixing-cocoa-and-qt-through-carbon/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜