diff options
Diffstat (limited to 'src/gui/widgets/qmenubar.cpp')
-rw-r--r-- | src/gui/widgets/qmenubar.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 741916a..98e62b7 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -733,6 +733,12 @@ void QMenuBarPrivate::init() q->hide(); } #endif +#ifdef Q_OS_SYMBIAN + symbianCreateMenuBar(q->parentWidget()); + if(symbian_menubar) + q->hide(); +#endif + q->setBackgroundRole(QPalette::Button); oldWindow = oldParent = 0; #ifdef QT3_SUPPORT @@ -782,6 +788,10 @@ QMenuBar::~QMenuBar() if (qt_wince_is_mobile()) d->wceDestroyMenuBar(); #endif +#ifdef Q_OS_SYMBIAN + Q_D(QMenuBar); + d->symbianDestroyMenuBar(); +#endif } /*! @@ -1036,6 +1046,12 @@ void QMenuBar::setVisible(bool visible) if(d->wce_menubar) return; #endif +#ifdef Q_OS_SYMBIAN + Q_D(QMenuBar); + if(d->symbian_menubar) + return; +#endif + QWidget::setVisible(visible); } @@ -1293,6 +1309,17 @@ void QMenuBar::actionEvent(QActionEvent *e) d->wce_menubar->syncAction(e->action()); } #endif +#ifdef Q_OS_SYMBIAN + if(d->symbian_menubar) { + if(e->type() == QEvent::ActionAdded) + d->symbian_menubar->addAction(e->action(), d->symbian_menubar->findAction(e->before())); + else if(e->type() == QEvent::ActionRemoved) + d->symbian_menubar->removeAction(e->action()); + else if(e->type() == QEvent::ActionChanged) + d->symbian_menubar->syncAction(e->action()); + } +#endif + if(e->type() == QEvent::ActionAdded) { connect(e->action(), SIGNAL(triggered()), this, SLOT(_q_actionTriggered())); connect(e->action(), SIGNAL(hovered()), this, SLOT(_q_actionHovered())); @@ -1379,6 +1406,11 @@ void QMenuBarPrivate::handleReparent() if (qt_wince_is_mobile() && wce_menubar) wce_menubar->rebuild(); #endif +#ifdef Q_OS_SYMBIAN + if (symbian_menubar) + symbian_menubar->rebuild(); +#endif + } #ifdef QT3_SUPPORT @@ -1617,6 +1649,8 @@ QSize QMenuBar::minimumSizeHint() const const bool as_gui_menubar = !d->mac_menubar; #elif defined (Q_OS_WINCE) const bool as_gui_menubar = !d->wce_menubar; +#elif defined (Q_OS_SYMBIAN) + const bool as_gui_menubar = !d->symbian_menubar; #else const bool as_gui_menubar = true; #endif @@ -1677,6 +1711,8 @@ QSize QMenuBar::sizeHint() const const bool as_gui_menubar = !d->mac_menubar; #elif defined (Q_OS_WINCE) const bool as_gui_menubar = !d->wce_menubar; +#elif defined (Q_OS_SYMBIAN) + const bool as_gui_menubar = !d->symbian_menubar; #else const bool as_gui_menubar = true; #endif @@ -1740,6 +1776,8 @@ int QMenuBar::heightForWidth(int) const const bool as_gui_menubar = !d->mac_menubar; #elif defined (Q_OS_WINCE) const bool as_gui_menubar = !d->wce_menubar; +#elif defined (Q_OS_SYMBIAN) + const bool as_gui_menubar = !d->symbian_menubar; #else const bool as_gui_menubar = true; #endif |