diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-03-13 15:06:40 +1000 |
---|---|---|
committer | Matthew Vogt <matthew.vogt@nokia.com> | 2012-03-13 15:22:14 +1000 |
commit | 784555f3032194a8923d804a8ce84957f113caf6 (patch) | |
tree | 6b538cea5bf82bd5288ac180125abd1bb312ddad /src/qmltest/quicktestevent.cpp | |
parent | 1f52c5430144eb7ba6baa7e3954675ca0707b947 (diff) | |
parent | 648c80c4c0759efb6e35fac7acc8daad5aab13e2 (diff) |
Merge branch 'master' of git://gitorious.org/qt/qtdeclarative into merge-master
Change-Id: Iaefec13503dadfa200539b8de7a2d80fc5bb3bcf
Diffstat (limited to 'src/qmltest/quicktestevent.cpp')
-rw-r--r-- | src/qmltest/quicktestevent.cpp | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp index f996adbeca..94051711f1 100644 --- a/src/qmltest/quicktestevent.cpp +++ b/src/qmltest/quicktestevent.cpp @@ -42,12 +42,8 @@ #include "quicktestevent_p.h" #include <QtTest/qtestkeyboard.h> #include <QtQml/qqml.h> -#if defined(QML_VERSION) && QML_VERSION >= 0x020000 #include <QtQuick/qquickitem.h> #include <QtQuick/qquickcanvas.h> -#define QUICK_TEST_SCENEGRAPH 1 -#endif -#include <QtWidgets/qgraphicsscene.h> QT_BEGIN_NAMESPACE @@ -114,15 +110,9 @@ namespace QtQuickTest } QPoint pos; -#ifdef QUICK_TEST_SCENEGRAPH QQuickItem *sgitem = qobject_cast<QQuickItem *>(item); - if (sgitem) { + if (sgitem) pos = sgitem->mapToScene(_pos).toPoint(); - } else -#endif - { - qWarning("No suitable QtQuick1 implementation is available!"); - } QTEST_ASSERT(button == Qt::NoButton || button & Qt::MouseButtonMask); QTEST_ASSERT(stateKey == 0 || stateKey & Qt::KeyboardModifierMask); @@ -168,15 +158,10 @@ namespace QtQuickTest QTest::qWait(delay); QPoint pos; -#ifdef QUICK_TEST_SCENEGRAPH QQuickItem *sgitem = qobject_cast<QQuickItem *>(item); - if (sgitem) { + if (sgitem) pos = sgitem->mapToScene(_pos).toPoint(); - } else -#endif - { - qWarning("No suitable QtQuick1 implementation is available!"); - } + QTEST_ASSERT(buttons == Qt::NoButton || buttons & Qt::MouseButtonMask); QTEST_ASSERT(stateKey == 0 || stateKey & Qt::KeyboardModifierMask); @@ -272,24 +257,10 @@ bool QuickTestEvent::mouseMove QWindow *QuickTestEvent::eventWindow() { -#ifdef QUICK_TEST_SCENEGRAPH QQuickItem *sgitem = qobject_cast<QQuickItem *>(parent()); if (sgitem) return sgitem->canvas(); -#endif return 0; - /* - QQuickItem *item = qobject_cast<QQuickItem *>(parent()); - if (!item) - return 0; - QGraphicsScene *s = item->scene(); - if (!s) - return 0; - QList<QGraphicsView *> views = s->views(); - if (views.isEmpty()) - return 0; - return views.at(0)->windowHandle(); - */ } QT_END_NAMESPACE |