diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
commit | 6630937e63ae5797487b86743a7733c8ae5cc42c (patch) | |
tree | 3d53dacf6430f9099e1fb20835881205de674961 /tests/auto/widgets/graphicsview/qgraphicsproxywidget | |
parent | 37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff) | |
parent | c7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff) |
Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsproxywidget')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 49afc5f369..4a301337ef 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -140,6 +140,7 @@ private slots: void palettePropagation(); void fontPropagation(); void dontCrashWhenDie(); + void dontCrashNoParent(); void createProxyForChildWidget(); #ifndef QT_NO_CONTEXTMENU void actionsContextMenu(); @@ -2964,6 +2965,20 @@ void tst_QGraphicsProxyWidget::dontCrashWhenDie() qDeleteAll(QApplication::topLevelWidgets()); } +void tst_QGraphicsProxyWidget::dontCrashNoParent() // QTBUG-15442 +{ + QGraphicsProxyWidget *parent(new QGraphicsProxyWidget); + QGraphicsProxyWidget *child(new QGraphicsProxyWidget); + QScopedPointer<QLabel> label0(new QLabel); + QScopedPointer<QLabel> label1(new QLabel); + + child->setParentItem(parent); + // Set the first label as the proxied widget. + parent->setWidget(label0.data()); + // If we attempt to change the proxied widget we get a crash. + parent->setWidget(label1.data()); +} + void tst_QGraphicsProxyWidget::createProxyForChildWidget() { QGraphicsScene scene; |