diff --git a/tests/auto/qbarseries/tst_qbarseries.cpp b/tests/auto/qbarseries/tst_qbarseries.cpp index edefbd8..bb2bc3a 100644 --- a/tests/auto/qbarseries/tst_qbarseries.cpp +++ b/tests/auto/qbarseries/tst_qbarseries.cpp @@ -443,7 +443,7 @@ void tst_QBarSeries::mouseclicked() series->append(set1); QBarSet* set2 = new QBarSet(QString("set 2")); - *set2 << QPointF(0.5,10) << QPointF(1.5,10) << QPointF(2.5,10); + *set2 << QPointF(0.3,10) << QPointF(1.3,10) << QPointF(2.3,10); series->append(set2); QSignalSpy setSpy1(set1, SIGNAL(clicked(QString))); @@ -458,7 +458,7 @@ void tst_QBarSeries::mouseclicked() //==================================================================================== // barset 1, category test1 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(75,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(105,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 1); @@ -473,7 +473,7 @@ void tst_QBarSeries::mouseclicked() //==================================================================================== // barset 1, category test2 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(160,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(200,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 1); @@ -488,7 +488,7 @@ void tst_QBarSeries::mouseclicked() //==================================================================================== // barset 1, category test3 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(255,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(295,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 1); @@ -503,7 +503,7 @@ void tst_QBarSeries::mouseclicked() //==================================================================================== // barset 2, category test1 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(115,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(145,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 0); @@ -518,7 +518,7 @@ void tst_QBarSeries::mouseclicked() //==================================================================================== // barset 2, category test2 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(205,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(240,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 0); @@ -533,7 +533,7 @@ void tst_QBarSeries::mouseclicked() //==================================================================================== // barset 2, category test3 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(300,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(335,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 0); @@ -550,12 +550,12 @@ void tst_QBarSeries::mouseclicked() // no event cases QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(1,1)); // Outside of both sets QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(1,1)); // Right mouse button outside and inside sets - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(75,180)); // barset 1, category test1 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(160,180)); // barset 1, category test2 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(255,180)); // barset 1, category test3 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(115,180)); // barset 2, category test1 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(205,180)); // barset 2, category test2 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(300,180)); // barset 2, category test3 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(105,180)); // barset 1, category test1 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(200,180)); // barset 1, category test2 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(295,180)); // barset 1, category test3 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(145,180)); // barset 2, category test1 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(240,180)); // barset 2, category test2 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(335,180)); // barset 2, category test3 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 0); @@ -580,7 +580,7 @@ void tst_QBarSeries::mousehovered() series->append(set1); QBarSet* set2 = new QBarSet(QString("set 2")); - *set2 << QPointF(0.4,10) << QPointF(1.4,10) << QPointF(2.4,10); + *set2 << QPointF(0.3,10) << QPointF(1.3,10) << QPointF(2.3,10); series->append(set2); QSignalSpy setSpy1(set1, SIGNAL(hovered(bool))); @@ -603,7 +603,7 @@ void tst_QBarSeries::mousehovered() //======================================================================= // move mouse on top of set1 - QTest::mouseMove(view.viewport(), QPoint(75,180)); + QTest::mouseMove(view.viewport(), QPoint(105,180)); QVERIFY(setSpy1.count() == 1); QVERIFY(setSpy2.count() == 0); @@ -618,7 +618,7 @@ void tst_QBarSeries::mousehovered() //======================================================================= // move mouse from top of set1 to top of set2 - QTest::mouseMove(view.viewport(), QPoint(105,180)); + QTest::mouseMove(view.viewport(), QPoint(145,180)); QVERIFY(setSpy1.count() == 1); QVERIFY(setSpy2.count() == 1); @@ -648,7 +648,7 @@ void tst_QBarSeries::mousehovered() //======================================================================= // move mouse from top of set2 to background - QTest::mouseMove(view.viewport(), QPoint(135,180)); + QTest::mouseMove(view.viewport(), QPoint(175,180)); QVERIFY(setSpy1.count() == 0); QVERIFY(setSpy2.count() == 1); diff --git a/tests/auto/qgroupedbarseries/tst_qgroupedbarseries.cpp b/tests/auto/qgroupedbarseries/tst_qgroupedbarseries.cpp index ee9cc39..2278c13 100644 --- a/tests/auto/qgroupedbarseries/tst_qgroupedbarseries.cpp +++ b/tests/auto/qgroupedbarseries/tst_qgroupedbarseries.cpp @@ -126,7 +126,7 @@ void tst_QGroupedBarSeries::mouseclicked() //==================================================================================== // barset 1, category test1 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(100,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(90,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 1); @@ -141,7 +141,7 @@ void tst_QGroupedBarSeries::mouseclicked() //==================================================================================== // barset 1, category test2 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(190,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(185,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 1); @@ -171,7 +171,7 @@ void tst_QGroupedBarSeries::mouseclicked() //==================================================================================== // barset 2, category test1 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(130,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(135,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 0); @@ -186,7 +186,7 @@ void tst_QGroupedBarSeries::mouseclicked() //==================================================================================== // barset 2, category test2 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(220,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(230,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 0); @@ -201,7 +201,7 @@ void tst_QGroupedBarSeries::mouseclicked() //==================================================================================== // barset 2, category test3 - QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(310,180)); + QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(320,180)); QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 0); @@ -218,12 +218,12 @@ void tst_QGroupedBarSeries::mouseclicked() // no event cases QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, QPoint(1,1)); // Outside of both sets QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(1,1)); // Right mouse button outside and inside sets - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(100,180)); // barset 1, category test1 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(190,180)); // barset 1, category test2 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(900,180)); // barset 1, category test1 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(185,180)); // barset 1, category test2 QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(280,180)); // barset 1, category test3 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(130,180)); // barset 2, category test1 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(220,180)); // barset 2, category test2 - QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(310,180)); // barset 2, category test3 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(135,180)); // barset 2, category test1 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(230,180)); // barset 2, category test2 + QTest::mouseClick(view.viewport(), Qt::RightButton, 0, QPoint(320,180)); // barset 2, category test3 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QCOMPARE(setSpy1.count(), 0); @@ -260,13 +260,16 @@ void tst_QGroupedBarSeries::mousehovered() view.chart()->addSeries(series); view.show(); QTest::qWaitForWindowShown(&view); +// QTest::qWait(1000*20); //this is hack since view does not get events otherwise view.setMouseTracking(true); //======================================================================= // move mouse to left border + qDebug() << "move mouse to left border"; QTest::mouseMove(view.viewport(), QPoint(0, 180)); + QCoreApplication::processEvents(QEventLoop::AllEvents, 1000); QVERIFY(setSpy1.count() == 0); QVERIFY(setSpy2.count() == 0); @@ -274,7 +277,9 @@ void tst_QGroupedBarSeries::mousehovered() //======================================================================= // move mouse on top of set1 - QTest::mouseMove(view.viewport(), QPoint(100,180)); + qDebug() << "move mouse on top of set1"; + QTest::mouseMove(view.viewport(), QPoint(90,180)); + QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); QVERIFY(setSpy1.count() == 1); QVERIFY(setSpy2.count() == 0); @@ -289,7 +294,9 @@ void tst_QGroupedBarSeries::mousehovered() //======================================================================= // move mouse from top of set1 to top of set2 - QTest::mouseMove(view.viewport(), QPoint(130,180)); + qDebug() << "move mouse from top of set1 to top of set2"; + QTest::mouseMove(view.viewport(), QPoint(135,180)); + QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); QVERIFY(setSpy1.count() == 1); QVERIFY(setSpy2.count() == 1); @@ -319,7 +326,10 @@ void tst_QGroupedBarSeries::mousehovered() //======================================================================= // move mouse from top of set2 to background - QTest::mouseMove(view.viewport(), QPoint(160,180)); + qDebug() << "move mouse from top of set2 to background"; + + QTest::mouseMove(view.viewport(), QPoint(135,0)); + QCoreApplication::processEvents(QEventLoop::AllEvents, 10000); QVERIFY(setSpy1.count() == 0); QVERIFY(setSpy2.count() == 1);