summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-05-28 15:24:53 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2009-05-28 15:26:48 (GMT)
commit4a82680736ace8abb46e6fb5e085e8622f154b2d (patch)
tree705f3a32a82f63182a579841d4cff9d0e7a9667f /src/gui/graphicsview
parent8e4300e2866fd28881853509df6ff054e13f841b (diff)
downloadQt-4a82680736ace8abb46e6fb5e085e8622f154b2d.zip
Qt-4a82680736ace8abb46e6fb5e085e8622f154b2d.tar.gz
Qt-4a82680736ace8abb46e6fb5e085e8622f154b2d.tar.bz2
Fix a ASSERT/Crash when adding two times the same QAction to a QGW.
We were adding two times in the QActionPrivate list the entry for the current QGraphicsWidget if the action was existing before. Task-number:KDE Reviewed-by:bnilsen BT:yes
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicswidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp
index 7f02fb9..7781258 100644
--- a/src/gui/graphicsview/qgraphicswidget.cpp
+++ b/src/gui/graphicsview/qgraphicswidget.cpp
@@ -1887,8 +1887,10 @@ void QGraphicsWidget::insertAction(QAction *before, QAction *action)
}
d->actions.insert(pos, action);
- QActionPrivate *apriv = action->d_func();
- apriv->graphicsWidgets.append(this);
+ if (index == -1) {
+ QActionPrivate *apriv = action->d_func();
+ apriv->graphicsWidgets.append(this);
+ }
QActionEvent e(QEvent::ActionAdded, action, before);
QApplication::sendEvent(this, &e);