, 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;
{
QQuickWindow window;
window.resize(250, 250);
- ConstantUpdateItem item(window.rootItem());
+ ConstantUpdateItem item(window.contentItem());
window.show();
QTRY_VERIFY(item.iterations > 60);
}
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));
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));
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));
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
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));
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;
{
QQuickWindow *window = new QQuickWindow;
QQuickItem *item = new QQuickItem;
- item->setParentItem(window->rootItem());
+ item->setParentItem(window->contentItem());
QVERIFY(item->window() == window);
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));
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,
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));
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));