diff options
author | Juan A. Suarez Romero <jasuarez@igalia.com> | 2010-11-15 19:51:54 +0100 |
---|---|---|
committer | Dominik Kapusta <dominik.kapusta@teleca.com> | 2010-12-14 11:28:21 +0100 |
commit | 9c3d68f7c4da22cee1ce8c51505c159b06880635 (patch) | |
tree | a190403468425fc5df97f53627481399ed0d7588 | |
parent | 1edbb4c2e7d905e6144eedb85281823476911bfd (diff) |
Fixes: NB#171569 - (EveryLocation) Adding MAction with MAction::EveryLocation causes unexpected behavior
RevBy: Jukka Halonen, Dominik Kapusta
Details:
Ignore context menu event in MToolBar.
When adding a MAction through ObjectMenuLocation (EveryLocation uses
also this location), context menu is used to show the action.
MToolBar does not require this kind of location, as it has other
specific locations (icon button and menu button) that are more
suitable.
So summing up, ObjectMenuLocation (and hence context menu event) is
ignored for MToolBar.
-rw-r--r-- | src/corelib/widgets/mtoolbar.cpp | 6 | ||||
-rw-r--r-- | src/corelib/widgets/mtoolbar.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/widgets/mtoolbar.cpp b/src/corelib/widgets/mtoolbar.cpp index 96c61fe1..9a53fb10 100644 --- a/src/corelib/widgets/mtoolbar.cpp +++ b/src/corelib/widgets/mtoolbar.cpp @@ -22,6 +22,7 @@ #include <MDebug> #include <QGraphicsLinearLayout> +#include <QGraphicsSceneContextMenuEvent> #include "mtheme.h" #include "mwidgetaction.h" @@ -71,3 +72,8 @@ MToolBar::~MToolBar() { } +void MToolBar::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) +{ + event->ignore(); +} + diff --git a/src/corelib/widgets/mtoolbar.h b/src/corelib/widgets/mtoolbar.h index 0942e22e..710a5cb7 100644 --- a/src/corelib/widgets/mtoolbar.h +++ b/src/corelib/widgets/mtoolbar.h @@ -144,6 +144,10 @@ protected: */ MToolBar(MToolBarPrivate *dd, MWidgetModel *model, QGraphicsItem *parent); + //! \reimp + virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); + //! \reimp_end + Q_DECLARE_PRIVATE(MToolBar) private: |