From 9ea7d7fe35006f48a8786cd70f483fdfeed4083d Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 17 May 2013 10:09:40 +0300 Subject: Return empty brush/pen/font via API rather than the weird default one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously a non-initialized QPen()/QBrush()/QFont() was returned if axis/series hadn't been added to a chart yet and therefore had not been themed yet. To keep API somewhat consistent with old behavior, return non-initialized QPen()/QBrush()/QFont() instead of the weird default one in these cases. The new behavior is slightly different in that it is no longer possible to restore themed behavior by setting pen/brush/font to non-initialized one, but since there is no way to differentiate e.g. legitimate Qt::black pen from non-initialized pen, we can no longer support this behavior. Change-Id: I99f3d8853b329b5345e3073c040d8bfa8b9b75b4 Reviewed-by: Tomi Korpipää --- tests/auto/qbarset/tst_qbarset.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/qbarset/tst_qbarset.cpp b/tests/auto/qbarset/tst_qbarset.cpp index 794df99b..358e5fb3 100644 --- a/tests/auto/qbarset/tst_qbarset.cpp +++ b/tests/auto/qbarset/tst_qbarset.cpp @@ -476,7 +476,7 @@ void tst_QBarSet::customize() series->append(set2); QVERIFY(set1->brush() == brush); // Should be customized - QVERIFY(set2->brush() != QBrush()); // Should be decorated by theme + QVERIFY(set2->brush() == QBrush()); // Setting empty brush doesn't reset to theme brush // Remove sets from series series->take(set1); @@ -490,8 +490,8 @@ void tst_QBarSet::customize() series->append(set1); series->append(set2); - QVERIFY(set1->labelBrush() == brush); // Should be customized - QVERIFY(set2->labelBrush() != QBrush()); // Should be decorated by theme + QVERIFY(set1->labelBrush() == brush); // Should be customized + QVERIFY(set2->labelBrush() == QBrush()); // Setting empty brush doesn't reset to theme brush // Test label font // Note: QFont empty constructor creates font with application's default font, so the font may or may not be the -- cgit v1.2.3