Yvon,

If you are using Carbon, the following method should work for you:

extern qt_mac_set_native_menubar(bool flag);

and then prior to the instantiation of the QApplication instance you can 
execute it as follows:

qt_mac_set_native_menubar(false);


If you are using Cocoa, this method will not work yet. There is a bug in the Qt 
Cocoa port. Therefore, what you will need to do is back up the NSMenu reference 
prior to the creation of the QApplication instance inside your plug-in. After 
the QApplication instance has been instantiated, you will need to assign the 
backed up NSMenu reference to the NSApp. Something like this:

static QApplication *pqapp = NULL;

id menuBackupRef = [NSApp menu];
if  (!pqapp)
   pqapp = new QApplication(argc, argv);
[NSApp setMenu: menuBackupRef];

Hope this helps.

Yan

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yvon Guy
Sent: Wednesday, November 12, 2008 4:41 PM
To: [email protected]
Subject: Re: [Qt4-preview-feedback] QT 4.5 preview, running as a plugin

We created Qt 4.2 plugins for Mac (Carbon). The problem is that
QApplication thinks it's THE application, so it takes over the menubar
away from the host application.

I don't remember the details, but we had to change QApplication's source
code and tell it not to mess with the menubar. As far as I know Qt
doesn't provide a function for doing that otherwise.

Yvon

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Witteveen, Arnt
Sent: Wednesday, November 12, 2008 12:31 PM
To: [email protected]
Subject: [Qt4-preview-feedback] QT 4.5 preview, running as a plugin


Hi, I'm trying to make a plugin for Adobe Acrobat, on Mac OS X, and do
the plugin UI in QT. So far, I've created a new QApplication in the
plugin's initialisation routine (after compiling the 4.5 preview with
Cocoa support). Doing only this, Acrobat starts but everything that is
normally in it's menu bar is gone, and replaced by only the Apple symbol
and an Acrobat menu, that also has less entries than normal.

It looks like I need something like qt_mac_set_native_menubar or
qt_mac_set_menubar_merge, but at a first try those don't seem to help.
Is there anything else I can look at? If not, which of these 2 functions
would I need to call, and when (before or after creating the
QApplication)?

Also, while reading up on this, I noticed here:
http://doc.trolltech.com/4.5/exportedfunctions.html that it has
different documentation for the same function name
(qt_mac_set_dock_menu) twice (I see the same thing in the 4.4 docs).

Arnt

_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to