summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidgetaction
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-04 13:04:40 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-04 13:12:09 (GMT)
commitff1bd9c821aa1e314d6ca738204cdd0ae60a8369 (patch)
treed653d7a683820b21762cc7a07d246dfb24033ee7 /tests/auto/qwidgetaction
parenta1ccc70d07235ac8f0a76c8d2393afc97f968060 (diff)
downloadQt-ff1bd9c821aa1e314d6ca738204cdd0ae60a8369.zip
Qt-ff1bd9c821aa1e314d6ca738204cdd0ae60a8369.tar.gz
Qt-ff1bd9c821aa1e314d6ca738204cdd0ae60a8369.tar.bz2
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 50b3337..d25738f 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;
}