##// END OF EJS Templates
updated tst_qbarset to test fix for QTRD-1519
sauimone -
r1789:4671963c7c5d
parent child
Show More
@@ -442,28 +442,55 void tst_QBarSet::customize()
442 *set1 << 1 << 2 << 1 << 3;
442 *set1 << 1 << 2 << 1 << 3;
443 *set2 << 2 << 1 << 3 << 1;
443 *set2 << 2 << 1 << 3 << 1;
444
444
445 // Remove sets from series
446 series->remove(set1);
447 series->remove(set2);
448
445 // Test pen
449 // Test pen
446 QVERIFY(set1->pen() != QPen());
450 QVERIFY(set1->pen() != QPen());
447 QVERIFY(set2->pen() == QPen());
451 QVERIFY(set2->pen() == QPen());
448 QPen pen(QColor(128,128,128,128));
452 QPen pen(QColor(128,128,128,128));
449 set1->setPen(pen);
453 set1->setPen(pen);
450 QVERIFY(set1->pen() == pen);
454
451 QVERIFY(set2->pen() == QPen());
455 // Add sets back to series
456 series->append(set1);
457 series->append(set2);
458
459 QVERIFY(set1->pen() == pen); // Should be customized
460 QVERIFY(set2->pen() != QPen()); // Should be decorated by theme
461
462 // Remove sets from series
463 series->remove(set1);
464 series->remove(set2);
452
465
453 // Test brush
466 // Test brush
467 set2->setBrush(QBrush());
454 QVERIFY(set1->brush() != QBrush());
468 QVERIFY(set1->brush() != QBrush());
455 QVERIFY(set2->brush() == QBrush());
469 QVERIFY(set2->brush() == QBrush());
456 QBrush brush(QColor(128,128,128,128));
470 QBrush brush(QColor(128,128,128,128));
457 set1->setBrush(brush);
471 set1->setBrush(brush);
458 QVERIFY(set1->brush() == brush);
472
459 QVERIFY(set2->brush() == QBrush());
473 // Add sets back to series
474 series->append(set1);
475 series->append(set2);
476
477 QVERIFY(set1->brush() == brush); // Should be customized
478 QVERIFY(set2->brush() != QBrush()); // Should be decorated by theme
479
480 // Remove sets from series
481 series->remove(set1);
482 series->remove(set2);
460
483
461 // Test label brush
484 // Test label brush
485 set2->setLabelBrush(QBrush());
462 QVERIFY(set1->labelBrush() != QBrush());
486 QVERIFY(set1->labelBrush() != QBrush());
463 QVERIFY(set2->labelBrush() == QBrush());
487 QVERIFY(set2->labelBrush() == QBrush());
464 set1->setLabelBrush(brush);
488 set1->setLabelBrush(brush);
465 QVERIFY(set1->labelBrush() == brush);
489
466 QVERIFY(set2->labelBrush() == QBrush());
490 series->append(set1);
491 series->append(set2);
492 QVERIFY(set1->labelBrush() == brush); // Should be customized
493 QVERIFY(set2->labelBrush() != QBrush()); // Should be decorated by theme
467
494
468 // Test label font
495 // Test label font
469 // Note: QFont empty constructor creates font with application's default font, so the font may or may not be the
496 // Note: QFont empty constructor creates font with application's default font, so the font may or may not be the
@@ -480,8 +507,12 void tst_QBarSet::customize()
480 // Test adding data to the sets
507 // Test adding data to the sets
481 *set1 << 1 << 2 << 1 << 3;
508 *set1 << 1 << 2 << 1 << 3;
482 *set2 << 2 << 1 << 3 << 1;
509 *set2 << 2 << 1 << 3 << 1;
510
483 }
511 }
484
512
513
514
515
485 QTEST_MAIN(tst_QBarSet)
516 QTEST_MAIN(tst_QBarSet)
486
517
487 #include "tst_qbarset.moc"
518 #include "tst_qbarset.moc"
General Comments 0
You need to be logged in to leave comments. Login now