diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-02-03 21:52:20 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-02-03 21:52:20 +0100 |
commit | 2c6b04420c9aec4dc65c2492ae49e3ebca10027c (patch) | |
tree | 893f0736d3ce378426f072abfc7f4737dd0743e1 /tests/auto/quick | |
parent | 789929f939a60462373beae37ab4373809095cff (diff) | |
parent | bda38eae465fdf7dc719966e1199eafc7eb7c27c (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
src/qml/common/qv4compileddata_p.h
tests/auto/qml/qmlmin/tst_qmlmin.cpp
Change-Id: Ieabc9e0729630de6a8644024d11b765f35199f29
Diffstat (limited to 'tests/auto/quick')
10 files changed, 217 insertions, 6 deletions
diff --git a/tests/auto/quick/pointerhandlers/qquickdraghandler/data/draggables.qml b/tests/auto/quick/pointerhandlers/qquickdraghandler/data/draggables.qml index 7b3601bea0..81fa20f3bb 100644 --- a/tests/auto/quick/pointerhandlers/qquickdraghandler/data/draggables.qml +++ b/tests/auto/quick/pointerhandlers/qquickdraghandler/data/draggables.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the manual tests of the Qt Toolkit. @@ -26,7 +26,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick 2.15 Item { id: root @@ -47,6 +47,7 @@ Item { DragHandler { id: dragHandler objectName: "DragHandler " + (index + 1) + cursorShape: Qt.ClosedHandCursor } Text { diff --git a/tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp b/tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp index 65c5ac9ef4..47cfd27817 100644 --- a/tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquickdraghandler/tst_qquickdraghandler.cpp @@ -249,8 +249,11 @@ void tst_DragHandler::mouseDrag() QPointF ballCenter = ball->clipRect().center(); QPointF scenePressPos = ball->mapToScene(ballCenter); QPoint p1 = scenePressPos.toPoint(); - QTest::mousePress(window, static_cast<Qt::MouseButton>(int(dragButton)), Qt::NoModifier, p1); + QTest::mousePress(window, static_cast<Qt::MouseButton>(int(dragButton)), Qt::NoModifier, p1, 500); QVERIFY(!dragHandler->active()); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif if (shouldDrag) { QCOMPARE(dragHandler->centroid().position(), ballCenter); QCOMPARE(dragHandler->centroid().pressPosition(), ballCenter); @@ -265,6 +268,9 @@ void tst_DragHandler::mouseDrag() QTRY_VERIFY(dragHandler->centroid().velocity().x() > 0); QCOMPARE(centroidChangedSpy.count(), 2); QVERIFY(!dragHandler->active()); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif } p1 += QPoint(1, 0); QTest::mouseMove(window, p1); @@ -292,6 +298,9 @@ void tst_DragHandler::mouseDrag() QCOMPARE(dragHandler->translation().y(), 0.0); QVERIFY(dragHandler->centroid().velocity().x() > 0); QCOMPARE(centroidChangedSpy.count(), 4); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ClosedHandCursor); +#endif } QTest::mouseRelease(window, static_cast<Qt::MouseButton>(int(dragButton)), Qt::NoModifier, p1); QTRY_VERIFY(!dragHandler->active()); @@ -300,6 +309,10 @@ void tst_DragHandler::mouseDrag() QCOMPARE(ball->mapToScene(ballCenter).toPoint(), p1); QCOMPARE(translationChangedSpy.count(), shouldDrag ? 1 : 0); QCOMPARE(centroidChangedSpy.count(), shouldDrag ? 5 : 0); +#if QT_CONFIG(cursor) + QTest::mouseMove(window, p1 + QPoint(1, 0)); // TODO after fixing QTBUG-53987, don't send mouseMove + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif } void tst_DragHandler::mouseDragThreshold_data() diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/data/lesHoverables.qml b/tests/auto/quick/pointerhandlers/qquickhoverhandler/data/lesHoverables.qml index 011dc4e75f..38a19c57c5 100644 --- a/tests/auto/quick/pointerhandlers/qquickhoverhandler/data/lesHoverables.qml +++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/data/lesHoverables.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -26,7 +26,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick 2.15 Rectangle { id: root @@ -52,6 +52,7 @@ Rectangle { id: buttonMA objectName: "buttonMA" hoverEnabled: true + cursorShape: Qt.UpArrowCursor anchors.fill: parent onClicked: console.log("clicked MA") } @@ -74,9 +75,12 @@ Rectangle { id: buttonHH objectName: "buttonHH" acceptedDevices: PointerDevice.AllDevices + cursorShape: tapHandler.pressed ? Qt.BusyCursor : Qt.PointingHandCursor } - TapHandler { } + TapHandler { + id: tapHandler + } Text { anchors.centerIn: parent @@ -127,6 +131,7 @@ Rectangle { HoverHandler { id: topSidebarHH objectName: "topSidebarHH" + cursorShape: Qt.OpenHandCursor } Loader { @@ -152,6 +157,7 @@ Rectangle { id: bottomSidebarMA objectName: "bottomSidebarMA" hoverEnabled: true + cursorShape: Qt.ClosedHandCursor anchors.fill: parent } diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp index 575139f851..61f2752dd2 100644 --- a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp @@ -104,30 +104,45 @@ void tst_HoverHandler::hoverHandlerAndUnderlyingHoverHandler() QCOMPARE(sidebarHoveredSpy.count(), 0); QCOMPARE(buttonHH->isHovered(), false); QCOMPARE(buttonHoveredSpy.count(), 0); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif QTest::mouseMove(window, rightOfButton); QCOMPARE(topSidebarHH->isHovered(), true); QCOMPARE(sidebarHoveredSpy.count(), 1); QCOMPARE(buttonHH->isHovered(), false); QCOMPARE(buttonHoveredSpy.count(), 0); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::OpenHandCursor); +#endif QTest::mouseMove(window, buttonCenter); QCOMPARE(topSidebarHH->isHovered(), true); QCOMPARE(sidebarHoveredSpy.count(), 1); QCOMPARE(buttonHH->isHovered(), true); QCOMPARE(buttonHoveredSpy.count(), 1); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::PointingHandCursor); +#endif QTest::mouseMove(window, rightOfButton); QCOMPARE(topSidebarHH->isHovered(), true); QCOMPARE(sidebarHoveredSpy.count(), 1); QCOMPARE(buttonHH->isHovered(), false); QCOMPARE(buttonHoveredSpy.count(), 2); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::OpenHandCursor); +#endif QTest::mouseMove(window, outOfSidebar); QCOMPARE(topSidebarHH->isHovered(), false); QCOMPARE(sidebarHoveredSpy.count(), 2); QCOMPARE(buttonHH->isHovered(), false); QCOMPARE(buttonHoveredSpy.count(), 2); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif } void tst_HoverHandler::mouseAreaAndUnderlyingHoverHandler() @@ -153,30 +168,45 @@ void tst_HoverHandler::mouseAreaAndUnderlyingHoverHandler() QCOMPARE(sidebarHoveredSpy.count(), 0); QCOMPARE(buttonMA->hovered(), false); QCOMPARE(buttonHoveredSpy.count(), 0); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif QTest::mouseMove(window, rightOfButton); QCOMPARE(topSidebarHH->isHovered(), true); QCOMPARE(sidebarHoveredSpy.count(), 1); QCOMPARE(buttonMA->hovered(), false); QCOMPARE(buttonHoveredSpy.count(), 0); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::OpenHandCursor); +#endif QTest::mouseMove(window, buttonCenter); QCOMPARE(topSidebarHH->isHovered(), true); QCOMPARE(sidebarHoveredSpy.count(), 1); QCOMPARE(buttonMA->hovered(), true); QCOMPARE(buttonHoveredSpy.count(), 1); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::UpArrowCursor); +#endif QTest::mouseMove(window, rightOfButton); QCOMPARE(topSidebarHH->isHovered(), true); QCOMPARE(sidebarHoveredSpy.count(), 1); QCOMPARE(buttonMA->hovered(), false); QCOMPARE(buttonHoveredSpy.count(), 2); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::OpenHandCursor); +#endif QTest::mouseMove(window, outOfSidebar); QCOMPARE(topSidebarHH->isHovered(), false); QCOMPARE(sidebarHoveredSpy.count(), 2); QCOMPARE(buttonMA->hovered(), false); QCOMPARE(buttonHoveredSpy.count(), 2); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif } void tst_HoverHandler::hoverHandlerAndUnderlyingMouseArea() @@ -204,30 +234,45 @@ void tst_HoverHandler::hoverHandlerAndUnderlyingMouseArea() QCOMPARE(sidebarHoveredSpy.count(), 0); QCOMPARE(buttonHH->isHovered(), false); QCOMPARE(buttonHoveredSpy.count(), 0); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif QTest::mouseMove(window, rightOfButton); QCOMPARE(bottomSidebarMA->hovered(), true); QCOMPARE(sidebarHoveredSpy.count(), 1); QCOMPARE(buttonHH->isHovered(), false); QCOMPARE(buttonHoveredSpy.count(), 0); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ClosedHandCursor); +#endif QTest::mouseMove(window, buttonCenter); QCOMPARE(bottomSidebarMA->hovered(), false); QCOMPARE(sidebarHoveredSpy.count(), 2); QCOMPARE(buttonHH->isHovered(), true); QCOMPARE(buttonHoveredSpy.count(), 1); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::PointingHandCursor); +#endif QTest::mouseMove(window, rightOfButton); QCOMPARE(bottomSidebarMA->hovered(), true); QCOMPARE(sidebarHoveredSpy.count(), 3); QCOMPARE(buttonHH->isHovered(), false); QCOMPARE(buttonHoveredSpy.count(), 2); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ClosedHandCursor); +#endif QTest::mouseMove(window, outOfSidebar); QCOMPARE(bottomSidebarMA->hovered(), false); QCOMPARE(sidebarHoveredSpy.count(), 4); QCOMPARE(buttonHH->isHovered(), false); QCOMPARE(buttonHoveredSpy.count(), 2); +#if QT_CONFIG(cursor) + QCOMPARE(window->cursor().shape(), Qt::ArrowCursor); +#endif } void tst_HoverHandler::movingItemWithHoverHandler() @@ -255,6 +300,7 @@ void tst_HoverHandler::movingItemWithHoverHandler() QVERIFY(QTest::qWaitForWindowExposed(window)); QTRY_COMPARE(paddleHH->isHovered(), true); + // TODO check the cursor shape after fixing QTBUG-53987 paddle->setX(100); QTRY_COMPARE(paddleHH->isHovered(), false); diff --git a/tests/auto/quick/qquickbehaviors/data/targetProperty.qml b/tests/auto/quick/qquickbehaviors/data/targetProperty.qml new file mode 100644 index 0000000000..18abd46010 --- /dev/null +++ b/tests/auto/quick/qquickbehaviors/data/targetProperty.qml @@ -0,0 +1,16 @@ +import QtQuick 2.15 + +Item { + readonly property QtObject xBehaviorObject: xBehavior.targetProperty.object + readonly property string xBehaviorName: xBehavior.targetProperty.name + readonly property QtObject emptyBehaviorObject: emptyBehavior.targetProperty.object + readonly property string emptyBehaviorName: emptyBehavior.targetProperty.name + Behavior on x { + id: xBehavior + objectName: "xBehavior" + } + Behavior { + id: emptyBehavior + objectName: "emptyBehavior" + } +} diff --git a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp index 64e32dcdfd..3b46019f64 100644 --- a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp +++ b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp @@ -75,6 +75,7 @@ private slots: void innerBehaviorOverwritten(); void oneWay(); void safeToDelete(); + void targetProperty(); }; void tst_qquickbehaviors::simpleBehavior() @@ -656,6 +657,27 @@ void tst_qquickbehaviors::safeToDelete() QVERIFY(c.create()); } +Q_DECLARE_METATYPE(QQmlProperty) +void tst_qquickbehaviors::targetProperty() +{ + QQmlEngine engine; + QQmlComponent c(&engine, testFileUrl("targetProperty.qml")); + QScopedPointer<QQuickItem> item(qobject_cast<QQuickItem*>(c.create())); + QVERIFY2(!item.isNull(), qPrintable(c.errorString())); + + QQuickBehavior* xBehavior = + qobject_cast<QQuickBehavior*>(item->findChild<QQuickBehavior*>("xBehavior")); + QCOMPARE(xBehavior->property("targetProperty").value<QQmlProperty>(), QQmlProperty(item.data(), "x")); + QCOMPARE(item->property("xBehaviorObject").value<QObject*>(), item.data()); + QCOMPARE(item->property("xBehaviorName").toString(), "x"); + + QQuickBehavior* emptyBehavior = + qobject_cast<QQuickBehavior*>(item->findChild<QQuickBehavior*>("emptyBehavior")); + QCOMPARE(emptyBehavior->property("targetProperty").value<QQmlProperty>().isValid(), false); + QCOMPARE(item->property("emptyBehaviorObject").value<QObject*>(), nullptr); + QCOMPARE(item->property("emptyBehaviorName").toString(), ""); +} + QTEST_MAIN(tst_qquickbehaviors) diff --git a/tests/auto/quick/qquickimage/data/ProPhoto.jpg b/tests/auto/quick/qquickimage/data/ProPhoto.jpg Binary files differnew file mode 100644 index 0000000000..481d35ca8e --- /dev/null +++ b/tests/auto/quick/qquickimage/data/ProPhoto.jpg diff --git a/tests/auto/quick/qquickimage/data/image.qml b/tests/auto/quick/qquickimage/data/image.qml new file mode 100644 index 0000000000..09a577cc6f --- /dev/null +++ b/tests/auto/quick/qquickimage/data/image.qml @@ -0,0 +1,5 @@ +import QtQuick 2.15 + +Image { + source: "heart.png" +} diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp index abc7cd86bd..f0b44743b9 100644 --- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp +++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp @@ -51,6 +51,7 @@ #include "../../shared/testhttpserver.h" #include "../shared/visualtestutil.h" +// #define DEBUG_WRITE_OUTPUT using namespace QQuickVisualTestUtil; @@ -89,6 +90,8 @@ private slots: void imageCrash_QTBUG_32513(); void sourceSize_data(); void sourceSize(); + void sourceClipRect_data(); + void sourceClipRect(); void progressAndStatusChanges(); void sourceSizeChanges(); void correctStatus(); @@ -99,6 +102,7 @@ private slots: void urlInterceptor(); void multiFrame_data(); void multiFrame(); + void colorSpace(); private: QQmlEngine engine; @@ -879,6 +883,72 @@ void tst_qquickimage::sourceSizeChanges() delete img; } +void tst_qquickimage::sourceClipRect_data() +{ + QTest::addColumn<QRectF>("sourceClipRect"); + QTest::addColumn<QSize>("sourceSize"); + QTest::addColumn<QList<QPoint>>("redPixelLocations"); + QTest::addColumn<QList<QPoint>>("bluePixelLocations"); + + QTest::newRow("unclipped") << QRectF() << QSize() + << (QList<QPoint>() << QPoint(80, 80) << QPoint(150, 256)) + << (QList<QPoint>() << QPoint(28, 28) << QPoint(215, 215)); + QTest::newRow("upperLeft") << QRectF(10, 10, 100, 100) << QSize() + << (QList<QPoint>() << QPoint(99, 99)) + << (QList<QPoint>() << QPoint(100, 100) << QPoint(28, 28)); + QTest::newRow("lowerRight") << QRectF(200, 200, 20, 20) << QSize() + << (QList<QPoint>() << QPoint(0, 0)) + << (QList<QPoint>() << QPoint(14, 14)); + QTest::newRow("miniMiddle") << QRectF(20, 20, 60, 60) << QSize(100, 100) + << (QList<QPoint>() << QPoint(59, 0) << QPoint(6, 12) << QPoint(42, 42)) + << (QList<QPoint>() << QPoint(54, 54) << QPoint(15, 59)); +} + +void tst_qquickimage::sourceClipRect() +{ + QFETCH(QRectF, sourceClipRect); + QFETCH(QSize, sourceSize); + QFETCH(QList<QPoint>, redPixelLocations); + QFETCH(QList<QPoint>, bluePixelLocations); + + QScopedPointer<QQuickView> window(new QQuickView(nullptr)); + + window->setColor(Qt::blue); + window->setSource(testFileUrl("image.qml")); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window.data())); + + QQuickImage *image = qobject_cast<QQuickImage*>(window->rootObject()); + QVERIFY(image); + + image->setSourceSize(sourceSize); + QCOMPARE(image->implicitWidth(), sourceSize.isValid() ? sourceSize.width() : 300); + QCOMPARE(image->implicitHeight(), sourceSize.isValid() ? sourceSize.height() : 300); + image->setSourceClipRect(sourceClipRect); + QCOMPARE(image->implicitWidth(), sourceClipRect.isNull() ? 300 : sourceClipRect.width()); + QCOMPARE(image->implicitHeight(), sourceClipRect.isNull() ? 300 : sourceClipRect.height()); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage contents = window->grabWindow(); + if (contents.width() < sourceClipRect.width()) + QSKIP("Skipping due to grabWindow not functional"); +#ifdef DEBUG_WRITE_OUTPUT + contents.save("/tmp/sourceClipRect_" + QLatin1String(QTest::currentDataTag()) + ".png"); +#endif + for (auto p : redPixelLocations) { + QRgb color = contents.pixel(p); + QVERIFY(qRed(color) > 0xc0); + QVERIFY(qBlue(color) < 0x0f); + } + for (auto p : bluePixelLocations){ + QRgb color = contents.pixel(p); + QVERIFY(qBlue(color) > 0xc0); + QVERIFY(qRed(color) < 0x0f); + } +} + void tst_qquickimage::progressAndStatusChanges() { TestHTTPServer server; @@ -1190,6 +1260,34 @@ void tst_qquickimage::multiFrame() QVERIFY(qBlue(color) < 0xc0); } +void tst_qquickimage::colorSpace() +{ + QString componentStr1 = "import QtQuick 2.15\n" + "Image { source: srcImage; }"; + QQmlComponent component1(&engine); + component1.setData(componentStr1.toLatin1(), QUrl::fromLocalFile("")); + engine.rootContext()->setContextProperty("srcImage", testFileUrl("ProPhoto.jpg")); + + QScopedPointer<QQuickImage> object1 { qobject_cast<QQuickImage*>(component1.create())}; + QVERIFY(object1); + QTRY_COMPARE(object1->status(), QQuickImageBase::Ready); + QCOMPARE(object1->colorSpace(), QColorSpace(QColorSpace::ProPhotoRgb)); + + QString componentStr2 = "import QtQuick 2.15\n" + "Image {\n" + " source: srcImage;\n" + " colorSpace.namedColorSpace: ColorSpace.SRgb;\n" + "}"; + + QQmlComponent component2(&engine); + component2.setData(componentStr2.toLatin1(), QUrl::fromLocalFile("")); + + QScopedPointer<QQuickImage> object2 { qobject_cast<QQuickImage*>(component2.create())}; + QVERIFY(object2); + QTRY_COMPARE(object2->status(), QQuickImageBase::Ready); + QCOMPARE(object2->colorSpace(), QColorSpace(QColorSpace::SRgb)); +} + QTEST_MAIN(tst_qquickimage) #include "tst_qquickimage.moc" diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 5b6b11c746..bf58ce961c 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -1797,22 +1797,26 @@ void tst_qquickwindow::cursor() window.resize(320, 290); QQuickItem parentItem; + parentItem.setObjectName("parentItem"); parentItem.setPosition(QPointF(0, 0)); parentItem.setSize(QSizeF(180, 180)); parentItem.setParentItem(window.contentItem()); QQuickItem childItem; + childItem.setObjectName("childItem"); childItem.setPosition(QPointF(60, 90)); childItem.setSize(QSizeF(120, 120)); childItem.setParentItem(&parentItem); QQuickItem clippingItem; + clippingItem.setObjectName("clippingItem"); clippingItem.setPosition(QPointF(120, 120)); clippingItem.setSize(QSizeF(180, 180)); clippingItem.setClip(true); clippingItem.setParentItem(window.contentItem()); QQuickItem clippedItem; + clippedItem.setObjectName("clippedItem"); clippedItem.setPosition(QPointF(-30, -30)); clippedItem.setSize(QSizeF(120, 120)); clippedItem.setParentItem(&clippingItem); |