diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-05-17 10:09:40 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-05-17 11:06:48 +0300 |
commit | 9ea7d7fe35006f48a8786cd70f483fdfeed4083d (patch) | |
tree | 383c8f41297bff3996f585f41bbea68dfd05d4a1 /tests | |
parent | 567bb809192837ce64ca3f6f490e241b164485a3 (diff) |
Return empty brush/pen/font via API rather than the weird default one
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ää <tomi.korpipaa@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qbarset/tst_qbarset.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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 |