Fix tst_QStyleSheetStyle::qproperty to not implicitly rely on QHash ordering.

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 <mabrand@mabrand.nl>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
This commit is contained in:
Robin Burchell 2012-03-05 12:31:03 +01:00 committed by Qt by Nokia
parent c01ef19e77
commit d94165ab32

View File

@ -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 {