summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsproxywidget
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@trolltech.com>2009-10-01 12:45:52 +0200
committerAlexis Menard <alexis.menard@trolltech.com>2009-10-01 12:47:17 +0200
commit3b37aff1e6c641290c155a6aa14d83167725556b (patch)
treea73dd07e601803ed8f121e43e83dd6603d3b7417 /tests/auto/qgraphicsproxywidget
parenta7273386adb9399ecdc7b7c8f4b041099db042ef (diff)
Fix auto-test that was crashing on Mac Carbon.
If you let top level widget hanging around with a broken state it may crash when a process event is triggered. Reviewed-by:ogoffart
Diffstat (limited to 'tests/auto/qgraphicsproxywidget')
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 00fae2f514..e70d286842 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -3059,6 +3059,8 @@ void tst_QGraphicsProxyWidget::deleteProxyForChildWidget()
proxy->setWidget(0);
//just don't crash
+ QApplication::processEvents();
+ delete combo;
}
void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget_data()
@@ -3090,11 +3092,17 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget()
if (bypass)
flags |= Qt::BypassGraphicsProxyWidget;
QFileDialog *dialog = new QFileDialog(widget, flags);
+ dialog->setOption(QFileDialog::DontUseNativeDialog, true);
dialog->show();
QCOMPARE(proxy->childItems().size(), bypass ? 0 : 1);
if (!bypass)
QCOMPARE(((QGraphicsProxyWidget *)proxy->childItems().first())->widget(), (QWidget *)dialog);
+
+ dialog->hide();
+ QApplication::processEvents();
+ delete dialog;
+ delete widget;
}
static void makeDndEvent(QGraphicsSceneDragDropEvent *event, QGraphicsView *view, const QPointF &pos)