Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

To Subclass NSApplication in QApplication.



  • Hi,

    I am working on Qt4.7 on mac os 10.5.8(Leopard). I want to use cocoa application with Qt application, Can anybody suggest me how to subclass NSApplication within QApplication.

    Thanks & Regards,
    Neha



  • You might want to look at src/gui/util/qsystemtrayicon_mac.mm for some usage of NSApplication.



  • Thanks for the reply, If i want to use Qt Class function in Cocoa class, then how can i use it?



  • That depends on the class and method. Some of them (most notable the GUI classes and many QObject derived classes) need a Qt event loop running (which is usually achieved by starting exec() on a QApplication). Others do not depend on this (e.g. QString, the container classes, the XML classes) and can be used directly.



  • I want to call QtGui class function in cocoa class,, how can i call Qtcode class function in cocoa class, can you explain it with an example?



  • Sorry, I have never used Qt this way before, so I cannot provide a sample code.



  • Ok, not an issue, i will try to do something else.


Log in to reply