diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-05-12 11:02:01 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-05-12 12:48:12 +0200 |
commit | 6697f2a899fac47a65122a85691b2cfe63c6152c (patch) | |
tree | 6ae8ad93c7455f9571d1b1b868ae077af89d96df /tests/auto/qwidget/tst_qwidget.cpp | |
parent | e577d02cc9cba2033cd21c23a4420a1f0d5469a4 (diff) | |
parent | 1f806aa1b40db276dad359863d018171080d93f9 (diff) |
Merge remote branch 'origin/master' into refactor
Conflicts:
src/gui/gui.pro
src/gui/painting/painting.pri
src/opengl/opengl.pro
src/openvg/openvg.pro
Diffstat (limited to 'tests/auto/qwidget/tst_qwidget.cpp')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index e266efb794..f282b5d7d3 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -345,6 +345,7 @@ private slots: void immediateRepaintAfterInvalidateBuffer(); #endif void effectiveWinId(); + void effectiveWinId2(); void customDpi(); void customDpiProperty(); @@ -8495,6 +8496,30 @@ void tst_QWidget::effectiveWinId() QVERIFY(child.effectiveWinId()); } +void tst_QWidget::effectiveWinId2() +{ + QWidget parent; + + class MyWidget : public QWidget { + bool event(QEvent *e) + { + if (e->type() == QEvent::WinIdChange) { + // Shouldn't crash. + effectiveWinId(); + } + + return QWidget::event(e); + } + }; + + MyWidget child; + child.setParent(&parent); + parent.show(); + + child.setParent(0); + child.setParent(&parent); +} + class CustomWidget : public QWidget { public: |