@@ -441,11 +441,11 void tst_QBarSeries::mouseclicked() | |||||
441 | series->setCategories(categories); |
|
441 | series->setCategories(categories); | |
442 |
|
442 | |||
443 | QBarSet* set1 = new QBarSet(QString("set 1")); |
|
443 | QBarSet* set1 = new QBarSet(QString("set 1")); | |
444 | *set1 << 10 << 10 << 10; |
|
444 | *set1 << QPointF(0,10) << QPointF(1,10) << QPointF(2,10); | |
445 | series->appendBarSet(set1); |
|
445 | series->appendBarSet(set1); | |
446 |
|
446 | |||
447 | QBarSet* set2 = new QBarSet(QString("set 2")); |
|
447 | QBarSet* set2 = new QBarSet(QString("set 2")); | |
448 | *set2 << 10 << 10 << 10; |
|
448 | *set2 << QPointF(0.5,10) << QPointF(1.5,10) << QPointF(2.5,10); | |
449 | series->appendBarSet(set2); |
|
449 | series->appendBarSet(set2); | |
450 |
|
450 | |||
451 | QSignalSpy setSpy1(set1, SIGNAL(clicked(QString))); |
|
451 | QSignalSpy setSpy1(set1, SIGNAL(clicked(QString))); | |
@@ -460,7 +460,7 void tst_QBarSeries::mouseclicked() | |||||
460 |
|
460 | |||
461 | //==================================================================================== |
|
461 | //==================================================================================== | |
462 | // barset 1, category test1 |
|
462 | // barset 1, category test1 | |
463 |
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint( |
|
463 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(75,180)); | |
464 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
464 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
465 |
|
465 | |||
466 | QCOMPARE(setSpy1.count(), 1); |
|
466 | QCOMPARE(setSpy1.count(), 1); | |
@@ -475,7 +475,7 void tst_QBarSeries::mouseclicked() | |||||
475 |
|
475 | |||
476 | //==================================================================================== |
|
476 | //==================================================================================== | |
477 | // barset 1, category test2 |
|
477 | // barset 1, category test2 | |
478 |
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(1 |
|
478 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(160,180)); | |
479 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
479 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
480 |
|
480 | |||
481 | QCOMPARE(setSpy1.count(), 1); |
|
481 | QCOMPARE(setSpy1.count(), 1); | |
@@ -490,7 +490,7 void tst_QBarSeries::mouseclicked() | |||||
490 |
|
490 | |||
491 | //==================================================================================== |
|
491 | //==================================================================================== | |
492 | // barset 1, category test3 |
|
492 | // barset 1, category test3 | |
493 |
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(2 |
|
493 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(255,180)); | |
494 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
494 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
495 |
|
495 | |||
496 | QCOMPARE(setSpy1.count(), 1); |
|
496 | QCOMPARE(setSpy1.count(), 1); | |
@@ -505,7 +505,7 void tst_QBarSeries::mouseclicked() | |||||
505 |
|
505 | |||
506 | //==================================================================================== |
|
506 | //==================================================================================== | |
507 | // barset 2, category test1 |
|
507 | // barset 2, category test1 | |
508 |
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(1 |
|
508 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(115,180)); | |
509 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
509 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
510 |
|
510 | |||
511 | QCOMPARE(setSpy1.count(), 0); |
|
511 | QCOMPARE(setSpy1.count(), 0); | |
@@ -520,7 +520,7 void tst_QBarSeries::mouseclicked() | |||||
520 |
|
520 | |||
521 | //==================================================================================== |
|
521 | //==================================================================================== | |
522 | // barset 2, category test2 |
|
522 | // barset 2, category test2 | |
523 |
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint( |
|
523 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(205,180)); | |
524 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
524 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
525 |
|
525 | |||
526 | QCOMPARE(setSpy1.count(), 0); |
|
526 | QCOMPARE(setSpy1.count(), 0); | |
@@ -535,7 +535,7 void tst_QBarSeries::mouseclicked() | |||||
535 |
|
535 | |||
536 | //==================================================================================== |
|
536 | //==================================================================================== | |
537 | // barset 2, category test3 |
|
537 | // barset 2, category test3 | |
538 |
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(3 |
|
538 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(300,180)); | |
539 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
539 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
540 |
|
540 | |||
541 | QCOMPARE(setSpy1.count(), 0); |
|
541 | QCOMPARE(setSpy1.count(), 0); | |
@@ -552,12 +552,12 void tst_QBarSeries::mouseclicked() | |||||
552 | // no event cases |
|
552 | // no event cases | |
553 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(1,1)); // Outside of both sets |
|
553 | QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(1,1)); // Outside of both sets | |
554 | QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(1,1)); // Right mouse button outside and inside sets |
|
554 | QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(1,1)); // Right mouse button outside and inside sets | |
555 |
QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint( |
|
555 | QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(75,180)); // barset 1, category test1 | |
556 |
QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(1 |
|
556 | QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(160,180)); // barset 1, category test2 | |
557 |
QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(2 |
|
557 | QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(255,180)); // barset 1, category test3 | |
558 |
QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(1 |
|
558 | QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(115,180)); // barset 2, category test1 | |
559 |
QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint( |
|
559 | QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(205,180)); // barset 2, category test2 | |
560 |
QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(3 |
|
560 | QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(300,180)); // barset 2, category test3 | |
561 |
|
561 | |||
562 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); |
|
562 | QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); | |
563 | QCOMPARE(setSpy1.count(), 0); |
|
563 | QCOMPARE(setSpy1.count(), 0); | |
@@ -578,11 +578,11 void tst_QBarSeries::mousehovered() | |||||
578 | series->setCategories(categories); |
|
578 | series->setCategories(categories); | |
579 |
|
579 | |||
580 | QBarSet* set1 = new QBarSet(QString("set 1")); |
|
580 | QBarSet* set1 = new QBarSet(QString("set 1")); | |
581 | *set1 << 10 << 10 << 10; |
|
581 | *set1 << QPointF(0.1,10) << QPointF(1.1,10) << QPointF(2.1,10); | |
582 | series->appendBarSet(set1); |
|
582 | series->appendBarSet(set1); | |
583 |
|
583 | |||
584 | QBarSet* set2 = new QBarSet(QString("set 2")); |
|
584 | QBarSet* set2 = new QBarSet(QString("set 2")); | |
585 | *set2 << 10 << 10 << 10; |
|
585 | *set2 << QPointF(0.4,10) << QPointF(1.4,10) << QPointF(2.4,10); | |
586 | series->appendBarSet(set2); |
|
586 | series->appendBarSet(set2); | |
587 |
|
587 | |||
588 | QSignalSpy setSpy1(set1, SIGNAL(hovered(bool))); |
|
588 | QSignalSpy setSpy1(set1, SIGNAL(hovered(bool))); | |
@@ -608,7 +608,7 void tst_QBarSeries::mousehovered() | |||||
608 |
|
608 | |||
609 | //======================================================================= |
|
609 | //======================================================================= | |
610 | // move mouse on top of set1 |
|
610 | // move mouse on top of set1 | |
611 |
QTest::mouseMove(view.viewport(), QPoint( |
|
611 | QTest::mouseMove(view.viewport(), QPoint(75,180)); | |
612 |
|
612 | |||
613 | QVERIFY(setSpy1.count() == 1); |
|
613 | QVERIFY(setSpy1.count() == 1); | |
614 | QVERIFY(setSpy2.count() == 0); |
|
614 | QVERIFY(setSpy2.count() == 0); | |
@@ -623,7 +623,7 void tst_QBarSeries::mousehovered() | |||||
623 |
|
623 | |||
624 | //======================================================================= |
|
624 | //======================================================================= | |
625 | // move mouse from top of set1 to top of set2 |
|
625 | // move mouse from top of set1 to top of set2 | |
626 |
QTest::mouseMove(view.viewport(), QPoint(1 |
|
626 | QTest::mouseMove(view.viewport(), QPoint(105,180)); | |
627 |
|
627 | |||
628 | QVERIFY(setSpy1.count() == 1); |
|
628 | QVERIFY(setSpy1.count() == 1); | |
629 | QVERIFY(setSpy2.count() == 1); |
|
629 | QVERIFY(setSpy2.count() == 1); | |
@@ -653,7 +653,7 void tst_QBarSeries::mousehovered() | |||||
653 |
|
653 | |||
654 | //======================================================================= |
|
654 | //======================================================================= | |
655 | // move mouse from top of set2 to background |
|
655 | // move mouse from top of set2 to background | |
656 |
QTest::mouseMove(view.viewport(), QPoint(1 |
|
656 | QTest::mouseMove(view.viewport(), QPoint(135,180)); | |
657 |
|
657 | |||
658 | QVERIFY(setSpy1.count() == 0); |
|
658 | QVERIFY(setSpy1.count() == 0); | |
659 | QVERIFY(setSpy2.count() == 1); |
|
659 | QVERIFY(setSpy2.count() == 1); |
General Comments 0
You need to be logged in to leave comments.
Login now