[Qt-interest] Cocoa Qt version and keyboard shortcutsnot working

Richard Moe Gustavsen richard.gustavsen at nokia.com
Mon Mar 15 15:46:41 CET 2010


When mixing Qt into a native cocoa application (or using Qt as a  
plugin), remember to set AA_MacPluginApplication before createing  
QApplication, e.g:

QApplication::setAttribute(Qt::AA_MacPluginApplication);
new QApplication(c, (char **)0, 0);

And then you don't have to call QApplication::exec() for Qt to work.

Also, Qt-4.7 will contain several bug fixes that makes Qt behave more  
nicely with native Cocoa apps.

-Richard

On Mar 11, 2010, at 10:17 PM, ext Murphy, Sean M. wrote:

>>>> I'm using Qt in a Photoshop plugin and I see that when using the
>>>> Cocoa version of Qt, none of my keyboard shortcuts on my toolbar
>>>> QActions trigger.
>>> I don't have an answer, but had a question for you about plugins.
> Did
>>> you have to do anything "weird" to get the Qt event loop to spin for
>>> your plugin?  Last year I wrote a plugin for a non-Qt application,
> and
>>> struggled quite a bit to get Qt's event loop to spin, without
> blocking
>>> the host application's event loop.  This other application makes
>>> blocking calls to running plugins, so my plugin couldn't call exec()
> or
>>> the host application locks up until my plugin returns from exec().
>>>
>>> I've got no experience with Photoshop plugins, but was just curious
> if
>>> you ran into similar issues with what you're doing...
>>
>> No, I didn't have these problems with Photoshop. I had other  
>> problems,
>> like Qt interfering with the host app's menubar, but I found ways of
>> disabling that.
>
> So you were able to just create a QApplication in the plugin, and then
> exec() that QApplication, so for the most part, Qt just operated like
> normal?
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest


/**
  Richard Moe Gustavsen
  Software Engineer II, Platform Team
  Nokia Norge AS / Qt Development Frameworks
  Sandakerveien 116, 0484 Oslo, Norway
**/




More information about the Qt-interest-old mailing list