June 20, 2011

nehaR nehaR
Lab Rat
8 posts

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

6 replies

June 20, 2011

Volker Volker
Robot Herder
5428 posts

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

June 22, 2011

nehaR nehaR
Lab Rat
8 posts

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

June 23, 2011

Volker Volker
Robot Herder
5428 posts

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.

June 23, 2011

nehaR nehaR
Lab Rat
8 posts

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?

June 23, 2011

Volker Volker
Robot Herder
5428 posts

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

June 23, 2011

nehaR nehaR
Lab Rat
8 posts

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

 
  ‹‹ Printer - One Record per page.      [Moved] Qt svg image not displayed upon running my appln ››

You must log in to post a reply. Not a member yet? Register here!