diff options
Diffstat (limited to 'tests')
38 files changed, 265 insertions, 274 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 4f15a69ec8..a88564e0b7 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -9,4 +9,9 @@ find_package(Qt5Core REQUIRED) include("${_Qt5CTestMacros}") -expect_pass(test_modules) +set(Qt5_MODULE_TEST_DEPENDS Network Gui) + +test_module_includes( + Qml QQmlEngine + Quick QQuickWindow +) diff --git a/tests/auto/cmake/test_modules/CMakeLists.txt b/tests/auto/cmake/test_modules/CMakeLists.txt deleted file mode 100644 index 509320bfb5..0000000000 --- a/tests/auto/cmake/test_modules/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ - -cmake_minimum_required(VERSION 2.8) - -project(test_modules) - -# We have to find the dependencies separately because they are installed, -# whereas the modules under test are not installed yet, and are found in the -# build directory. Normally the Qt5 CMake files expect all modules in one -# installation prefix, so we work around that by finding the dependencies -# explicitly first. -find_package(Qt5Network REQUIRED) -find_package(Qt5Gui REQUIRED) - -find_package(Qt5Qml REQUIRED) -find_package(Qt5Quick REQUIRED) - -include_directories( - ${Qt5Qml_INCLUDE_DIRS} - ${Qt5Quick_INCLUDE_DIRS} -) - -add_definitions( - ${Qt5Qml_DEFINITIONS} - ${Qt5Quick_DEFINITIONS} -) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") - -add_executable(mainapp main.cpp) -target_link_libraries(mainapp - ${Qt5Qml_LIBRARIES} - ${Qt5Quick_LIBRARIES} -) diff --git a/tests/auto/cmake/test_modules/main.cpp b/tests/auto/cmake/test_modules/main.cpp deleted file mode 100644 index c771ead229..0000000000 --- a/tests/auto/cmake/test_modules/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com> -** Contact: http://www.qt-project.org/legal -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QQmlEngine> -#include <QQuickItem> - -int main(int argc, char **argv) -{ - QQmlEngine qmlEngine; - - QQuickItem quickItem; - - return 0; -} diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index a98160e0db..2b9efb62d7 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -179,7 +179,7 @@ void tst_QDebugMessageService::cleanupTestCase() void tst_QDebugMessageService::init() { m_connection = new QQmlDebugConnection(); - m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); + m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); m_client = new QQmlDebugMsgClient(m_connection); m_process->start(QStringList() << QLatin1String(NORMALMODE) << QQmlDataTest::instance()->testFile(QMLFILE)); diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp index ef82d82c8e..b958a27af5 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp @@ -1002,7 +1002,7 @@ void tst_QQmlDebugJS::cleanupTestCase() bool tst_QQmlDebugJS::init(const QString &qmlFile, bool blockMode) { connection = new QQmlDebugConnection(); - process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); + process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); client = new QJSDebugClient(connection); if (blockMode) diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index 3ee66fc5b8..19a39c5656 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -108,7 +108,7 @@ void tst_QQmlEngineDebugInspectorIntegration::init() const QString argument = "-qmljsdebugger=port:" STR_PORT ",block"; m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) - + "/qmlscene"); + + "/qmlscene", this); m_process->start(QStringList() << argument << testFile("qtquick2.qml")); QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp index 7a75f7b1d5..f1a6c23a3f 100644 --- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp +++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp @@ -86,7 +86,7 @@ void tst_QQmlInspector::init() { const QString argument = "-qmljsdebugger=port:" STR_PORT ",block"; - m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); + m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); m_process->start(QStringList() << argument << testFile("qtquick2.qml")); QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index dec4ab3449..d8b538d79e 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -240,7 +240,7 @@ void tst_QQmlProfilerService::connect(bool block, const QString &testFile) arguments << QQmlDataTest::instance()->testFile(testFile); - m_process = new QQmlDebugProcess(executable); + m_process = new QQmlDebugProcess(executable, this); m_process->start(QStringList() << arguments); QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'."); diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index 06aba83bcb..df8042ca11 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -83,8 +83,9 @@ void QQmlDebugTestClient::messageReceived(const QByteArray &ba) emit serverMessage(ba); } -QQmlDebugProcess::QQmlDebugProcess(const QString &executable) - : m_executable(executable) +QQmlDebugProcess::QQmlDebugProcess(const QString &executable, QObject *parent) + : QObject(parent) + , m_executable(executable) , m_started(false) { m_process.setProcessChannelMode(QProcess::MergedChannels); @@ -183,7 +184,7 @@ void QQmlDebugProcess::processAppOutput() const QString line = m_outputBuffer.left(nlIndex); m_outputBuffer = m_outputBuffer.right(m_outputBuffer.size() - nlIndex - 1); - if (line.startsWith("QML Debugger:")) { + if (line.contains("QML Debugger:")) { if (line.contains("Waiting for connection ")) { m_timer.stop(); m_started = true; diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h index e5e8878996..0791d05205 100644 --- a/tests/auto/qml/debugger/shared/debugutil_p.h +++ b/tests/auto/qml/debugger/shared/debugutil_p.h @@ -84,7 +84,7 @@ class QQmlDebugProcess : public QObject { Q_OBJECT public: - QQmlDebugProcess(const QString &executable); + QQmlDebugProcess(const QString &executable, QObject *parent = 0); ~QQmlDebugProcess(); QString state(); diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index 840030daba..87d2673c2f 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -1965,7 +1965,6 @@ void tst_QJSEngine::stringObjects() QString pname = QString::number(i); QVERIFY(obj.property(pname).isString()); QCOMPARE(obj.property(pname).toString(), QString(str.at(i))); - QEXPECT_FAIL("", "FIXME: This is V8 issue 862. ECMA script standard 15.5.5.2 compliance.", Continue); QVERIFY(!obj.deleteProperty(pname)); obj.setProperty(pname, 123); QVERIFY(obj.property(pname).isString()); @@ -2004,7 +2003,6 @@ void tst_QJSEngine::stringObjects() QJSValue ret5 = eng.evaluate("delete s[0]"); QVERIFY(ret5.isBool()); - QEXPECT_FAIL("", "FIXME: This is V8 bug, please report it! ECMA script standard 15.5.5.2", Abort); QVERIFY(!ret5.toBool()); QJSValue ret6 = eng.evaluate("delete s[-1]"); diff --git a/tests/auto/qml/qqmlecmascript/data/exportDate.2.qml b/tests/auto/qml/qqmlecmascript/data/exportDate.2.qml index 8ad75aabb0..4420cf846c 100644 --- a/tests/auto/qml/qqmlecmascript/data/exportDate.2.qml +++ b/tests/auto/qml/qqmlecmascript/data/exportDate.2.qml @@ -12,7 +12,7 @@ MyTypeObject { // The test date is 2009-5-12 23:59:59 (local time) var compare = new Date(2009, 5-1, 12, 23, 59, 59) - var compareOffset = new Date().getTimezoneOffset() + var compareOffset = compare.getTimezoneOffset() // The date is already in local time, so we can use the partial values directly var dtAdjusted = dt diff --git a/tests/auto/qml/qqmlecmascript/data/exportDate.qml b/tests/auto/qml/qqmlecmascript/data/exportDate.qml index 13b35a9cb8..c42b092fc7 100644 --- a/tests/auto/qml/qqmlecmascript/data/exportDate.qml +++ b/tests/auto/qml/qqmlecmascript/data/exportDate.qml @@ -12,7 +12,7 @@ MyTypeObject { // The test date is 2009-5-12 00:00:01 (local time) var compare = new Date(2009, 5-1, 12, 0, 0, 1) - var compareOffset = new Date().getTimezoneOffset() + var compareOffset = compare.getTimezoneOffset() // The date is already in local time, so we can use the partial values directly var dtAdjusted = dt diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp index 028eb30f53..68f4553921 100644 --- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp +++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp @@ -68,6 +68,8 @@ private slots: void canAt(); void canClear(); void canCount(); + void isReadable(); + void isManipulable(); void append(); void at(); void clear(); @@ -128,6 +130,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } // Non-property @@ -143,6 +147,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } // Non-list property @@ -158,6 +164,8 @@ void tst_qqmllistreference::qmllistreference_invalid() QVERIFY(r.at(10) == 0); QVERIFY(r.clear() == false); QVERIFY(r.count() == 0); + QVERIFY(r.isReadable() == false); + QVERIFY(r.isManipulable() == false); } } @@ -343,6 +351,64 @@ void tst_qqmllistreference::canCount() } } +void tst_qqmllistreference::isReadable() +{ + TestType *tt = new TestType; + + { + QQmlListReference ref; + QVERIFY(ref.isReadable() == false); + } + + { + QQmlListReference ref(tt, "blah"); + QVERIFY(ref.isReadable() == false); + } + + { + QQmlListReference ref(tt, "data"); + QVERIFY(ref.isReadable() == true); + delete tt; + QVERIFY(ref.isReadable() == false); + } + + { + TestType tt; + tt.property.count = 0; + QQmlListReference ref(&tt, "data"); + QVERIFY(ref.isReadable() == false); + } +} + +void tst_qqmllistreference::isManipulable() +{ + TestType *tt = new TestType; + + { + QQmlListReference ref; + QVERIFY(ref.isManipulable() == false); + } + + { + QQmlListReference ref(tt, "blah"); + QVERIFY(ref.isManipulable() == false); + } + + { + QQmlListReference ref(tt, "data"); + QVERIFY(ref.isManipulable() == true); + delete tt; + QVERIFY(ref.isManipulable() == false); + } + + { + TestType tt; + tt.property.count = 0; + QQmlListReference ref(&tt, "data"); + QVERIFY(ref.isManipulable() == false); + } +} + void tst_qqmllistreference::append() { TestType *tt = new TestType; diff --git a/tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro b/tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro index fcfdf23d33..f1fbfde0ec 100644 --- a/tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro +++ b/tests/auto/qml/qqmlxmlhttprequest/qqmlxmlhttprequest.pro @@ -2,6 +2,8 @@ CONFIG += testcase TARGET = tst_qqmlxmlhttprequest macx:CONFIG -= app_bundle +CONFIG+=insignificant_test # QTQAINFRA-573 + INCLUDEPATH += ../../shared/ HEADERS += ../../shared/testhttpserver.h diff --git a/tests/auto/qmltest/events/tst_events.qml b/tests/auto/qmltest/events/tst_events.qml index 059541147e..4c33988960 100644 --- a/tests/auto/qmltest/events/tst_events.qml +++ b/tests/auto/qmltest/events/tst_events.qml @@ -73,6 +73,7 @@ Rectangle { when: windowShown // Must have this line for events to work. function test_key_click() { + skip("test_key_click() is unstable, QTBUG-27671") keyClick(Qt.Key_Left) tryCompare(top, "leftKeyPressed", true, 10000) tryCompare(top, "leftKeyReleased", true, 10000) diff --git a/tests/auto/qmltest/pixel/tst_pixel.qml b/tests/auto/qmltest/pixel/tst_pixel.qml index 67eca074df..f10840b9ab 100644 --- a/tests/auto/qmltest/pixel/tst_pixel.qml +++ b/tests/auto/qmltest/pixel/tst_pixel.qml @@ -52,6 +52,7 @@ Rectangle { when: windowShown function test_pixel() { + skip("test_pixel() is unstable, QTBUG-27671") var img = grabImage(rect); compare(img.pixel(20, 20), Qt.rgba(255, 0, 0, 255)); compare(img.red(1,1), 255); diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp index 70efc5eac5..f651655244 100644 --- a/tests/auto/quick/examples/tst_examples.cpp +++ b/tests/auto/quick/examples/tst_examples.cpp @@ -275,7 +275,7 @@ void tst_examples::sgexamples() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); } - root->setParentItem(window->rootItem()); + root->setParentItem(window->contentItem()); component.completeCreate(); qApp->processEvents(); @@ -319,7 +319,7 @@ void tst_examples::sgsnippets() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); } - root->setParentItem(window->rootItem()); + root->setParentItem(window->contentItem()); component.completeCreate(); qApp->processEvents(); diff --git a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp index 247f98702e..7c07a16d51 100644 --- a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp +++ b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp @@ -81,7 +81,7 @@ void tst_qquickapplication::active() QQuickItem *item = qobject_cast<QQuickItem *>(component.create()); QVERIFY(item); QQuickWindow window; - item->setParentItem(window.rootItem()); + item->setParentItem(window.contentItem()); // not active QVERIFY(!item->property("active").toBool()); diff --git a/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp b/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp index 8e13e21f1e..562863b4f3 100644 --- a/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp +++ b/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp @@ -180,7 +180,7 @@ void tst_QQuickDrag::cleanupTestCase() void tst_QQuickDrag::active() { QQuickWindow window; - TestDropTarget dropTarget(window.rootItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -390,7 +390,7 @@ void tst_QQuickDrag::active() void tst_QQuickDrag::drop() { QQuickWindow window; - TestDropTarget outerTarget(window.rootItem()); + TestDropTarget outerTarget(window.contentItem()); outerTarget.setSize(QSizeF(100, 100)); outerTarget.acceptAction = Qt::CopyAction; TestDropTarget innerTarget(&outerTarget); @@ -526,7 +526,7 @@ void tst_QQuickDrag::drop() void tst_QQuickDrag::move() { QQuickWindow window; - TestDropTarget outerTarget(window.rootItem()); + TestDropTarget outerTarget(window.contentItem()); outerTarget.setSize(QSizeF(100, 100)); TestDropTarget leftTarget(&outerTarget); leftTarget.setPos(QPointF(0, 35)); @@ -680,11 +680,11 @@ void tst_QQuickDrag::move() void tst_QQuickDrag::parentChange() { QQuickWindow window1; - TestDropTarget dropTarget1(window1.rootItem()); + TestDropTarget dropTarget1(window1.contentItem()); dropTarget1.setSize(QSizeF(100, 100)); QQuickWindow window2; - TestDropTarget dropTarget2(window2.rootItem()); + TestDropTarget dropTarget2(window2.contentItem()); dropTarget2.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); @@ -704,7 +704,7 @@ void tst_QQuickDrag::parentChange() QCOMPARE(evaluate<bool>(item, "Drag.active"), true); // Verify setting a parent item for an item with an active drag sends an enter event. - item->setParentItem(window1.rootItem()); + item->setParentItem(window1.contentItem()); QCOMPARE(dropTarget1.enterEvents, 0); QCoreApplication::processEvents(); QCOMPARE(dropTarget1.enterEvents, 1); @@ -719,7 +719,7 @@ void tst_QQuickDrag::parentChange() // Changing the parent to an item in another window sends a leave event in the old window // and an enter on the new window. - item->setParentItem(window2.rootItem()); + item->setParentItem(window2.contentItem()); QCOMPARE(dropTarget1.enterEvents, 1); QCOMPARE(dropTarget1.moveEvents, 1); QCOMPARE(dropTarget1.leaveEvents, 0); @@ -746,13 +746,13 @@ void tst_QQuickDrag::parentChange() // Go around again and verify no events if active is false. evaluate<void>(item, "Drag.active = false"); - item->setParentItem(window1.rootItem()); + item->setParentItem(window1.contentItem()); QCoreApplication::processEvents(); item->setParentItem(&dropTarget1); QCoreApplication::processEvents(); - item->setParentItem(window2.rootItem()); + item->setParentItem(window2.contentItem()); QCoreApplication::processEvents(); item->setParentItem(0); @@ -767,7 +767,7 @@ void tst_QQuickDrag::parentChange() void tst_QQuickDrag::hotSpot() { QQuickWindow window; - TestDropTarget dropTarget(window.rootItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -831,7 +831,7 @@ void tst_QQuickDrag::hotSpot() void tst_QQuickDrag::supportedActions() { QQuickWindow window; - TestDropTarget dropTarget(window.rootItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -889,7 +889,7 @@ void tst_QQuickDrag::supportedActions() void tst_QQuickDrag::proposedAction() { QQuickWindow window; - TestDropTarget dropTarget(window.rootItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -958,8 +958,8 @@ void tst_QQuickDrag::keys() // Test changing the keys restarts a drag. QQuickWindow window; - item->setParentItem(window.rootItem()); - TestDropTarget dropTarget(window.rootItem()); + item->setParentItem(window.contentItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); evaluate<void>(item, "Drag.start()"); @@ -1006,8 +1006,8 @@ void tst_QQuickDrag::source() // Test changing the source restarts a drag. QQuickWindow window; - item->setParentItem(window.rootItem()); - TestDropTarget dropTarget(window.rootItem()); + item->setParentItem(window.contentItem()); + TestDropTarget dropTarget(window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); evaluate<void>(item, "Drag.start()"); @@ -1183,7 +1183,7 @@ void tst_QQuickDrag::recursion() QTest::ignoreMessage(QtWarningMsg, warning.constData()); QQuickWindow window; - RecursingDropTarget dropTarget(script, type, window.rootItem()); + RecursingDropTarget dropTarget(script, type, window.contentItem()); dropTarget.setSize(QSizeF(100, 100)); QQmlComponent component(&engine); component.setData( @@ -1195,7 +1195,7 @@ void tst_QQuickDrag::recursion() QScopedPointer<QObject> object(component.create()); QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); - item->setParentItem(window.rootItem()); + item->setParentItem(window.contentItem()); dropTarget.setItem(item); diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp index 42dc6ff698..927a57b296 100644 --- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp +++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp @@ -122,7 +122,7 @@ void tst_QQuickDropArea::containsDrag_internal() QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); @@ -188,7 +188,7 @@ void tst_QQuickDropArea::containsDrag_external() QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QMimeData data; QQuickWindow alternateWindow; @@ -256,7 +256,7 @@ void tst_QQuickDropArea::keys_internal() QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); @@ -356,7 +356,7 @@ void tst_QQuickDropArea::keys_external() "}", QUrl()); QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QMimeData data; QQuickWindow alternateWindow; @@ -463,7 +463,7 @@ void tst_QQuickDropArea::source_internal() QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); @@ -528,7 +528,7 @@ void tst_QQuickDropArea::position_internal() QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); @@ -590,7 +590,7 @@ void tst_QQuickDropArea::position_external() QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QMimeData data; @@ -667,7 +667,7 @@ void tst_QQuickDropArea::drop_internal() QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea); - dropArea->setParentItem(window.rootItem()); + dropArea->setParentItem(window.contentItem()); QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); @@ -806,7 +806,7 @@ void tst_QQuickDropArea::simultaneousDrags() QScopedPointer<QObject> object(component.create()); QQuickItem *dropArea1 = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea1); - dropArea1->setParentItem(window.rootItem()); + dropArea1->setParentItem(window.contentItem()); QQuickItem *dropArea2 = dropArea1->findChild<QQuickItem *>("dropArea2"); QVERIFY(dropArea2); diff --git a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp index 1cf07d38b6..a614bbbe42 100644 --- a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp +++ b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp @@ -503,7 +503,7 @@ void tst_qquickfocusscope::canvasFocus() QQuickItem *rootObject = view->rootObject(); QVERIFY(rootObject); - QQuickItem *rootItem = view->rootItem(); + QQuickItem *rootItem = view->contentItem(); QQuickItem *scope1 = findItem<QQuickItem>(rootObject, QLatin1String("scope1")); QQuickItem *item1 = findItem<QQuickItem>(rootObject, QLatin1String("item1")); QQuickItem *scope2 = findItem<QQuickItem>(rootObject, QLatin1String("scope2")); diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp index f98fe752c3..1050308afd 100644 --- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp @@ -254,7 +254,7 @@ struct FocusState : public QHash<QQuickItem *, FocusData> else if (qobject_cast<TestFocusScope *>(window.activeFocusItem())) \ QCOMPARE(qobject_cast<TestFocusScope *>(window.activeFocusItem())->focused, true); \ } else { \ - QCOMPARE(window.activeFocusItem(), window.rootItem()); \ + QCOMPARE(window.activeFocusItem(), window.contentItem()); \ } \ for (QHash<QQuickItem *, FocusData>::Iterator iter = focusState.begin(); \ iter != focusState.end(); \ @@ -276,9 +276,9 @@ void tst_qquickitem::simpleFocus() QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *l1c1 = new TestItem(window.rootItem()); - QQuickItem *l1c2 = new TestItem(window.rootItem()); - QQuickItem *l1c3 = new TestItem(window.rootItem()); + QQuickItem *l1c1 = new TestItem(window.contentItem()); + QQuickItem *l1c2 = new TestItem(window.contentItem()); + QQuickItem *l1c3 = new TestItem(window.contentItem()); QQuickItem *l2c1 = new TestItem(l1c1); QQuickItem *l2c2 = new TestItem(l1c1); @@ -327,9 +327,9 @@ void tst_qquickitem::scopedFocus() ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *l1c1 = new TestItem(window.rootItem()); - QQuickItem *l1c2 = new TestItem(window.rootItem()); - QQuickItem *l1c3 = new TestItem(window.rootItem()); + QQuickItem *l1c1 = new TestItem(window.contentItem()); + QQuickItem *l1c2 = new TestItem(window.contentItem()); + QQuickItem *l1c3 = new TestItem(window.contentItem()); QQuickItem *l2c1 = new TestItem(l1c1); QQuickItem *l2c2 = new TestItem(l1c1); @@ -416,7 +416,7 @@ void tst_qquickitem::addedToWindow() focusState[item].set(true, false); FVERIFY(); - item->setParentItem(window.rootItem()); + item->setParentItem(window.contentItem()); focusState[item].set(true, true); focusState.active(item); FVERIFY(); @@ -427,7 +427,7 @@ void tst_qquickitem::addedToWindow() ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *item = new TestItem(window.rootItem()); + QQuickItem *item = new TestItem(window.contentItem()); QQuickItem *tree = new TestItem; QQuickItem *c1 = new TestItem(tree); @@ -468,7 +468,7 @@ void tst_qquickitem::addedToWindow() focusState[c2].set(true, false); FVERIFY(); - tree->setParentItem(window.rootItem()); + tree->setParentItem(window.contentItem()); focusState[c1].set(false, false); focusState[c2].set(true, true); focusState.active(c2); @@ -491,7 +491,7 @@ void tst_qquickitem::addedToWindow() focusState[c2].set(true, false); FVERIFY(); - tree->setParentItem(window.rootItem()); + tree->setParentItem(window.contentItem()); focusState[c1].set(false, false); focusState[c2].set(true, false); FVERIFY(); @@ -521,7 +521,7 @@ void tst_qquickitem::addedToWindow() focusState[c2].set(true, false); FVERIFY(); - tree->setParentItem(window.rootItem()); + tree->setParentItem(window.contentItem()); focusState[tree].set(true, true); focusState[c1].set(false, false); focusState[c2].set(true, true); @@ -533,7 +533,7 @@ void tst_qquickitem::addedToWindow() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); QQuickItem *tree = new TestFocusScope; QQuickItem *c1 = new TestItem(tree); QQuickItem *c2 = new TestItem(tree); @@ -551,7 +551,7 @@ void tst_qquickitem::addedToWindow() focusState.active(child); FVERIFY(); - tree->setParentItem(window.rootItem()); + tree->setParentItem(window.contentItem()); focusState[tree].set(false, false); focusState[c1].set(false, false); focusState[c2].set(true, false); @@ -573,7 +573,7 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); FocusState focusState; focusState << child; @@ -595,8 +595,8 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); - QQuickItem *child2 = new TestItem(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); + QQuickItem *child2 = new TestItem(window.contentItem()); FocusState focusState; focusState << child << child2; @@ -616,8 +616,8 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); - QQuickItem *child2 = new TestFocusScope(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); + QQuickItem *child2 = new TestFocusScope(window.contentItem()); QQuickItem *item = new TestItem(child); FocusState focusState; @@ -638,8 +638,8 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); - QQuickItem *child2 = new TestFocusScope(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); + QQuickItem *child2 = new TestFocusScope(window.contentItem()); QQuickItem *item = new TestItem(child2); FocusState focusState; @@ -660,8 +660,8 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *child = new TestItem(window.rootItem()); - QQuickItem *child2 = new TestFocusScope(window.rootItem()); + QQuickItem *child = new TestItem(window.contentItem()); + QQuickItem *child2 = new TestFocusScope(window.contentItem()); QQuickItem *item = new TestItem(child2); FocusState focusState; @@ -686,7 +686,7 @@ void tst_qquickitem::changeParent() QQuickWindow window; ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem *item = new TestFocusScope(window.rootItem()); + QQuickItem *item = new TestFocusScope(window.contentItem()); QQuickItem *child = new TestItem(item); QQuickItem *child2 = new TestItem; @@ -709,7 +709,7 @@ void tst_qquickitem::changeParent() focusState.remove(child); delete child; - item->setParentItem(window.rootItem()); + item->setParentItem(window.contentItem()); focusState[item].set(true, true); focusState.active(item); FVERIFY(); @@ -777,7 +777,7 @@ void tst_qquickitem::parentItemWithFocus() focusState[&child].set(false, false); FVERIFY(); - parent.setParentItem(window.rootItem()); + parent.setParentItem(window.contentItem()); focusState[&parent].set(true, true); focusState[&child].set(false, false); focusState.active(&parent); @@ -810,7 +810,7 @@ void tst_qquickitem::parentItemWithFocus() focusState[&grandchild].set(false, false); FVERIFY(); - parent.setParentItem(window.rootItem()); + parent.setParentItem(window.contentItem()); focusState[&parent].set(true, true); focusState[&child].set(false, false); focusState[&grandchild].set(false, false); @@ -858,7 +858,7 @@ void tst_qquickitem::reparentFocusedItem() ensureFocus(&window); QTRY_VERIFY(QGuiApplication::focusWindow() == &window); - QQuickItem parent(window.rootItem()); + QQuickItem parent(window.contentItem()); QQuickItem child(&parent); QQuickItem sibling(&parent); QQuickItem grandchild(&child); @@ -1035,12 +1035,12 @@ void tst_qquickitem::enabledFocus() QCOMPARE(root.hasFocus(), true); QCOMPARE(root.hasActiveFocus(), false); - root.setParentItem(window.rootItem()); + root.setParentItem(window.contentItem()); QCOMPARE(root.isEnabled(), false); QCOMPARE(root.hasFocus(), true); QCOMPARE(root.hasActiveFocus(), false); - QCOMPARE(window.activeFocusItem(), window.rootItem()); + QCOMPARE(window.activeFocusItem(), window.contentItem()); root.setEnabled(true); QCOMPARE(root.isEnabled(), true); @@ -1108,7 +1108,7 @@ void tst_qquickitem::enabledFocus() QCOMPARE(child1.isEnabled(), true); QCOMPARE(child1.hasFocus(), true); QCOMPARE(child1.hasActiveFocus(), false); - QCOMPARE(window.activeFocusItem(), window.rootItem()); + QCOMPARE(window.activeFocusItem(), window.contentItem()); child2.forceActiveFocus(); QCOMPARE(root.isEnabled(), true); @@ -1132,7 +1132,7 @@ void tst_qquickitem::enabledFocus() QCOMPARE(child2.isEnabled(), false); QCOMPARE(child2.hasFocus(), true); QCOMPARE(child2.hasActiveFocus(), false); - QCOMPARE(window.activeFocusItem(), window.rootItem()); + QCOMPARE(window.activeFocusItem(), window.contentItem()); child1.forceActiveFocus(); QCOMPARE(root.isEnabled(), false); @@ -1144,7 +1144,7 @@ void tst_qquickitem::enabledFocus() QCOMPARE(child2.isEnabled(), false); QCOMPARE(child2.hasFocus(), false); QCOMPARE(child2.hasActiveFocus(), false); - QCOMPARE(window.activeFocusItem(), window.rootItem()); + QCOMPARE(window.activeFocusItem(), window.contentItem()); root.setEnabled(true); QCOMPARE(root.isEnabled(), true); @@ -1168,13 +1168,13 @@ void tst_qquickitem::mouseGrab() TestItem *child1 = new TestItem; child1->setAcceptedMouseButtons(Qt::LeftButton); child1->setSize(QSizeF(200, 100)); - child1->setParentItem(window->rootItem()); + child1->setParentItem(window->contentItem()); TestItem *child2 = new TestItem; child2->setAcceptedMouseButtons(Qt::LeftButton); child2->setY(51); child2->setSize(QSizeF(200, 100)); - child2->setParentItem(window->rootItem()); + child2->setParentItem(window->contentItem()); QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50,50)); QTest::qWait(100); @@ -1253,7 +1253,7 @@ void tst_qquickitem::touchEventAcceptIgnore() TestItem *item = new TestItem; item->setSize(QSizeF(100, 100)); - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); item->acceptIncomingTouchEvents = itemSupportsTouch; static QTouchDevice* device = 0; @@ -1335,7 +1335,7 @@ void tst_qquickitem::polishOutsideAnimation() window->resize(200, 200); window->show(); - TestPolishItem *item = new TestPolishItem(window->rootItem()); + TestPolishItem *item = new TestPolishItem(window->contentItem()); item->setSize(QSizeF(200, 100)); QTest::qWait(50); @@ -1384,7 +1384,7 @@ void tst_qquickitem::wheelEvent() TestItem *item = new TestItem; item->setSize(QSizeF(200, 100)); - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); item->setEnabled(enabled); item->setVisible(visible); @@ -1470,7 +1470,7 @@ void tst_qquickitem::hoverEvent() HoverItem *item = new HoverItem; item->setSize(QSizeF(100, 100)); - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); item->setEnabled(enabled); item->setVisible(visible); @@ -1509,7 +1509,7 @@ void tst_qquickitem::hoverEventInParent() window->resize(200, 200); window->show(); - HoverItem *parentItem = new HoverItem(window->rootItem()); + HoverItem *parentItem = new HoverItem(window->contentItem()); parentItem->setSize(QSizeF(200, 200)); parentItem->setAcceptHoverEvents(true); @@ -1670,7 +1670,7 @@ void tst_qquickitem::acceptedMouseButtons() QQuickWindow window; item.setSize(QSizeF(200,100)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QTest::mousePress(&window, Qt::LeftButton, 0, QPoint(50, 50)); QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(50, 50)); diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp index b3a78f6a5e..8b445e38b9 100644 --- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp @@ -1551,10 +1551,9 @@ void tst_QQuickItem::visibleChildren() QCOMPARE(root->property("test4_3").toBool(), true); QCOMPARE(root->property("test4_4").toBool(), true); - QString warning1 = testFileUrl("visiblechildren.qml").toString() + ":96:32: QML Item: QQuickItem: visibleChildren property is readonly and cannot be assigned to."; + QString warning1 = testFileUrl("visiblechildren.qml").toString() + ":87: TypeError: Cannot read property 'visibleChildren' of null"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QMetaObject::invokeMethod(root, "tryWriteToReadonlyVisibleChildren"); - QCOMPARE(root->property("test5_1").toBool(), true); QMetaObject::invokeMethod(root, "reparentVisibleItem3"); QCOMPARE(root->property("test6_1").toBool(), true); diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp index 61762cb688..fdf834ce08 100644 --- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp +++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp @@ -259,7 +259,7 @@ void tst_QQuickItemLayer::layerVisibility() QQuickView view; view.setSource(testFileUrl("Visible.qml")); - QQuickItem *child = view.rootItem()->childItems().at(0); + QQuickItem *child = view.contentItem()->childItems().at(0); child->setProperty("layerVisible", visible); child->setProperty("layerEffect", effect); child->setProperty("layerOpacity", opacity); @@ -305,7 +305,7 @@ void tst_QQuickItemLayer::layerZOrder() QQuickView view; view.setSource(testFileUrl("ZOrder.qml")); - QQuickItem *child = view.rootItem()->childItems().at(0); + QQuickItem *child = view.contentItem()->childItems().at(0); child->setProperty("layerEffect", effect); view.show(); @@ -340,7 +340,7 @@ void tst_QQuickItemLayer::changeZOrder() QQuickView view; view.setSource(testFileUrl("ZOrderChange.qml")); - QQuickItem *child = view.rootItem()->childItems().at(0); + QQuickItem *child = view.contentItem()->childItems().at(0); child->setProperty("layerEnabled", layered); child->setProperty("layerEffect", effect); child->setProperty("layerZ", 1); diff --git a/tests/auto/quick/qquicklistview/qquicklistview.pro b/tests/auto/quick/qquicklistview/qquicklistview.pro index 3e9c09d02b..b0b1fc2518 100644 --- a/tests/auto/quick/qquicklistview/qquicklistview.pro +++ b/tests/auto/quick/qquicklistview/qquicklistview.pro @@ -14,3 +14,5 @@ TESTDATA = data/* QT += core-private gui-private qml-private quick-private v8-private testlib DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +mac:CONFIG += insignificant_test # QTBUG-27740 diff --git a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp index c3bf77da29..03e4b4084c 100644 --- a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp +++ b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp @@ -110,7 +110,7 @@ void tst_QQuickPaintedItem::initTestCase() void tst_QQuickPaintedItem::update() { TestPaintedItem item; - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(hasDirtyContentFlag(&item), false); item.update(); @@ -149,7 +149,7 @@ void tst_QQuickPaintedItem::opaquePainting() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.opaquePainting(), false); @@ -187,7 +187,7 @@ void tst_QQuickPaintedItem::antialiasing() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.antialiasing(), false); @@ -225,7 +225,7 @@ void tst_QQuickPaintedItem::mipmap() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.mipmap(), false); @@ -263,7 +263,7 @@ void tst_QQuickPaintedItem::performanceHints() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.performanceHints(), QQuickPaintedItem::PerformanceHints()); @@ -332,7 +332,7 @@ void tst_QQuickPaintedItem::contentScale() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QSignalSpy spy(&item, SIGNAL(contentsScaleChanged())); @@ -376,7 +376,7 @@ void tst_QQuickPaintedItem::contentsBoundingRect() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QCOMPARE(item.contentsBoundingRect(), QRectF(0, 0, 320, 240)); @@ -414,7 +414,7 @@ void tst_QQuickPaintedItem::fillColor() { TestPaintedItem item; item.setSize(QSizeF(320, 240)); - item.setParentItem(window.rootItem()); + item.setParentItem(window.contentItem()); QSignalSpy spy(&item, SIGNAL(fillColorChanged())); diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp index cb161c0eeb..b9a18eec01 100644 --- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp +++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp @@ -1481,13 +1481,13 @@ void tst_qquickpositioners::test_repeater() { QQuickView *window = createView(testFile("repeatertest.qml")); - QQuickRectangle *one = findItem<QQuickRectangle>(window->rootItem(), "one"); + QQuickRectangle *one = findItem<QQuickRectangle>(window->contentItem(), "one"); QVERIFY(one != 0); - QQuickRectangle *two = findItem<QQuickRectangle>(window->rootItem(), "two"); + QQuickRectangle *two = findItem<QQuickRectangle>(window->contentItem(), "two"); QVERIFY(two != 0); - QQuickRectangle *three = findItem<QQuickRectangle>(window->rootItem(), "three"); + QQuickRectangle *three = findItem<QQuickRectangle>(window->contentItem(), "three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); diff --git a/tests/auto/quick/qquicktext/qquicktext.pro b/tests/auto/quick/qquicktext/qquicktext.pro index 147b2c5334..4e3844bc58 100644 --- a/tests/auto/quick/qquicktext/qquicktext.pro +++ b/tests/auto/quick/qquicktext/qquicktext.pro @@ -14,3 +14,5 @@ TESTDATA = data/* QT += core-private gui-private v8-private qml-private quick-private network testlib DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +mac:CONFIG += insignificant_test # QTBUG-27740 diff --git a/tests/auto/quick/qquicktextedit/qquicktextedit.pro b/tests/auto/quick/qquicktextedit/qquicktextedit.pro index 5f352eb8c4..44def7f0f9 100644 --- a/tests/auto/quick/qquicktextedit/qquicktextedit.pro +++ b/tests/auto/quick/qquicktextedit/qquicktextedit.pro @@ -13,6 +13,6 @@ TESTDATA = data/* QT += core-private gui-private v8-private qml-private quick-private network-private testlib -CONFIG+=insignificant_test # until QTextBoundaryFinder gets fixed - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 + +mac:CONFIG += insignificant_test # QTBUG-27740 diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index 0f69009815..a5a5efb2d0 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -1191,7 +1191,7 @@ void tst_qquicktextedit::focusOnPress() QQuickWindow window; window.resize(100, 50); - textEditObject->setParentItem(window.rootItem()); + textEditObject->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -2903,7 +2903,7 @@ void tst_qquicktextedit::openInputPanel() anotherEdit.setFocus(false); QVERIFY(qApp->focusObject() != &anotherEdit); - QCOMPARE(view.activeFocusItem(), view.rootItem()); + QCOMPARE(view.activeFocusItem(), view.contentItem()); anotherEdit.setFocus(true); qApp->inputMethod()->hide(); @@ -4253,7 +4253,7 @@ void tst_qquicktextedit::keySequence() QVERIFY(textEdit != 0); QQuickWindow window; - textEdit->setParentItem(window.rootItem()); + textEdit->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -4416,7 +4416,7 @@ void tst_qquicktextedit::undo() QVERIFY(textEdit != 0); QQuickWindow window; - textEdit->setParentItem(window.rootItem()); + textEdit->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -4502,7 +4502,7 @@ void tst_qquicktextedit::redo() QVERIFY(textEdit != 0); QQuickWindow window; - textEdit->setParentItem(window.rootItem()); + textEdit->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -4726,7 +4726,7 @@ void tst_qquicktextedit::undo_keypressevents() QVERIFY(textEdit != 0); QQuickWindow window; - textEdit->setParentItem(window.rootItem()); + textEdit->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); diff --git a/tests/auto/quick/qquicktextinput/qquicktextinput.pro b/tests/auto/quick/qquicktextinput/qquicktextinput.pro index 53d2a30004..3240d99e90 100644 --- a/tests/auto/quick/qquicktextinput/qquicktextinput.pro +++ b/tests/auto/quick/qquicktextinput/qquicktextinput.pro @@ -13,6 +13,4 @@ TESTDATA = data/* QT += core-private gui-private v8-private qml-private quick-private testlib -CONFIG+=insignificant_test # until QTextBoundaryFinder gets fixed - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 1d65cef99b..249755b813 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -911,10 +911,12 @@ void tst_qquicktextinput::moveCursorSelection_data() QTest::newRow("jum<()>ped|words") << standard[0] << 23 << 23 << QQuickTextInput::SelectWords << 23 << 23 << true; - QTest::newRow("Hello<(,)> |words") - << standard[2] << 5 << 6 << QQuickTextInput::SelectWords << 5 << 6 << true; - QTest::newRow("Hello<(, )>world|words,ltr") - << standard[2] << 5 << 7 << QQuickTextInput::SelectWords << 5 << 7 << false; + QTest::newRow("<Hello(,)> |words,ltr") + << standard[2] << 5 << 6 << QQuickTextInput::SelectWords << 0 << 6 << false; + QTest::newRow("Hello<(,)> |words,rtl") + << standard[2] << 6 << 5 << QQuickTextInput::SelectWords << 5 << 6 << false; + QTest::newRow("<Hello(, )>world|words,ltr") + << standard[2] << 5 << 7 << QQuickTextInput::SelectWords << 0 << 7 << false; QTest::newRow("Hello<(, )world>|words,rtl") << standard[2] << 7 << 5 << QQuickTextInput::SelectWords << 5 << 12 << false; QTest::newRow("<Hel(lo, )>world|words,ltr") @@ -927,35 +929,35 @@ void tst_qquicktextinput::moveCursorSelection_data() << standard[2] << 5 << 5 << QQuickTextInput::SelectWords << 5 << 5 << true; QTest::newRow("Hello,<()>|words") << standard[2] << 6 << 6 << QQuickTextInput::SelectWords << 6 << 6 << true; - QTest::newRow("Hello<,( )>world|words,ltr") - << standard[2] << 6 << 7 << QQuickTextInput::SelectWords << 5 << 7 << false; + QTest::newRow("Hello,<( )>world|words,ltr") + << standard[2] << 6 << 7 << QQuickTextInput::SelectWords << 6 << 7 << false; QTest::newRow("Hello,<( )world>|words,rtl") << standard[2] << 7 << 6 << QQuickTextInput::SelectWords << 6 << 12 << false; - QTest::newRow("Hello<,( world)>|words,ltr") - << standard[2] << 6 << 12 << QQuickTextInput::SelectWords << 5 << 12 << false; - QTest::newRow("Hello,<( world)>|words,rtl") - << standard[2] << 12 << 6 << QQuickTextInput::SelectWords << 6 << 12 << false; - QTest::newRow("Hello<,( world!)>|words,ltr") - << standard[2] << 6 << 13 << QQuickTextInput::SelectWords << 5 << 13 << false; - QTest::newRow("Hello,<( world!)>|words,rtl") - << standard[2] << 13 << 6 << QQuickTextInput::SelectWords << 6 << 13 << false; - QTest::newRow("Hello<(, world!)>|words") - << standard[2] << 5 << 13 << QQuickTextInput::SelectWords << 5 << 13 << true; - // Fails due to an issue with QTextBoundaryFinder and punctuation at the end of strings. - // QTBUG-11365 - // QTest::newRow("world<(!)>|words") - // << standard[2] << 12 << 13 << QQuickTextInput::SelectWords << 12 << 13 << true; + QTest::newRow("Hello,<( world)>|words") + << standard[2] << 6 << 12 << QQuickTextInput::SelectWords << 6 << 12 << true; + QTest::newRow("Hello,<( world!)>|words") + << standard[2] << 6 << 13 << QQuickTextInput::SelectWords << 6 << 13 << true; + QTest::newRow("<Hello(, world!)>|words,ltr") + << standard[2] << 5 << 13 << QQuickTextInput::SelectWords << 0 << 13 << false; + QTest::newRow("Hello<(, world!)>|words,rtl") + << standard[2] << 13 << 5 << QQuickTextInput::SelectWords << 5 << 13 << false; + QTest::newRow("<world(!)>|words,ltr") + << standard[2] << 12 << 13 << QQuickTextInput::SelectWords << 7 << 13 << false; + QTest::newRow("world<(!)>|words,rtl") + << standard[2] << 13 << 12 << QQuickTextInput::SelectWords << 12 << 13 << false; QTest::newRow("world!<()>)|words") << standard[2] << 13 << 13 << QQuickTextInput::SelectWords << 13 << 13 << true; QTest::newRow("world<()>!)|words") << standard[2] << 12 << 12 << QQuickTextInput::SelectWords << 12 << 12 << true; - QTest::newRow("<(,)>olleH |words") - << standard[3] << 7 << 8 << QQuickTextInput::SelectWords << 7 << 8 << true; + QTest::newRow("<(,)>olleH |words,ltr") + << standard[3] << 7 << 8 << QQuickTextInput::SelectWords << 7 << 8 << false; + QTest::newRow("<(,)olleH> |words,rtl") + << standard[3] << 8 << 7 << QQuickTextInput::SelectWords << 7 << 13 << false; QTest::newRow("<dlrow( ,)>olleH|words,ltr") << standard[3] << 6 << 8 << QQuickTextInput::SelectWords << 1 << 8 << false; - QTest::newRow("dlrow<( ,)>olleH|words,rtl") - << standard[3] << 8 << 6 << QQuickTextInput::SelectWords << 6 << 8 << false; + QTest::newRow("dlrow<( ,)olleH>|words,rtl") + << standard[3] << 8 << 6 << QQuickTextInput::SelectWords << 6 << 13 << false; QTest::newRow("<dlrow( ,ol)leH>|words,ltr") << standard[3] << 6 << 10 << QQuickTextInput::SelectWords << 1 << 13 << false; QTest::newRow("dlrow<( ,ol)leH>|words,rtl") @@ -968,20 +970,20 @@ void tst_qquicktextinput::moveCursorSelection_data() << standard[3] << 7 << 7 << QQuickTextInput::SelectWords << 7 << 7 << true; QTest::newRow("<dlrow( )>,olleH|words,ltr") << standard[3] << 6 << 7 << QQuickTextInput::SelectWords << 1 << 7 << false; - QTest::newRow("dlrow<( ),>olleH|words,rtl") - << standard[3] << 7 << 6 << QQuickTextInput::SelectWords << 6 << 8 << false; - QTest::newRow("<(dlrow )>,olleH|words,ltr") - << standard[3] << 1 << 7 << QQuickTextInput::SelectWords << 1 << 7 << false; - QTest::newRow("<(dlrow ),>olleH|words,rtl") - << standard[3] << 7 << 1 << QQuickTextInput::SelectWords << 1 << 8 << false; - QTest::newRow("<(!dlrow )>,olleH|words,ltr") - << standard[3] << 0 << 7 << QQuickTextInput::SelectWords << 0 << 7 << false; - QTest::newRow("<(!dlrow ),>olleH|words,rtl") - << standard[3] << 7 << 0 << QQuickTextInput::SelectWords << 0 << 8 << false; - QTest::newRow("(!dlrow ,)olleH|words") - << standard[3] << 0 << 8 << QQuickTextInput::SelectWords << 0 << 8 << true; - QTest::newRow("<(!)>dlrow|words") - << standard[3] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 1 << true; + QTest::newRow("dlrow<( )>,olleH|words,rtl") + << standard[3] << 7 << 6 << QQuickTextInput::SelectWords << 6 << 7 << false; + QTest::newRow("<(dlrow )>,olleH|words") + << standard[3] << 1 << 7 << QQuickTextInput::SelectWords << 1 << 7 << true; + QTest::newRow("<(!dlrow )>,olleH|words") + << standard[3] << 0 << 7 << QQuickTextInput::SelectWords << 0 << 7 << true; + QTest::newRow("<(!dlrow ,)>olleH|words,ltr") + << standard[3] << 0 << 8 << QQuickTextInput::SelectWords << 0 << 8 << false; + QTest::newRow("<(!dlrow ,)olleH>|words,rtl") + << standard[3] << 8 << 0 << QQuickTextInput::SelectWords << 0 << 13 << false; + QTest::newRow("<(!)>dlrow|words,ltr") + << standard[3] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 1 << false; + QTest::newRow("<(!)dlrow|words,rtl") + << standard[3] << 1 << 0 << QQuickTextInput::SelectWords << 0 << 6 << false; QTest::newRow("<()>!dlrow|words") << standard[3] << 0 << 0 << QQuickTextInput::SelectWords << 0 << 0 << true; QTest::newRow("!<()>dlrow|words") @@ -990,16 +992,15 @@ void tst_qquicktextinput::moveCursorSelection_data() QTest::newRow(" <s(pac)ey> text |words") << standard[4] << 1 << 4 << QQuickTextInput::SelectWords << 1 << 7 << true; QTest::newRow(" spacey <t(ex)t> |words") - << standard[4] << 11 << 13 << QQuickTextInput::SelectWords << 10 << 14 << false; // Should be reversible. QTBUG-11365 + << standard[4] << 11 << 13 << QQuickTextInput::SelectWords << 10 << 14 << true; QTest::newRow("<( )>spacey text |words|ltr") << standard[4] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 1 << false; QTest::newRow("<( )spacey> text |words|rtl") << standard[4] << 1 << 0 << QQuickTextInput::SelectWords << 0 << 7 << false; QTest::newRow("spacey <text( )>|words|ltr") << standard[4] << 14 << 15 << QQuickTextInput::SelectWords << 10 << 15 << false; -// QTBUG-11365 -// QTest::newRow("spacey text<( )>|words|rtl") -// << standard[4] << 15 << 14 << QQuickTextInput::SelectWords << 14 << 15 << false; + QTest::newRow("spacey text<( )>|words|rtl") + << standard[4] << 15 << 14 << QQuickTextInput::SelectWords << 14 << 15 << false; QTest::newRow("<()> spacey text |words") << standard[4] << 0 << 0 << QQuickTextInput::SelectWords << 0 << 0 << false; QTest::newRow(" spacey text <()>|words") @@ -2502,7 +2503,7 @@ void tst_qquicktextinput::copyAndPasteKeySequence() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -3297,7 +3298,7 @@ void tst_qquicktextinput::focusOnPress() QQuickWindow window; window.resize(100, 50); - textInputObject->setParentItem(window.rootItem()); + textInputObject->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -3405,7 +3406,7 @@ void tst_qquicktextinput::openInputPanel() anotherInput.setFocus(false); QVERIFY(qApp->focusObject() != &anotherInput); - QCOMPARE(view.activeFocusItem(), view.rootItem()); + QCOMPARE(view.activeFocusItem(), view.contentItem()); anotherInput.setFocus(true); qApp->inputMethod()->hide(); @@ -3449,7 +3450,7 @@ void tst_qquicktextinput::setHAlignClearCache() QQuickView view; MyTextInput input; input.setText("Hello world"); - input.setParentItem(view.rootItem()); + input.setParentItem(view.contentItem()); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowActive(&view); @@ -3469,8 +3470,8 @@ void tst_qquicktextinput::focusOutClearSelection() QQuickTextInput input2; input.setText(QLatin1String("Hello world")); input.setFocus(true); - input2.setParentItem(view.rootItem()); - input.setParentItem(view.rootItem()); + input2.setParentItem(view.contentItem()); + input.setParentItem(view.contentItem()); input.componentComplete(); input2.componentComplete(); view.show(); @@ -4967,7 +4968,7 @@ void tst_qquicktextinput::keySequence() textInput->setEchoMode(echoMode); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -5128,7 +5129,7 @@ void tst_qquicktextinput::undo() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -5214,7 +5215,7 @@ void tst_qquicktextinput::redo() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -5546,7 +5547,7 @@ void tst_qquicktextinput::undo_keypressevents() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -5953,7 +5954,7 @@ void tst_qquicktextinput::setInputMask() textInput->insert(0, input); } else { QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); @@ -6083,7 +6084,7 @@ void tst_qquicktextinput::keypress_inputMask() QVERIFY(textInput != 0); QQuickWindow window; - textInput->setParentItem(window.rootItem()); + textInput->setParentItem(window.contentItem()); window.show(); window.requestActivateWindow(); QTest::qWaitForWindowActive(&window); diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp index 2b60ac3733..bd2c964e1e 100644 --- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp +++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp @@ -262,7 +262,7 @@ class StandardItemModel : public QStandardItemModel Q_PROPERTY(QQmlListProperty<StandardItem> items READ items CONSTANT) Q_CLASSINFO("DefaultProperty", "items") public: - QQmlListProperty<StandardItem> items() { return QQmlListProperty<StandardItem>(this, 0, append); } + QQmlListProperty<StandardItem> items() { return QQmlListProperty<StandardItem>(this, 0, append, 0, 0, 0); } static void append(QQmlListProperty<StandardItem> *property, StandardItem *item) { @@ -956,7 +956,7 @@ void tst_qquickvisualdatamodel::itemsDestroyed() view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); - QVERIFY(delegate = findItem<QQuickItem>(view.rootItem(), "delegate", 1)); + QVERIFY(delegate = findItem<QQuickItem>(view.contentItem(), "delegate", 1)); } QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); QVERIFY(!delegate); @@ -3073,7 +3073,7 @@ void tst_qquickvisualdatamodel::insert() QScopedPointer<QObject> object(component.create()); QQuickListView *listView = qobject_cast<QQuickListView *>(object.data()); QVERIFY(listView); - listView->setParentItem(window.rootItem()); + listView->setParentItem(window.contentItem()); QQuickItem *contentItem = listView->contentItem(); QVERIFY(contentItem); @@ -3537,7 +3537,7 @@ void tst_qquickvisualdatamodel::resolve() QScopedPointer<QObject> object(component.create()); QQuickListView *listView = qobject_cast<QQuickListView *>(object.data()); QVERIFY(listView); - listView->setParentItem(window.rootItem()); + listView->setParentItem(window.contentItem()); QQuickItem *contentItem = listView->contentItem(); QVERIFY(contentItem); @@ -3937,7 +3937,7 @@ void tst_qquickvisualdatamodel::warnings() QScopedPointer<QObject> object(component.create()); QQuickListView *listView = qobject_cast<QQuickListView *>(object.data()); QVERIFY(listView); - listView->setParentItem(window.rootItem()); + listView->setParentItem(window.contentItem()); QQuickItem *contentItem = listView->contentItem(); QVERIFY(contentItem); diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 04bb5800f3..c108ac4562 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -120,11 +120,11 @@ public: , m_rootItem(0) { } - Q_INVOKABLE QQuickItem *rootItem() + Q_INVOKABLE QQuickItem *contentItem() { if (!m_rootItem) { QQuickWindowPrivate *c = QQuickWindowPrivate::get(window()); - m_rootItem = c->rootItem; + m_rootItem = c->contentItem; QObject::connect(m_rootItem, SIGNAL(destroyed()), this, SLOT(rootItemDestroyed())); } return m_rootItem; @@ -326,7 +326,7 @@ void tst_qquickwindow::constantUpdates() { QQuickWindow window; window.resize(250, 250); - ConstantUpdateItem item(window.rootItem()); + ConstantUpdateItem item(window.contentItem()); window.show(); QTRY_VERIFY(item.iterations > 60); } @@ -343,7 +343,7 @@ void tst_qquickwindow::touchEvent_basic() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *bottomItem = new TestTouchItem(window->rootItem()); + TestTouchItem *bottomItem = new TestTouchItem(window->contentItem()); bottomItem->setObjectName("Bottom Item"); bottomItem->setSize(QSizeF(150, 150)); @@ -472,7 +472,7 @@ void tst_qquickwindow::touchEvent_propagation() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *bottomItem = new TestTouchItem(window->rootItem()); + TestTouchItem *bottomItem = new TestTouchItem(window->contentItem()); bottomItem->setObjectName("Bottom Item"); bottomItem->setSize(QSizeF(150, 150)); @@ -605,7 +605,7 @@ void tst_qquickwindow::touchEvent_cancel() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *item = new TestTouchItem(window->rootItem()); + TestTouchItem *item = new TestTouchItem(window->contentItem()); item->setPos(QPointF(50, 50)); item->setSize(QSizeF(150, 150)); @@ -638,7 +638,7 @@ void tst_qquickwindow::touchEvent_reentrant() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *item = new TestTouchItem(window->rootItem()); + TestTouchItem *item = new TestTouchItem(window->contentItem()); item->spinLoopWhenPressed = true; // will call processEvents() from the touch handler @@ -676,7 +676,7 @@ void tst_qquickwindow::touchEvent_velocity() QVERIFY(QTest::qWaitForWindowExposed(window)); QTest::qWait(10); - TestTouchItem *item = new TestTouchItem(window->rootItem()); + TestTouchItem *item = new TestTouchItem(window->contentItem()); item->setPos(QPointF(50, 50)); item->setSize(QSizeF(150, 150)); @@ -732,7 +732,7 @@ void tst_qquickwindow::mouseFromTouch_basic() QVERIFY(QTest::qWaitForWindowExposed(window)); QTest::qWait(10); - TestTouchItem *item = new TestTouchItem(window->rootItem()); + TestTouchItem *item = new TestTouchItem(window->contentItem()); item->setPos(QPointF(50, 50)); item->setSize(QSizeF(150, 150)); item->acceptTouchEvents = false; @@ -788,7 +788,7 @@ void tst_qquickwindow::clearWindow() { QQuickWindow *window = new QQuickWindow; QQuickItem *item = new QQuickItem; - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); QVERIFY(item->window() == window); @@ -810,7 +810,7 @@ void tst_qquickwindow::mouseFiltering() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window)); - TestTouchItem *bottomItem = new TestTouchItem(window->rootItem()); + TestTouchItem *bottomItem = new TestTouchItem(window->contentItem()); bottomItem->setObjectName("Bottom Item"); bottomItem->setSize(QSizeF(150, 150)); @@ -1018,7 +1018,7 @@ void tst_qquickwindow::ignoreUnhandledMouseEvents() QQuickItem* item = new QQuickItem; item->setSize(QSizeF(100, 100)); - item->setParentItem(window->rootItem()); + item->setParentItem(window->contentItem()); { QMouseEvent me(QEvent::MouseButtonPress, QPointF(50, 50), Qt::LeftButton, Qt::LeftButton, @@ -1079,7 +1079,7 @@ void tst_qquickwindow::cursor() QQuickItem parentItem; parentItem.setPos(QPointF(0, 0)); parentItem.setSize(QSizeF(180, 180)); - parentItem.setParentItem(window.rootItem()); + parentItem.setParentItem(window.contentItem()); QQuickItem childItem; childItem.setPos(QPointF(60, 90)); @@ -1090,7 +1090,7 @@ void tst_qquickwindow::cursor() clippingItem.setPos(QPointF(120, 120)); clippingItem.setSize(QSizeF(180, 180)); clippingItem.setClip(true); - clippingItem.setParentItem(window.rootItem()); + clippingItem.setParentItem(window.contentItem()); QQuickItem clippedItem; clippedItem.setPos(QPointF(-30, -30)); diff --git a/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml b/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml index b2dcf4e675..0eb0a37de8 100644 --- a/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml +++ b/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml @@ -42,7 +42,7 @@ Rectangle { anchors.fill: parent anchors.margins: 10 radius: index * 20 - border.aligned: local._index == 1 + border.pixelAligned: local._index == 1 border.width: local._index == 0 ? 0 : 0.5 opacity: 0.5 color: "steelBlue" @@ -58,7 +58,7 @@ Rectangle { anchors.fill: parent anchors.margins: 10 radius: index * 20 - border.aligned: local._index == 1 + border.pixelAligned: local._index == 1 border.width: local._index == 0 ? 0 : 0.5 opacity: 0.5 gradient: Gradient { diff --git a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml index 47687918e0..76ce60fd7d 100644 --- a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml +++ b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_1.qml @@ -69,7 +69,7 @@ Rectangle { anchors.margins: 10 width: 200 height: 100 - culling: model.bar + cullMode: model.bar property variant frontSource: front property variant backSource: back fragmentShader: " diff --git a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml index a6fcc260cd..45f20dd5a4 100644 --- a/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml +++ b/tests/manual/scenegraph_lancelot/data/shaders/culling/culling_2.qml @@ -69,7 +69,7 @@ Rectangle { anchors.margins: 10 width: 200 height: 100 - culling: model.bar + cullMode: model.bar property variant frontSource: front property variant backSource: back fragmentShader: " |