summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidgetaction
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-04 14:04:40 +0100
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-04 14:12:09 +0100
commitff1bd9c821aa1e314d6ca738204cdd0ae60a8369 (patch)
treed653d7a683820b21762cc7a07d246dfb24033ee7 /tests/auto/qwidgetaction
parenta1ccc70d07235ac8f0a76c8d2393afc97f968060 (diff)
Fix crash in QMenu when using QWidgetAction
If the QWidgetAction is not the first in a menu, it crashed. This is because when the QEvent::ActionRemoved is sent, the event->before() is not set. We need to find another way to clean up the widgetItems list. This basically revert 4b6ab00e6d68c7 Reviewed-by: Thierry
Diffstat (limited to 'tests/auto/qwidgetaction')
-rw-r--r--tests/auto/qwidgetaction/tst_qwidgetaction.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/qwidgetaction/tst_qwidgetaction.cpp b/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
index 50b3337592..d25738fc38 100644
--- a/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
+++ b/tests/auto/qwidgetaction/tst_qwidgetaction.cpp
@@ -395,7 +395,9 @@ void tst_QWidgetAction::releaseWidgetCrash()
QMainWindow *w = new QMainWindow;
QAction *a = new CrashedAction(w);
QMenu *menu = w->menuBar()->addMenu("Test");
+ menu->addAction("foo");
menu->addAction(a);
+ menu->addAction("bar");
delete w;
}