[Qt-interest] Qt in QuickTime exporter UI
Pavel Koshevoy
pavel at aragog.com
Wed Apr 8 18:08:30 CEST 2009
Pavel Koshevoy wrote:
> Hi,
>
> I am wondering if it is possible to tell Qt not to mess with the Mac
> menubar, it's causing us difficulties. We have a QuickTime exporter
> plugin that uses a Qt dialog for specifying compression settings. When
> we exec() the Qt dialog the QuickTime player menubar is replaced by Qt.
> When the dialog event loop exits and QApplication is destroyed the
> original QuickTime player menu bar is not restored, and the user has no
> choice but to Quit the QuickTime player (via dock icon menu).
>
> This was observed on Leopard, Qt 4.4.3, static Qt libs.
>
> Pavel.
>
>
FYI,
Here is the reply we've got from Qt support:
When you call exec(), Qt will set it's own menubar. On windows this is a per window menu bar, and therefore not a problem. In a pure Qt application on Mac on the other hand, each window can have a menu bar, and the window shown must set it's own menu bar.
Because of this issue, we have added an ApplicationAttribute to Qt 4.5 called Qt::AA_MacPluginApplication
http://doc.qtsoftware.com/4.5/qt.html#ApplicationAttribute-enum
If you don't have the possibility to upgrade to Qt 4.5, I would recommend not setting a QMenuBar at all, if possible. If this is not possible, you can try to set the qt_mac_set_native_menu_bar(false) to work around this. This will give you a menu bar on the window, and not as a native menu bar. See the doc for how to d this here:
http://doc.qtsoftware.com/4.5/exportedfunctions.html#void-qt-mac-set-native-menubar-bool-enable
More information about the Qt-interest-old
mailing list