Qt and Objective-C



  • Is there any way to develop a Qt application using Objective-C as language?



  • Don't know if any bindings exist. But they don't really mix well, so better to use Qt instead of Objective C.



  • @Esdras Beleza: I am just wondering, why would you like to use an ObjectiveC/Qt combination?



  • @Stavros:

    I was just wondering about learning Objective-C someday. :) And since I'm interested in Qt (I've been learning it for some weeks) I'd like to know if I could learn both.



  • @Esdras: Well, my personal preference for use with Qt is C++. ;)



  • @Stavros, I like Qt in C++ and PyQt. :) I was just thinking about learn Objective-C and a Qt project would be a good start. Maybe there's some way of get C++ and Objective-C in the same project, but I think this kind of Frankenstein wouldn't mix very well, as @QtK said.



  • @Esdras: If you want to learn Objective C go ahead and learn it (I suppose you are interested in Mac OS X's applications development, so you need Objective-C/Cocoa). However, I agree that "mixing" objective-C with Qt is not an option, as far as I know. :)



  • Qt on mac already contain Objective-C code for native integration with Cocoa framework.
    And there are some helpers methods to convert from Qt to Cocoa objects in Qt src. Look inside Qt sources, and pay attention to Cocoa integration.
    Mixing on Objective-C and C++ is not "Frankenstain" and sometimes useful.
    Embedding C++ code to Cocoa projects is normal practice, and as you know, Qt is C++. Moreover, gcc used for compiling both C++ and objective-C code, at least on Mac.

    Try it, and don't be afraid. Experimentation is the best way to learn something and give some extra skills and experiences.



  • [quote author="rule" date="1278412954"]Qt on mac already contain Objective-C code for native integration with Cocoa framework.
    And there are some helpers methods to convert from Qt to Cocoa objects in Qt src. Look inside Qt sources, and pay attention to Cocoa integration.
    Mixing on Objective-C and C++ is not "Frankenstain" and sometimes useful.
    Embedding C++ code to Cocoa projects is normal practice, and as you know, Qt is C++. Moreover, gcc used for compiling both C++ and objective-C code, at least on Mac.

    Try it, and don't be afraid. Experimentation is the best way to learn something and give some extra skills and experiences. [/quote]

    Interesting analysis from @rule! ;)

    However, I was aware that mixing C++ with Objective-C is a procedure that is being used, but mixing C++/Qt with Objective-C ... ?



  • See this website and you know how to do it
    https://el-tramo.be/blog/mixing-cocoa-and-qt/


Log in to reply
 

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