From d94165ab326f24a725720a705405067975b82af8 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Mon, 5 Mar 2012 12:31:03 +0100 Subject: Fix tst_QStyleSheetStyle::qproperty to not implicitly rely on QHash ordering. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changing qHash() for string data affected the order of properties to be set, causing 'checkable' to be set after 'checked'. As 'checkable' state affects 'checked' as well (setting it to false), this means that the test was unreliable, a bug, which was exposed by the qHash change. Change-Id: I03a8dd7d07609683d99f0b2a40012a147d409c6e Reviewed-by: Mark Brand Reviewed-by: João Abecasis --- tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/widgets/styles') diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index 1201b0f1da..8f187190aa 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -555,11 +555,11 @@ void tst_QStyleSheetStyle::layoutSpacing() void tst_QStyleSheetStyle::qproperty() { QPushButton pb; - pb.setStyleSheet("QPushButton { qproperty-text: hello; qproperty-checkable: true; qproperty-checked: 1}"); + pb.setStyleSheet("QPushButton { qproperty-text: hello; qproperty-checkable: 1; qproperty-checked: false}"); pb.ensurePolished(); QCOMPARE(pb.text(), QString("hello")); QCOMPARE(pb.isCheckable(), true); - QCOMPARE(pb.isChecked(), true); + QCOMPARE(pb.isChecked(), false); } namespace ns { -- cgit v1.2.3