182 // layout change ongoing while paint requested |
183 // layout change ongoing while paint requested |
183 m_infoWidget->startChanges(); |
184 m_infoWidget->startChanges(); |
184 m_infoWidget->paint(painter.data(), option, widget); |
185 m_infoWidget->paint(painter.data(), option, widget); |
185 } |
186 } |
186 |
187 |
187 /*! |
|
188 UT_InfoWidget::t_mousePressEvent |
|
189 */ |
|
190 void UT_InfoWidget::t_mousePressEvent() |
|
191 { |
|
192 QGraphicsSceneMouseEvent event; |
|
193 m_infoWidget->mousePressEvent(&event); |
|
194 } |
|
195 |
|
196 /*! |
|
197 UT_InfoWidget::t_mouseReleaseEvent |
|
198 */ |
|
199 void UT_InfoWidget::t_mouseReleaseEvent() |
|
200 { |
|
201 QGraphicsSceneMouseEvent event; |
|
202 |
|
203 // widget clicked while showing info display => |
|
204 // switch to settings display expected |
|
205 EXPECT(InfoWidgetLayoutManager::currentDisplayRole) |
|
206 .returns(InfoWidgetLayoutManager::InfoDisplay); |
|
207 EXPECT(InfoWidgetLayoutManager::layoutSettingsDialog); |
|
208 m_infoWidget->mousePressEvent(&event); |
|
209 m_infoWidget->mouseReleaseEvent(&event); |
|
210 |
|
211 // widget clicked while showing settings display => |
|
212 // no action expected |
|
213 EXPECT(InfoWidgetLayoutManager::currentDisplayRole) |
|
214 .returns(InfoWidgetLayoutManager::SettingsDialog); |
|
215 EXPECT(InfoWidgetLayoutManager::layoutSettingsDialog).times(0); |
|
216 m_infoWidget->mousePressEvent(&event); |
|
217 m_infoWidget->mouseReleaseEvent(&event); |
|
218 |
|
219 // release event received after dragging widget => |
|
220 // no action expected |
|
221 EXPECT(InfoWidgetLayoutManager::layoutSettingsDialog).times(0); |
|
222 m_infoWidget->mouseMoveEvent(&event); |
|
223 m_infoWidget->mouseReleaseEvent(&event); |
|
224 |
|
225 QVERIFY(verify()); |
|
226 } |
|
227 |
|
228 /*! |
|
229 UT_InfoWidget::t_mouseMoveEvent |
|
230 */ |
|
231 void UT_InfoWidget::t_mouseMoveEvent() |
|
232 { |
|
233 |
|
234 } |
|
235 |
188 |
236 /*! |
189 /*! |
237 UT_InfoWidget::t_updateInfoDisplay |
190 UT_InfoWidget::t_updateInfoDisplay |
238 */ |
191 */ |
239 void UT_InfoWidget::t_updateInfoDisplay() |
192 void UT_InfoWidget::t_updateInfoDisplay() |
813 QVERIFY(m_infoWidget->m_animationState == InfoWidget::AnimationIdle); |
766 QVERIFY(m_infoWidget->m_animationState == InfoWidget::AnimationIdle); |
814 |
767 |
815 QVERIFY(verify()); |
768 QVERIFY(verify()); |
816 } |
769 } |
817 |
770 |
|
771 /*! |
|
772 UT_InfoWidget::t_gestureEvent |
|
773 */ |
|
774 void UT_InfoWidget::t_gestureEvent() |
|
775 { |
|
776 QList<QGesture> gestures; |
|
777 //QScopedPointer<QGestureEvent> event(new QGestureEvent); |
|
778 //void gestureEvent(QGestureEvent *event); |
|
779 m_infoWidget->gestureEvent(NULL); |
|
780 QVERIFY(verify()); |
|
781 } |
|
782 |
|
783 |
818 |
784 |
819 QTEST_MAIN_S60(UT_InfoWidget) |
785 QTEST_MAIN_S60(UT_InfoWidget) |