diff options
author | James Turner <james.turner@kdab.com> | 2012-05-04 14:16:05 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-19 10:18:21 +0200 |
commit | b8246f08e49eb672974fd3d3d972a5ff13c1524d (patch) | |
tree | 509ab759670f0b24aa8d44ced0584fc2832f5e76 /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | 899f1d35a435fd499c73b29aabb6a609d496e5ed (diff) |
Cocoa implementation of QPA menu interface.
Implement the QPA platform menu interface for Cocoa,
including native menubar support and merging with the
predefined menus created from the bundled .nib. Cleanup
code previously used to maintain the menus, and add
a manual test of the menus code.
Change-Id: Ia99267ddb6485e18e05c540eb32c5aee6cbb85db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 5480b32083..880292b24a 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -100,8 +100,12 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) , m_synchedWindowState(Qt::WindowActive) , m_inConstructor(true) , m_glContext(0) + , m_menubar(0) , m_hasModalSession(false) { +#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG + qDebug() << "QCocoaWindow::QCocoaWindow" << this; +#endif QCocoaAutoReleasePool pool; m_contentView = [[QNSView alloc] initWithQWindow:tlw platformWindow:this]; @@ -577,3 +581,13 @@ bool QCocoaWindow::setWindowModified(bool modified) [m_nsWindow setDocumentEdited:(modified?YES:NO)]; return true; } + +void QCocoaWindow::setMenubar(QCocoaMenuBar *mb) +{ + m_menubar = mb; +} + +QCocoaMenuBar *QCocoaWindow::menubar() const +{ + return m_menubar; +} |