diff options
Diffstat (limited to 'src/widgets/widgets/qmenubar.cpp')
-rw-r--r-- | src/widgets/widgets/qmenubar.cpp | 83 |
1 files changed, 4 insertions, 79 deletions
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 8b5f370fc3..a77c0f9753 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -64,10 +64,6 @@ #include "qmenubar_p.h" #include "qdebug.h" -#ifdef Q_OS_WINCE -extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp -#endif - QT_BEGIN_NAMESPACE class QMenuBarExtension : public QToolButton @@ -695,16 +691,6 @@ void QMenuBarPrivate::init() if (platformMenuBar) q->hide(); -#ifdef Q_OS_WINCE - if (qt_wince_is_mobile()) { - wceCreateMenuBar(q->parentWidget()); - if(wce_menubar) - q->hide(); - } - else { - QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true); - } -#endif q->setBackgroundRole(QPalette::Button); handleReparent(); q->setMouseTracking(q->style()->styleHint(QStyle::SH_MenuBar_MouseTracking, 0, q)); @@ -754,11 +740,6 @@ QMenuBar::~QMenuBar() Q_D(QMenuBar); delete d->platformMenuBar; d->platformMenuBar = 0; - -#ifdef Q_OS_WINCE - if (qt_wince_is_mobile()) - d->wceDestroyMenuBar(); -#endif } /*! @@ -1124,11 +1105,13 @@ void QMenuBar::keyPressEvent(QKeyEvent *e) key_consumed = false; } +#ifndef QT_NO_SHORTCUT if (!key_consumed && e->matches(QKeySequence::Cancel)) { d->setCurrentAction(0); d->setKeyboardMode(false); key_consumed = true; } +#endif if(!key_consumed && (!e->modifiers() || @@ -1225,11 +1208,7 @@ void QMenuBar::actionEvent(QActionEvent *e) d->itemsDirty = true; if (d->platformMenuBar) { -#if !defined(Q_OS_WINCE) QPlatformMenuBar *nativeMenuBar = d->platformMenuBar; -#else - QMenuBarPrivate::QWceMenuBarPrivate *nativeMenuBar = d->wce_menubar; -#endif if (!nativeMenuBar) return; @@ -1381,11 +1360,6 @@ void QMenuBarPrivate::handleReparent() platformMenuBar->handleReparent(0); } } - -#ifdef Q_OS_WINCE - if (qt_wince_is_mobile() && wce_menubar) - wce_menubar->rebuild(); -#endif } /*! @@ -1445,6 +1419,7 @@ bool QMenuBar::event(QEvent *e) case QEvent::Show: d->_q_updateLayout(); break; +#ifndef QT_NO_SHORTCUT case QEvent::ShortcutOverride: { QKeyEvent *kev = static_cast<QKeyEvent*>(e); //we only filter out escape if there is a current action @@ -1454,8 +1429,7 @@ bool QMenuBar::event(QEvent *e) } } break; - - +#endif #ifndef QT_NO_WHATSTHIS case QEvent::QueryWhatsThis: e->setAccepted(d->whatsThis.size()); @@ -1846,55 +1820,6 @@ QPlatformMenuBar *QMenuBar::platformMenuBar() } /*! - \since 4.4 - - Sets the default action to \a act. - - The default action is assigned to the left soft key. The menu is assigned - to the right soft key. - - Currently there is only support for the default action on Windows - Mobile. On all other platforms this method is not available. - - \sa defaultAction() -*/ - -#ifdef Q_OS_WINCE -void QMenuBar::setDefaultAction(QAction *act) -{ - Q_D(QMenuBar); - if (d->defaultAction == act) - return; - if (qt_wince_is_mobile()) - if (d->defaultAction) { - disconnect(d->defaultAction, SIGNAL(changed()), this, SLOT(_q_updateDefaultAction())); - disconnect(d->defaultAction, SIGNAL(destroyed()), this, SLOT(_q_updateDefaultAction())); - } - d->defaultAction = act; - if (qt_wince_is_mobile()) - if (d->defaultAction) { - connect(d->defaultAction, SIGNAL(changed()), this, SLOT(_q_updateDefaultAction())); - connect(d->defaultAction, SIGNAL(destroyed()), this, SLOT(_q_updateDefaultAction())); - } - if (d->wce_menubar) { - d->wce_menubar->rebuild(); - } -} - -/*! - \since 4.4 - - Returns the current default action. - - \sa setDefaultAction() -*/ -QAction *QMenuBar::defaultAction() const -{ - return d_func()->defaultAction; -} -#endif - -/*! \fn void QMenuBar::triggered(QAction *action) This signal is emitted when an action in a menu belonging to this menubar |