diff options
author | Martin Smith <msmith@trolltech.com> | 2010-01-04 08:48:39 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2010-01-04 08:48:39 (GMT) |
commit | c855c61ed5c80a97f3a2858a15453f9e041db7f8 (patch) | |
tree | 68b86fe5adc7a5c19a237ee1e5bba147ccf92f23 /tests/auto/qwidget/tst_qwidget.cpp | |
parent | 65a0c8cc6d2c13cfb2cef22e8a23f4e3050fde25 (diff) | |
parent | 06bdf48e9194d73075041efecde5c70a144d6927 (diff) | |
download | Qt-c855c61ed5c80a97f3a2858a15453f9e041db7f8.zip Qt-c855c61ed5c80a97f3a2858a15453f9e041db7f8.tar.gz Qt-c855c61ed5c80a97f3a2858a15453f9e041db7f8.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'tests/auto/qwidget/tst_qwidget.cpp')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 3e14b56..2d04cc5 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -66,6 +66,8 @@ #include <private/qapplication_p.h> #include <qcalendarwidget.h> #include <qmainwindow.h> +#include <qdockwidget.h> +#include <qtoolbar.h> #include <QtGui/qpaintengine.h> #include <private/qbackingstore_p.h> @@ -356,6 +358,7 @@ private slots: void paintOnScreenPossible(); #endif void reparentStaticWidget(); + void QTBUG6883_reparentStaticWidget2(); #ifdef Q_WS_QWS void updateOutsideSurfaceClip(); #endif @@ -8728,6 +8731,31 @@ void tst_QWidget::reparentStaticWidget() // Please don't crash. paintOnScreen.resize(paintOnScreen.size() + QSize(2, 2)); QTest::qWait(20); + +} + +void tst_QWidget::QTBUG6883_reparentStaticWidget2() +{ + QMainWindow mw; + QDockWidget *one = new QDockWidget("one", &mw); + mw.addDockWidget(Qt::LeftDockWidgetArea, one , Qt::Vertical); + + QWidget *child = new QWidget(); + child->setPalette(Qt::red); + child->setAutoFillBackground(true); + child->setAttribute(Qt::WA_StaticContents); + child->resize(100, 100); + one->setWidget(child); + + QToolBar *mainTools = mw.addToolBar("Main Tools"); + mainTools->addWidget(new QLineEdit); + + mw.show(); + QTest::qWaitForWindowShown(&mw); + + one->setFloating(true); + QTest::qWait(20); + //do not crash } #ifdef Q_WS_QWS @@ -9726,7 +9754,7 @@ public: void deleteBackingStore() { if (static_cast<QWidgetPrivate*>(d_ptr.data())->maybeBackingStore()) { - delete static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStore; + delete static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStore; static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStore = 0; } } |