diff options
Diffstat (limited to 'tests/auto/widgets/graphicsview')
8 files changed, 63 insertions, 139 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index 90ea2cb58b..f5b2269297 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -38,7 +38,6 @@ class tst_QGraphicsGridLayout : public QObject Q_OBJECT private slots: - void initTestCase(); void qgraphicsgridlayout_data(); void qgraphicsgridlayout(); void addItem_data(); @@ -294,16 +293,6 @@ Q_DECLARE_METATYPE(ItemList); typedef QList<QSizeF> SizeList; - -// This will be called before the first test function is executed. -// It is only called once. -void tst_QGraphicsGridLayout::initTestCase() -{ -#ifdef Q_OS_WINCE //disable magic for WindowsCE - qApp->setAutoMaximizeThreshold(-1); -#endif -} - void tst_QGraphicsGridLayout::qgraphicsgridlayout_data() { } diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro index 5bfa15db16..88526144fc 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro @@ -5,4 +5,4 @@ QT += core-private gui-private SOURCES += tst_qgraphicsitem.cpp DEFINES += QT_NO_CAST_TO_ASCII -win32:!wince:!winrt: LIBS += -luser32 +win32:!winrt: LIBS += -luser32 diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index fc192560b4..46d0b18990 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -57,9 +57,7 @@ Q_DECLARE_METATYPE(QPainterPath) -#include "../../../qtest-config.h" - -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) #include <windows.h> #define Q_CHECK_PAINTEVENTS \ if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \ @@ -279,9 +277,6 @@ class tst_QGraphicsItem : public QObject { Q_OBJECT -public slots: - void init(); - private slots: void construction(); void constructionWithParent(); @@ -355,7 +350,7 @@ private slots: void filtersChildEvents(); void filtersChildEvents2(); void ensureVisible(); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void cursor(); #endif //void textControlGetterSetter(); @@ -481,13 +476,6 @@ private: QList<QGraphicsItem *> paintedItems; }; -void tst_QGraphicsItem::init() -{ -#ifdef Q_OS_WINCE //disable magic for WindowsCE - qApp->setAutoMaximizeThreshold(-1); -#endif -} - void tst_QGraphicsItem::construction() { for (int i = 0; i < 7; ++i) { @@ -4187,7 +4175,7 @@ void tst_QGraphicsItem::ensureVisible() QTest::qWait(25); } -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void tst_QGraphicsItem::cursor() { QGraphicsScene scene; @@ -4535,7 +4523,7 @@ protected: case QGraphicsItem::ItemSceneHasChanged: break; case QGraphicsItem::ItemCursorChange: -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR oldValues << cursor(); #endif break; @@ -5098,10 +5086,6 @@ public: void tst_QGraphicsItem::paint() { -#ifdef Q_OS_MACX - if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_7) - QSKIP("QTBUG-31454 - Unstable auto-test"); -#endif QGraphicsScene scene; PaintTester paintTester; @@ -6586,12 +6570,6 @@ public: void tst_QGraphicsItem::ensureUpdateOnTextItem() { -#ifdef Q_OS_MAC - if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_7) { - QSKIP("This test is unstable on 10.7 in CI"); - } -#endif - QGraphicsScene scene; QGraphicsView view(&scene); view.show(); @@ -11039,9 +11017,7 @@ void tst_QGraphicsItem::touchEventPropagation() touchPoints << tp; sendMousePress(&scene, tp.scenePos()); - QTouchDevice *device = new QTouchDevice; - device->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(device); + QTouchDevice *device = QTest::createTouchDevice(); QTouchEvent touchBegin(QEvent::TouchBegin, device, Qt::NoModifier, Qt::TouchPointPressed, touchPoints); qApp->sendEvent(&scene, &touchBegin); diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 8253a44b21..a3aa90168a 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -33,8 +33,6 @@ #include <private/qgraphicsproxywidget_p.h> #include <private/qlayoutengine_p.h> // qSmartMin functions... -#include "../../../qtest-config.h" - static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton) { QMouseEvent event(QEvent::MouseMove, point, widget->mapToGlobal(point), button, button, 0); @@ -97,7 +95,7 @@ private slots: void focusNextPrevChild(); void focusOutEvent_data(); void focusOutEvent(); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void hoverEnterLeaveEvent_data(); void hoverEnterLeaveEvent(); #endif @@ -140,7 +138,7 @@ private slots: void setFocus_complexTwoWidgets(); void popup_basic(); void popup_subwidget(); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void changingCursor_basic(); #endif void tooltip_basic(); @@ -272,9 +270,6 @@ public: // It is only called once. void tst_QGraphicsProxyWidget::initTestCase() { -#ifdef Q_OS_WINCE //disable magic for WindowsCE - qApp->setAutoMaximizeThreshold(-1); -#endif // Disable menu animations to prevent the alpha widget from getting in the way // in actionsContextMenu(). QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false); @@ -414,7 +409,7 @@ void tst_QGraphicsProxyWidget::setWidget() } QWidget *widget = new QWidget; -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR widget->setCursor(Qt::IBeamCursor); #endif widget->setPalette(QPalette(Qt::magenta)); @@ -451,7 +446,7 @@ void tst_QGraphicsProxyWidget::setWidget() QVERIFY(subWidget->testAttribute(Qt::WA_DontShowOnScreen)); QVERIFY(!subWidget->testAttribute(Qt::WA_QuitOnClose)); QCOMPARE(proxy->acceptHoverEvents(), true); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR QVERIFY(proxy->hasCursor()); // These should match @@ -934,7 +929,7 @@ protected: } }; -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent_data() { QTest::addColumn<bool>("hasWidget"); @@ -1522,7 +1517,7 @@ void tst_QGraphicsProxyWidget::setWidget_simple() // Properties // QCOMPARE(proxy.focusPolicy(), lineEdit->focusPolicy()); // QCOMPARE(proxy.palette(), lineEdit->palette()); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR QCOMPARE(proxy.cursor().shape(), lineEdit->cursor().shape()); #endif QCOMPARE(proxy.layoutDirection(), lineEdit->layoutDirection()); @@ -1571,7 +1566,7 @@ void tst_QGraphicsProxyWidget::resize_simple_data() QTest::addColumn<QSizeF>("size"); QTest::newRow("200, 200") << QSizeF(200, 200); -#if !defined(Q_PROCESSOR_ARM) && !defined(Q_OS_WINCE) +#if !defined(Q_PROCESSOR_ARM) QTest::newRow("1000, 1000") << QSizeF(1000, 1000); // Since 4.5, 10000x10000 runs out of memory. // QTest::newRow("10000, 10000") << QSizeF(10000, 10000); @@ -2539,7 +2534,7 @@ void tst_QGraphicsProxyWidget::popup_subwidget() QCOMPARE(popup->size(), child->size().toSize()); } -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void tst_QGraphicsProxyWidget::changingCursor_basic() { // Confirm that mouse events are working properly by checking that @@ -3645,7 +3640,7 @@ public slots: void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget() { -#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(QTEST_NO_CURSOR) +#if defined(Q_OS_DARWIN) || defined(Q_OS_WIN) || defined(QT_NO_CURSOR) QSKIP("Test case unstable on this platform"); #endif QGraphicsView view; @@ -3802,9 +3797,7 @@ void tst_QGraphicsProxyWidget::forwardTouchEvent() EventSpy eventSpy(widget); - QTouchDevice *device = new QTouchDevice; - device->setType(QTouchDevice::TouchScreen); - QWindowSystemInterface::registerTouchDevice(device); + QTouchDevice *device = QTest::createTouchDevice(); QCOMPARE(eventSpy.counts[QEvent::TouchBegin], 0); QCOMPARE(eventSpy.counts[QEvent::TouchUpdate], 0); diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro index 986ba019b4..351cecd92e 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro @@ -4,18 +4,9 @@ QT += widgets widgets-private testlib QT += core-private gui-private SOURCES += tst_qgraphicsscene.cpp RESOURCES += images.qrc -win32:!wince:!winrt: LIBS += -luser32 +win32:!winrt: LIBS += -luser32 -!wince: DEFINES += SRCDIR=\\\"$$PWD\\\" +DEFINES += SRCDIR=\\\"$$PWD\\\" DEFINES += QT_NO_CAST_TO_ASCII -wince* { - rootFiles.files = Ash_European.jpg graphicsScene_selection.data - rootFiles.path = . - renderFiles.files = testData\\render\\* - renderFiles.path = testData\\render - DEPLOYMENT += rootFiles renderFiles - DEFINES += SRCDIR=\\\".\\\" -} - RESOURCES += testdata.qrc diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index a346bb9d1f..d95f6e408e 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -28,9 +28,6 @@ #include <QtTest/QtTest> -#if defined(Q_OS_WINCE) -#include <ceconfig.h> -#endif #include <QtGui> #include <QtWidgets> @@ -41,7 +38,7 @@ #include "../../../shared/platforminputcontext.h" #include <private/qinputmethod_p.h> -#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) #include <windows.h> #define Q_CHECK_PAINTEVENTS \ if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \ @@ -170,7 +167,6 @@ class tst_QGraphicsScene : public QObject { Q_OBJECT public slots: - void initTestCase(); void cleanup(); private slots: @@ -271,15 +267,9 @@ private slots: void taskQT_3674_doNotCrash(); void taskQTBUG_15977_renderWithDeviceCoordinateCache(); void taskQTBUG_16401_focusItem(); + void taskQTBUG_42915_focusNextPrevChild(); }; -void tst_QGraphicsScene::initTestCase() -{ -#ifdef Q_OS_WINCE //disable magic for WindowsCE - qApp->setAutoMaximizeThreshold(-1); -#endif -} - void tst_QGraphicsScene::cleanup() { // ensure not even skipped tests with custom input context leave it dangling @@ -1250,7 +1240,7 @@ void tst_QGraphicsScene::addText() void tst_QGraphicsScene::removeItem() { -#if (defined(Q_OS_WINCE) && !defined(GWES_ICONCURS)) || defined(Q_OS_ANDROID) +#if defined(Q_OS_ANDROID) QSKIP("No mouse cursor support"); #endif QGraphicsScene scene; @@ -1587,11 +1577,7 @@ void tst_QGraphicsScene::hoverEvents_siblings() QGraphicsView view(&scene); view.setRenderHint(QPainter::Antialiasing, true); -#if defined(Q_OS_WINCE) - view.setMinimumSize(230, 200); -#else view.setMinimumSize(400, 300); -#endif view.rotate(10); view.scale(1.7, 1.7); view.show(); @@ -1660,11 +1646,7 @@ void tst_QGraphicsScene::hoverEvents_parentChild() QGraphicsView view(&scene); view.setRenderHint(QPainter::Antialiasing, true); -#if defined(Q_OS_WINCE) - view.setMinimumSize(230, 200); -#else view.setMinimumSize(400, 300); -#endif view.rotate(10); view.scale(1.7, 1.7); view.show(); @@ -4834,5 +4816,29 @@ void tst_QGraphicsScene::taskQTBUG_16401_focusItem() QVERIFY(!scene.focusItem()); } +void tst_QGraphicsScene::taskQTBUG_42915_focusNextPrevChild() +{ + QGraphicsScene scene; + QGraphicsView view(&scene); + scene.setSceneRect(1, 1, 198, 198); + view.setFocus(); + + QGraphicsWidget *widget1 = new QGraphicsWidget(); + QGraphicsRectItem *rect1 = new QGraphicsRectItem(-50, -50, 100, 100, widget1); + rect1->setBrush(Qt::blue); + scene.addItem(widget1); + widget1->setPos(100, 100); + widget1->setFlags(QGraphicsItem::ItemIsPanel); + + QGraphicsWidget *widget2 = new QGraphicsWidget(widget1); + widget2->setFocusPolicy(Qt::NoFocus); + + view.show(); + QApplication::setActiveWindow(&view); + QVERIFY(QTest::qWaitForWindowActive(&view)); + + QTest::keyEvent(QTest::Click, &view, Qt::Key_Tab); +} + QTEST_MAIN(tst_QGraphicsScene) #include "tst_qgraphicsscene.moc" diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 1df9a9434c..2ecc1120b9 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -57,7 +57,6 @@ #include "../../../shared/platforminputcontext.h" #include <private/qinputmethod_p.h> -#include "../../../qtest-config.h" #include "tst_qgraphicsview.h" Q_DECLARE_METATYPE(ExpectedValueDescription) @@ -146,7 +145,6 @@ public: : platformName(QGuiApplication::platformName().toLower()) { } private slots: - void initTestCase(); void cleanup(); void construction(); void renderHints(); @@ -202,7 +200,7 @@ private slots: #ifndef QT_NO_WHEELEVENT void wheelEvent(); #endif -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void cursor(); void cursor2(); #endif @@ -266,7 +264,7 @@ private slots: void QTBUG_4151_clipAndIgnore_data(); void QTBUG_4151_clipAndIgnore(); void QTBUG_5859_exposedRect(); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void QTBUG_7438_cursor(); #endif void hoverLeave(); @@ -279,13 +277,6 @@ private: QString platformName; }; -void tst_QGraphicsView::initTestCase() -{ -#ifdef Q_OS_WINCE_WM - qApp->setAutoMaximizeThreshold(-1); -#endif -} - void tst_QGraphicsView::cleanup() { // ensure not even skipped tests with custom input context leave it dangling @@ -739,7 +730,7 @@ void tst_QGraphicsView::dragMode_scrollHand() for (int i = 0; i < 2; ++i) { // ScrollHandDrag -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR Qt::CursorShape cursorShape = view.viewport()->cursor().shape(); #endif int horizontalScrollBarValue = view.horizontalScrollBar()->value(); @@ -758,7 +749,7 @@ void tst_QGraphicsView::dragMode_scrollHand() QTRY_VERIFY(item->isSelected()); for (int k = 0; k < 4; ++k) { -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR QCOMPARE(view.viewport()->cursor().shape(), Qt::ClosedHandCursor); #endif { @@ -801,7 +792,7 @@ void tst_QGraphicsView::dragMode_scrollHand() QTRY_VERIFY(item->isSelected()); QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue - 10); QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue - 10); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR QCOMPARE(view.viewport()->cursor().shape(), cursorShape); #endif @@ -861,7 +852,7 @@ void tst_QGraphicsView::dragMode_rubberBand() for (int i = 0; i < 2; ++i) { // RubberBandDrag -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR Qt::CursorShape cursorShape = view.viewport()->cursor().shape(); #endif int horizontalScrollBarValue = view.horizontalScrollBar()->value(); @@ -875,7 +866,7 @@ void tst_QGraphicsView::dragMode_rubberBand() QApplication::sendEvent(view.viewport(), &event); QVERIFY(event.isAccepted()); } -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR QCOMPARE(view.viewport()->cursor().shape(), cursorShape); #endif @@ -923,7 +914,7 @@ void tst_QGraphicsView::dragMode_rubberBand() } QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue); QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR QCOMPARE(view.viewport()->cursor().shape(), cursorShape); #endif @@ -1428,20 +1419,9 @@ void tst_QGraphicsView::fitInView() items[0]->setTransform(QTransform().rotate(30), true); items[1]->setTransform(QTransform().rotate(-30), true); -#if defined(Q_OS_WINCE) - //Is the standard scrollbar size - int scrollbarSize = qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent) - 13; -#endif - QGraphicsView view(&scene); view.setSceneRect(-400, -400, 800, 800); - -#if defined(Q_OS_WINCE) - //We need to take in account the scrollbar size for the WindowsMobilStyle - view.setFixedSize(400 + scrollbarSize, 200 + scrollbarSize); -#else view.setFixedSize(400, 200); -#endif view.showNormal(); view.fitInView(scene.itemsBoundingRect(), Qt::IgnoreAspectRatio); @@ -1855,11 +1835,7 @@ void tst_QGraphicsView::mapToScene() QGraphicsView view(&topLevel); view.setScene(&scene); view.setSceneRect(-500, -500, 1000, 1000); -#if defined(Q_OS_WINCE) - QSize viewSize(200,200); -#else QSize viewSize(300,300); -#endif view.setFixedSize(viewSize); topLevel.show(); @@ -2266,7 +2242,7 @@ void tst_QGraphicsView::wheelEvent() } #endif // !QT_NO_WHEELEVENT -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void tst_QGraphicsView::cursor() { QGraphicsScene scene; @@ -2290,7 +2266,7 @@ void tst_QGraphicsView::cursor() } #endif -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void tst_QGraphicsView::cursor2() { QGraphicsScene scene; @@ -3785,7 +3761,7 @@ void tst_QGraphicsView::mouseTracking() QGraphicsView view(&scene); QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR item->setCursor(Qt::CrossCursor); #endif scene.addItem(item); @@ -3795,7 +3771,7 @@ void tst_QGraphicsView::mouseTracking() // Adding an item to the scene before the scene is set on the view. QGraphicsScene scene(-10000, -10000, 20000, 20000); QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR item->setCursor(Qt::CrossCursor); #endif scene.addItem(item); @@ -3812,7 +3788,7 @@ void tst_QGraphicsView::mouseTracking() QGraphicsView view3(&scene); QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR item->setCursor(Qt::CrossCursor); #endif scene.addItem(item); @@ -4573,9 +4549,6 @@ void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged() void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins() { -#if defined(Q_OS_WINCE) - QSKIP("Qt/CE does not implement mouse tracking at this point"); -#endif QGraphicsScene scene(-100, -100, 200, 200); scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue)); @@ -4767,7 +4740,7 @@ void tst_QGraphicsView::QTBUG_5859_exposedRect() QCOMPARE(item.lastExposedRect, scene.lastBackgroundExposedRect); } -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR void tst_QGraphicsView::QTBUG_7438_cursor() { QGraphicsScene scene; diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp index ca9f866e81..9e390e45a6 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp @@ -42,8 +42,6 @@ #include <qstylefactory.h> #include <qscreen.h> -#include "../../../qtest-config.h" - typedef QList<QGraphicsItem *> QGraphicsItemList; class EventSpy : public QObject @@ -1112,9 +1110,7 @@ void tst_QGraphicsWidget::initStyleOption() bool hasFocus = option.state & QStyle::State_HasFocus; QCOMPARE(hasFocus, focus); bool isUnderMouse = option.state & QStyle::State_MouseOver; -#ifndef Q_OS_WINCE QCOMPARE(isUnderMouse, underMouse); -#endif // if (layoutDirection != Qt::LeftToRight) //QEXPECT_FAIL("", "QApplicaiton::layoutDirection doesn't propagate to QGraphicsWidget", Continue); //QCOMPARE(option.direction, layoutDirection); @@ -2938,8 +2934,8 @@ protected: void tst_QGraphicsWidget::respectHFW() { -#if defined(Q_OS_WINCE) || defined(Q_OS_MAC) - QSKIP("This test is platform dependent, it fails on wince and mac. Please fix."); +#if defined(Q_OS_DARWIN) + QSKIP("This test is platform dependent, it fails on Apple platforms. Please fix."); #else QGraphicsScene scene; HFWWidget *window = new HFWWidget; @@ -3184,7 +3180,7 @@ void tst_QGraphicsWidget::itemChangeEvents() valueDuringEvents.insert(QEvent::ParentChange, QVariant::fromValue(parentItem())); break; } -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR case QEvent::CursorChange: { valueDuringEvents.insert(QEvent::CursorChange, int(cursor().shape())); break; @@ -3235,7 +3231,7 @@ void tst_QGraphicsWidget::itemChangeEvents() QVERIFY(!item->isVisible()); QTRY_VERIFY(!item->valueDuringEvents.value(QEvent::Hide).toBool()); -#ifndef QTEST_NO_CURSOR +#ifndef QT_NO_CURSOR // CursorChange should be triggered after the cursor has changed item->setCursor(Qt::PointingHandCursor); QTRY_COMPARE(item->valueDuringEvents.value(QEvent::CursorChange).toInt(), int(item->cursor().shape())); |