summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsview
diff options
context:
space:
mode:
authorLiang QI <liang.qi@nokia.com>2009-09-24 13:14:17 (GMT)
committerLiang QI <liang.qi@nokia.com>2009-09-24 13:14:17 (GMT)
commit240f69a0b26601fe34fe2a692ab50e5d738f02f9 (patch)
tree0b86266c190cf4b3960dabae39ddeaa30a2e4d1b /tests/auto/qgraphicsview
parentb69206ce55c37afef189781bc9234257d6f556c2 (diff)
downloadQt-240f69a0b26601fe34fe2a692ab50e5d738f02f9.zip
Qt-240f69a0b26601fe34fe2a692ab50e5d738f02f9.tar.gz
Qt-240f69a0b26601fe34fe2a692ab50e5d738f02f9.tar.bz2
Fix the compilation error for tst_qgraphicsview on S60.
static_cast from QGraphicsView* to QWidget*. Change QPlastiqueStyle to QWindowsStyle for some platforms like S60. Reviewed-by: Jason Barron
Diffstat (limited to 'tests/auto/qgraphicsview')
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index ae00e34..9d23096 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -55,8 +55,13 @@
#if !defined(QT_NO_STYLE_MOTIF)
#include <QtGui/QMotifStyle>
#endif
-#include <QtGui/QPainterPath>
+#if !defined(QT_NO_STYLE_WINDOWS)
+#include <QtGui/QWindowsStyle>
+#endif
+#if !defined(QT_NO_STYLE_PLASTIQUE)
#include <QtGui/QPlastiqueStyle>
+#endif
+#include <QtGui/QPainterPath>
#include <QtGui/QRubberBand>
#include <QtGui/QScrollBar>
#include <QtGui/QStyleOption>
@@ -65,7 +70,6 @@
#include <QtGui/QPushButton>
#include <QtGui/QInputContext>
#include <private/qgraphicsview_p.h>
-
#include "../../shared/util.h"
//TESTED_CLASS=
@@ -1875,7 +1879,7 @@ void tst_QGraphicsView::sendEvent()
QTest::qWaitForWindowShown(&view);
QApplication::setActiveWindow(&view);
QTest::qWait(20);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
item->setFocus();
@@ -1943,7 +1947,7 @@ void tst_QGraphicsView::wheelEvent()
QTest::qWaitForWindowShown(&view);
QApplication::setActiveWindow(&view);
QTest::qWait(20);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
// Send a wheel event with horizontal orientation.
@@ -2679,7 +2683,7 @@ void tst_QGraphicsView::task172231_untransformableItems()
view.show();
QTest::qWaitForWindowShown(&view);
QApplication::setActiveWindow(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QRectF origExposedRect = text->exposedRect;
@@ -3030,7 +3034,13 @@ void tst_QGraphicsView::scrollAfterResize_data()
QTest::addColumn<QTransform>("x2");
QTest::addColumn<QTransform>("x3");
+#if !defined(QT_NO_STYLE_PLASTIQUE)
QPlastiqueStyle style;
+#elif !defined(QT_NO_STYLE_WINDOWS)
+ QWindowsStyle style;
+#else
+ QCommonStyle style;
+#endif
int frameWidth = style.pixelMetric(QStyle::PM_DefaultFrameWidth);
int extent = style.pixelMetric(QStyle::PM_ScrollBarExtent);
@@ -3055,7 +3065,13 @@ void tst_QGraphicsView::scrollAfterResize()
QFETCH(QTransform, x2);
QFETCH(QTransform, x3);
+#if !defined(QT_NO_STYLE_PLASTIQUE)
QPlastiqueStyle style;
+#elif !defined(QT_NO_STYLE_WINDOWS)
+ QWindowsStyle style;
+#else
+ QCommonStyle style;
+#endif
QGraphicsView view;
view.setStyle(&style);
if (reverse)
@@ -3434,7 +3450,7 @@ void tst_QGraphicsView::update()
QApplication::setActiveWindow(&view);
QTest::qWait(50);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
const QRect viewportRect = view.viewport()->rect();
QCOMPARE(viewportRect, QRect(0, 0, 200, 200));
@@ -3468,7 +3484,7 @@ void tst_QGraphicsView::inputMethodSensitivity()
view.show();
QTest::qWaitForWindowShown(&view);
QApplication::setActiveWindow(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QGraphicsRectItem *item = new QGraphicsRectItem;
@@ -3557,7 +3573,7 @@ void tst_QGraphicsView::inputContextReset()
view.show();
QTest::qWaitForWindowShown(&view);
QApplication::setActiveWindow(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
QGraphicsItem *item1 = new QGraphicsRectItem;
item1->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod);