@@ -143,6 +143,7 void tst_QChartView::rubberBand() | |||
|
143 | 143 | m_view->chart()->addSeries(line); |
|
144 | 144 | m_view->chart()->createDefaultAxes(); |
|
145 | 145 | m_view->show(); |
|
146 | QTest::qWaitForWindowShown(m_view); | |
|
146 | 147 | |
|
147 | 148 | QRectF plotArea = m_view->chart()->plotArea(); |
|
148 | 149 | //this is hack since view does not get events otherwise |
@@ -152,24 +153,25 void tst_QChartView::rubberBand() | |||
|
152 | 153 | QSignalSpy spy0(axisY, SIGNAL(rangeChanged(qreal,qreal))); |
|
153 | 154 | QAbstractAxis* axisX = m_view->chart()->axisX(); |
|
154 | 155 | QSignalSpy spy1(axisX, SIGNAL(rangeChanged(qreal,qreal))); |
|
155 | ||
|
156 | ||
|
157 | 156 | QValueAxis* vaxisX = qobject_cast<QValueAxis*>(axisX); |
|
158 | 157 | QValueAxis* vaxisY = qobject_cast<QValueAxis*>(axisY); |
|
159 | ||
|
160 | 158 | int minX = vaxisX->min(); |
|
161 | 159 | int minY = vaxisY->min(); |
|
162 | 160 | int maxX = vaxisX->max(); |
|
163 | 161 | int maxY = vaxisY->max(); |
|
164 | 162 | |
|
165 | QTest::qWaitForWindowShown(m_view); | |
|
166 | QTest::mouseMove(m_view->viewport(), min + plotArea.topLeft().toPoint()); | |
|
167 | QTest::qWait(2000); | |
|
168 | QTest::mousePress(m_view->viewport(), Qt::LeftButton, 0, min + plotArea.topLeft().toPoint()); | |
|
169 | QTest::qWait(2000); | |
|
170 | QTest::mouseMove(m_view->viewport(), plotArea.bottomRight().toPoint() - max); | |
|
171 | QTest::qWait(2000); | |
|
172 |
QTest::mouse |
|
|
163 | // try to ensure focus | |
|
164 | QApplication::setActiveWindow(m_view); | |
|
165 | m_view->setFocus(); | |
|
166 | QApplication::processEvents(); | |
|
167 | QVERIFY(m_view->isActiveWindow()); | |
|
168 | QVERIFY(m_view->hasFocus()); | |
|
169 | ||
|
170 | QTest::mouseMove(m_view->viewport(), min + plotArea.topLeft().toPoint(), 100); | |
|
171 | QTest::mousePress(m_view->viewport(), Qt::LeftButton, 0, min + plotArea.topLeft().toPoint(), 100); | |
|
172 | QTest::mouseMove(m_view->viewport(), plotArea.bottomRight().toPoint() - max, 100); | |
|
173 | QTest::mouseRelease(m_view->viewport(), Qt::LeftButton, 0, plotArea.bottomRight().toPoint() - max, 100); | |
|
174 | QApplication::processEvents(); | |
|
173 | 175 | |
|
174 | 176 | TRY_COMPARE(spy0.count(), Xcount); |
|
175 | 177 | TRY_COMPARE(spy1.count(), Ycount); |
@@ -563,6 +563,13 void tst_qpieseries::hoverSignal() | |||
|
563 | 563 | m_view->show(); |
|
564 | 564 | QTest::qWaitForWindowShown(m_view); |
|
565 | 565 | |
|
566 | // try to ensure focus | |
|
567 | QApplication::setActiveWindow(m_view); | |
|
568 | m_view->setFocus(); | |
|
569 | QApplication::processEvents(); | |
|
570 | QVERIFY(m_view->isActiveWindow()); | |
|
571 | QVERIFY(m_view->hasFocus()); | |
|
572 | ||
|
566 | 573 | // move inside the slices |
|
567 | 574 | m_series->setPieSize(1.0); |
|
568 | 575 | QRectF pieRect = m_view->chart()->plotArea(); |
@@ -281,6 +281,13 void tst_qpieslice::hoverSignal() | |||
|
281 | 281 | view.show(); |
|
282 | 282 | QTest::qWaitForWindowShown(&view); |
|
283 | 283 | |
|
284 | // try to ensure focus | |
|
285 | QApplication::setActiveWindow(&view); | |
|
286 | view.setFocus(); | |
|
287 | QApplication::processEvents(); | |
|
288 | QVERIFY(view.isActiveWindow()); | |
|
289 | QVERIFY(view.hasFocus()); | |
|
290 | ||
|
284 | 291 | // move inside the slices |
|
285 | 292 | series->setPieSize(1.0); |
|
286 | 293 | QRectF pieRect = view.chart()->plotArea(); |
General Comments 0
You need to be logged in to leave comments.
Login now