[Qt-interest] Using a Qt class in a non-Qt app?

Constantin Makshin dinosaur-rus at users.sourceforge.net
Wed Sep 30 21:57:08 CEST 2009


For GUI-less applications use QCoreApplication class instead of  
QApplication.

On Wed, 30 Sep 2009 23:40:37 +0400, Brant Sears <brant at mac.com> wrote:
> Hi. I have a Cocoa/Carbon application that I want to modify into a Qt
> application. The current application has a user interface written in
> Carbon & Cocoa. The Qt application will not have a UI - it will send
> xml based messages to another application which will display the user
> interface. Therefore, I would like to be able to add some of the Qt
> networking classes to my Carbon/Cocoa app first and work on sending
> the data across so that I can see that the UI between the original app
> and the new app is the same. Then as a last step, I would remove the
> Carbon/Cocoa User Interface.
>
> The problem I am having is that my slots are not getting called which
> I think is because I do not have a QApplication. Therefore, there
> isn't an application run loop dispatching these events.
>
> I could add such a thing, but then I would short circuit the
> NSApplication object that Cocoa uses.
>
> Any idea as to what I should do here?
>
> If not, my best idea is to try to port over the mac app into Qt a
> little bit at a time which will result in having a non-working app for
> a period of time (less desirable). So, before I go there, I wanted to
> ask if there is a way to use a QLocalSocket and have the slots be
> correctly called from a non-Qt app.
>
> Thanks for any advice.

-- 
Constantin Makshin



More information about the Qt-interest-old mailing list