summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-10-22 11:08:32 +0200
committerLiang Qi <liang.qi@qt.io>2016-10-22 21:19:57 +0200
commit28628a5d5e6c55512759ceafc644aa31e444b781 (patch)
tree221d1ab0995afe0d441f1ddb433aee985f6d41ea /tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
parentcbb2ba23e203374132e4b134b1c8f1a3626d2378 (diff)
parent686c44a69b13f6e884dd2b6d9991f4cd94597c5a (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/plugins/platforms/eglfs/qeglfshooks.cpp Change-Id: I483f0dbd876943b184803f0fe65a0c686ad75db2
Diffstat (limited to 'tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp')
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index a19f4aea56..6c7197b85e 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -390,7 +390,8 @@ void tst_QFormLayout::setFormStyle()
QCOMPARE(layout.rowWrapPolicy(), QFormLayout::DontWrapRows);
#endif
- widget.setStyle(QStyleFactory::create("windows"));
+ const QScopedPointer<QStyle> windowsStyle(QStyleFactory::create("windows"));
+ widget.setStyle(windowsStyle.data());
QCOMPARE(layout.labelAlignment(), Qt::AlignLeft);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
@@ -401,14 +402,16 @@ void tst_QFormLayout::setFormStyle()
this test is cross platform.. so create dummy styles that
return all the right stylehints.
*/
- widget.setStyle(new DummyMacStyle());
+ DummyMacStyle macStyle;
+ widget.setStyle(&macStyle);
QCOMPARE(layout.labelAlignment(), Qt::AlignRight);
QVERIFY(layout.formAlignment() == (Qt::AlignHCenter | Qt::AlignTop));
QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::FieldsStayAtSizeHint);
QCOMPARE(layout.rowWrapPolicy(), QFormLayout::DontWrapRows);
- widget.setStyle(new DummyQtopiaStyle());
+ DummyQtopiaStyle qtopiaStyle;
+ widget.setStyle(&qtopiaStyle);
QCOMPARE(layout.labelAlignment(), Qt::AlignRight);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
@@ -886,7 +889,7 @@ void tst_QFormLayout::takeAt()
QCOMPARE(layout->count(), 7);
for (int i = 6; i >= 0; --i) {
- layout->takeAt(0);
+ delete layout->takeAt(0);
QCOMPARE(layout->count(), i);
}
}
@@ -978,7 +981,7 @@ void tst_QFormLayout::replaceWidget()
QFormLayout::ItemRole role;
// replace editor
- layout->replaceWidget(edit1, edit3);
+ delete layout->replaceWidget(edit1, edit3);
edit1->hide(); // Not strictly needed for the test, but for normal usage it is.
QCOMPARE(layout->indexOf(edit1), -1);
QCOMPARE(layout->indexOf(edit3), editIndex);
@@ -989,7 +992,7 @@ void tst_QFormLayout::replaceWidget()
QCOMPARE(rownum, 0);
QCOMPARE(role, QFormLayout::FieldRole);
- layout->replaceWidget(label1, label2);
+ delete layout->replaceWidget(label1, label2);
label1->hide();
QCOMPARE(layout->indexOf(label1), -1);
QCOMPARE(layout->indexOf(label2), labelIndex);