Start porting the Mac menu system to QPA.
authorMorten Sorvig <morten.sorvig@nokia.com>
Tue, 5 Jul 2011 13:02:39 +0000 (15:02 +0200)
committerMorten Sorvig <morten.sorvig@nokia.com>
Wed, 6 Jul 2011 07:59:36 +0000 (09:59 +0200)
commit4ed17a650847d4ad129478608e9697c909126263
treebddc9d0107bf05690b8b58a0fe73a337e59eb409
parent14757fedb2e4a92fb37a90a88485107909f4f5e1
Start porting the Mac menu system to QPA.

Global changes:
qglobal.h: remove code that sets Q_WS_MAC and
Q_MAC_USE_COCOA - this is dead code now. Add
qt_widget_helpers_mac_p.h/mm which will contain
helper functions needed for widgets on Qt 5.

Menu-related changes:
Set AA_DontUseNativeMenuBar before creating the
platform plugin. Change Q_WS_MAC to Q_OS_MAC in the
menu code. Remove Q_MAC_USE_COCOA defines and Carbon
code paths. Move some qt_mac helper functions only
used by the menu system to qmenu_mac.mm. #ifdef out
some code paths that require further porting.

Native menus are now disabled by default but can
be enabled by the QPA plugins that want them by
clearing AA_DontUseNativeMenuBar. Since we at compile
time don't know which plugin will be loaded the Mac
menu code is always included when building on OS X.
(The above is currently only relevant for the Cocoa
plugin.)
23 files changed:
src/corelib/global/qglobal.h
src/gui/kernel/qguiapplication.cpp
src/widgets/kernel/mac.pri
src/widgets/kernel/qaction.h
src/widgets/kernel/qapplication.cpp
src/widgets/platforms/mac/qapplication_mac.mm
src/widgets/platforms/mac/qcocoamenuloader_mac.mm
src/widgets/platforms/mac/qcocoamenuloader_mac_p.h
src/widgets/platforms/mac/qt_cocoa_helpers_mac.mm
src/widgets/platforms/mac/qt_cocoa_helpers_mac_p.h
src/widgets/platforms/mac/qt_widget_helpers_mac.mm [new file with mode: 0644]
src/widgets/platforms/mac/qt_widget_helpers_mac_p.h [new file with mode: 0644]
src/widgets/styles/qmacstyle_mac.mm
src/widgets/widgets/qcocoamenu_mac.mm
src/widgets/widgets/qcocoamenu_mac_p.h
src/widgets/widgets/qmenu.cpp
src/widgets/widgets/qmenu.h
src/widgets/widgets/qmenu_mac.mm
src/widgets/widgets/qmenu_p.h
src/widgets/widgets/qmenubar.cpp
src/widgets/widgets/qmenubar.h
src/widgets/widgets/qmenubar_p.h
src/widgets/widgets/widgets.pri