summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index a1fc607..9e80eec 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -606,10 +606,14 @@ void tst_QWidget::getSetCheck()
obj1.setAttribute(Qt::WA_InputMethodEnabled);
obj1.setInputContext(var13);
QCOMPARE(static_cast<QInputContext *>(var13), obj1.inputContext());
+ // QWidget takes ownership, so check parent
+ QCOMPARE(var13->parent(), static_cast<QObject *>(&obj1));
+ // Check self assignment
+ obj1.setInputContext(obj1.inputContext());
+ QCOMPARE(static_cast<QInputContext *>(var13), obj1.inputContext());
obj1.setInputContext((QInputContext *)0);
QCOMPARE(qApp->inputContext(), obj1.inputContext());
QVERIFY(qApp->inputContext() != var13);
- //delete var13; // No delete, since QWidget takes ownership
// bool QWidget::autoFillBackground()
// void QWidget::setAutoFillBackground(bool)