QQuickCanvas renames
[profile/ivi/qtdeclarative.git] / src / quick / items / qquickitem.cpp
index d184ba0..667b919 100644 (file)
@@ -41,9 +41,9 @@
 
 #include "qquickitem.h"
 
-#include "qquickcanvas.h"
+#include "qquickwindow.h"
 #include <QtQml/qjsengine.h>
-#include "qquickcanvas_p.h"
+#include "qquickwindow_p.h"
 
 #include "qquickevents_p_p.h"
 #include "qquickscreen_p.h"
@@ -129,10 +129,10 @@ void QQuickItemPrivate::registerAccessorProperties()
 /*!
     \qmlclass Transform QQuickTransform
     \inqmlmodule QtQuick 2
-    \ingroup qtquick-transformations
+    \ingroup qtquick-visual-transforms
     \brief For specifying advanced transformations on Items
 
-    The Transform element is a base type which cannot be instantiated directly.
+    The Transform type is a base type which cannot be instantiated directly.
     The following concrete Transform types are available:
 
     \list
@@ -141,22 +141,22 @@ void QQuickItemPrivate::registerAccessorProperties()
     \li \l Translate
     \endlist
 
-    The Transform elements let you create and control advanced transformations that can be configured
+    The Transform types let you create and control advanced transformations that can be configured
     independently using specialized properties.
 
-    You can assign any number of Transform elements to an \l Item. Each Transform is applied in order,
+    You can assign any number of Transforms to an \l Item. Each Transform is applied in order,
     one at a time.
 */
 
 /*!
     \qmlclass Translate QQuickTranslate
     \inqmlmodule QtQuick 2
-    \ingroup qtquick-transformations
+    \ingroup qtquick-visual-transforms
     \brief Provides a way to move an Item without changing its x or y properties
 
     The Translate object provides independent control over position in addition to the Item's x and y properties.
 
-    The following example moves the Y axis of the \l Rectangle elements while still allowing the \l Row element
+    The following example moves the Y axis of the \l Rectangle items while still allowing the \l Row
     to lay the items out as if they had not been transformed:
     \qml
     import QtQuick 2.0
@@ -193,10 +193,10 @@ void QQuickItemPrivate::registerAccessorProperties()
 /*!
     \qmlclass Scale QQuickScale
     \inqmlmodule QtQuick 2
-    \ingroup qtquick-transformations
+    \ingroup qtquick-visual-transforms
     \brief Provides a way to scale an Item
 
-    The Scale element gives more control over scaling than using \l Item's \l{Item::scale}{scale} property. Specifically,
+    The Scale type gives more control over scaling than using \l Item's \l{Item::scale}{scale} property. Specifically,
     it allows a different scale for the x and y axes, and allows the scale to be relative to an
     arbitrary point.
 
@@ -235,7 +235,7 @@ void QQuickItemPrivate::registerAccessorProperties()
 /*!
     \qmlclass Rotation QQuickRotation
     \inqmlmodule QtQuick 2
-    \ingroup qtquick-transformations
+    \ingroup qtquick-visual-transforms
     \brief Provides a way to rotate an Item
 
     The Rotation object gives more control over rotation than using \l Item's \l{Item::rotation}{rotation} property.
@@ -503,7 +503,7 @@ void QQuickItemKeyFilter::componentComplete()
 /*!
     \qmlclass KeyNavigation QQuickKeyNavigationAttached
     \inqmlmodule QtQuick 2
-    \ingroup qtquick-interaction
+    \ingroup qtquick-input
     \brief Supports key navigation by arrow keys
 
     Key-based user interfaces commonly allow the use of arrow keys to navigate between
@@ -910,16 +910,14 @@ const QQuickKeysAttached::SigMap QQuickKeysAttached::sigMap[] = {
 bool QQuickKeysAttached::isConnected(const char *signalName)
 {
     Q_D(QQuickKeysAttached);
-    //### doing two string-based lookups isn't ideal
     int signal_index = d->signalIndex(signalName);
-    int index = metaObject()->indexOfSignal(signalName);
-    return QQml_isSignalConnected(this, signal_index, index);
+    return d->isSignalConnected(signal_index);
 }
 
 /*!
     \qmlclass Keys QQuickKeysAttached
     \inqmlmodule QtQuick 2
-    \ingroup qtquick-interaction
+    \ingroup qtquick-input
     \brief Provides key handling to Items
 
     All visual primitives support key handling via the Keys
@@ -1354,12 +1352,12 @@ void QQuickKeysAttached::keyPressed(QKeyEvent *event, bool post)
     }
 
     // first process forwards
-    if (d->item && d->item->canvas()) {
+    if (d->item && d->item->window()) {
         d->inPress = true;
         for (int ii = 0; ii < d->targets.count(); ++ii) {
             QQuickItem *i = d->targets.at(ii);
             if (i && i->isVisible()) {
-                d->item->canvas()->sendEvent(i, event);
+                d->item->window()->sendEvent(i, event);
                 if (event->isAccepted()) {
                     d->inPress = false;
                     return;
@@ -1396,12 +1394,12 @@ void QQuickKeysAttached::keyReleased(QKeyEvent *event, bool post)
         return;
     }
 
-    if (d->item && d->item->canvas()) {
+    if (d->item && d->item->window()) {
         d->inRelease = true;
         for (int ii = 0; ii < d->targets.count(); ++ii) {
             QQuickItem *i = d->targets.at(ii);
             if (i && i->isVisible()) {
-                d->item->canvas()->sendEvent(i, event);
+                d->item->window()->sendEvent(i, event);
                 if (event->isAccepted()) {
                     d->inRelease = false;
                     return;
@@ -1421,12 +1419,12 @@ void QQuickKeysAttached::keyReleased(QKeyEvent *event, bool post)
 void QQuickKeysAttached::inputMethodEvent(QInputMethodEvent *event, bool post)
 {
     Q_D(QQuickKeysAttached);
-    if (post == m_processPost && d->item && !d->inIM && d->item->canvas()) {
+    if (post == m_processPost && d->item && !d->inIM && d->item->window()) {
         d->inIM = true;
         for (int ii = 0; ii < d->targets.count(); ++ii) {
             QQuickItem *i = d->targets.at(ii);
             if (i && i->isVisible() && (i->flags() & QQuickItem::ItemAcceptsInputMethod)) {
-                d->item->canvas()->sendEvent(i, event);
+                d->item->window()->sendEvent(i, event);
                 if (event->isAccepted()) {
                     d->imeItem = i;
                     d->inIM = false;
@@ -1465,19 +1463,19 @@ QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj)
 /*!
     \qmlclass LayoutMirroring QQuickLayoutMirroringAttached
     \inqmlmodule QtQuick 2
-    \ingroup qtquick-utility
+    \ingroup qtquick-positioners
     \ingroup qml-utility-elements
     \brief Property used to mirror layout behavior
 
     The LayoutMirroring attached property is used to horizontally mirror \l {anchor-layout}{Item anchors},
-    \l{Using QML Positioner and Repeater Items}{positioner} elements (such as \l Row and \l Grid)
+    \l{Using QML Positioner and Repeater Items}{positioner} types (such as \l Row and \l Grid)
     and views (such as \l GridView and horizontal \l ListView). Mirroring is a visual change: left
-    anchors become right anchors, and positioner elements like \l Grid and \l Row reverse the
+    anchors become right anchors, and positioner types like \l Grid and \l Row reverse the
     horizontal layout of child items.
 
     Mirroring is enabled for an item by setting the \l enabled property to true. By default, this
     only affects the item itself; setting the \l childrenInherit property to true propagates the mirroring
-    behavior to all child elements as well. If the \c LayoutMirroring attached property has not been defined
+    behavior to all child items as well. If the \c LayoutMirroring attached property has not been defined
     for an item, mirroring is not enabled.
 
     The following example shows mirroring in action. The \l Row below is specified as being anchored
@@ -1510,8 +1508,8 @@ QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj)
 
     This property holds whether the item's layout is mirrored horizontally. Setting this to true
     horizontally reverses \l {anchor-layout}{anchor} settings such that left anchors become right,
-    and right anchors become left. For \l{Using QML Positioner and Repeater Items}{positioner} elements
-    (such as \l Row and \l Grid) and view elements (such as \l {GridView}{GridView} and \l {ListView}{ListView})
+    and right anchors become left. For \l{Using QML Positioner and Repeater Items}{positioner} types
+    (such as \l Row and \l Grid) and view types (such as \l {GridView}{GridView} and \l {ListView}{ListView})
     this also mirrors the horizontal layout direction of the item.
 
     The default value is false.
@@ -1621,7 +1619,6 @@ void QQuickItemPrivate::setLayoutMirror(bool mirror)
             anchor_d->fillChanged();
             anchor_d->centerInChanged();
             anchor_d->updateHorizontalAnchors();
-            emit _anchors->mirroredChanged();
         }
         mirrorChange();
         if (extra.isAllocated() && extra->layoutDirectionAttached) {
@@ -1675,7 +1672,7 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus)
 
 /*!
     \class QQuickItem
-    \brief Provides the most basic of all visual items in QML
+    \brief The QQuickItem class provides the most basic of all visual items in QML
 
     \inmodule QtQuick
 
@@ -1717,14 +1714,14 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus)
     surface. Using scene graph API directly is always significantly
     faster.
 
-    \sa QQuickCanvas, QQuickPaintedItem
+    \sa QQuickWindow, QQuickPaintedItem
 */
 
 /*!
     \qmlclass Item QQuickItem
     \inherits QtObject
     \inqmlmodule QtQuick 2
-    \ingroup qtquick-visual-types
+    \ingroup qtquick-visual
     \brief A basic visual QML type
 
     All visual items in Qt Quick inherit from Item.  Although Item
@@ -1758,7 +1755,7 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus)
 
     \section1 Key Handling
 
-    Key handling is available to all Item-based visual elements via the \l {Keys}{Keys}
+    Key handling is available to all Item-based visual types via the \l {Keys}{Keys}
     attached property.  The \e Keys attached property provides basic handlers such
     as \l {Keys::onPressed}{onPressed} and \l {Keys::onReleased}{onReleased},
     as well as handlers for specific keys, such as
@@ -1875,12 +1872,12 @@ QQuickItem::~QQuickItem()
 
     Q_D(QQuickItem);
 
-    if (d->canvasRefCount > 1)
-        d->canvasRefCount = 1; // Make sure canvas is set to null in next call to derefCanvas().
+    if (d->windowRefCount > 1)
+        d->windowRefCount = 1; // Make sure window is set to null in next call to derefWindow().
     if (d->parentItem)
         setParentItem(0);
-    else if (d->canvas)
-        d->derefCanvas();
+    else if (d->window)
+        d->derefWindow();
 
     // XXX todo - optimize
     while (!d->childItems.isEmpty())
@@ -1939,7 +1936,7 @@ QQuickItem::~QQuickItem()
     The default transform origin is \c Item.Center.
 
     To set an arbitrary transform origin point use the \l Scale or \l Rotation
-    transform elements.
+    transform types.
 */
 
 /*!
@@ -1987,9 +1984,9 @@ void QQuickItem::setParentItem(QQuickItem *parentItem)
             scopeItem = oldParentItem;
             while (!scopeItem->isFocusScope() && scopeItem->parentItem())
                 scopeItem = scopeItem->parentItem();
-            if (d->canvas) {
-                QQuickCanvasPrivate::get(d->canvas)->clearFocusInScope(scopeItem, scopeFocusedItem,
-                                                                QQuickCanvasPrivate::DontChangeFocusProperty);
+            if (d->window) {
+                QQuickWindowPrivate::get(d->window)->clearFocusInScope(scopeItem, scopeFocusedItem,
+                                                                QQuickWindowPrivate::DontChangeFocusProperty);
                 if (scopeFocusedItem != this)
                     QQuickItemPrivate::get(scopeFocusedItem)->updateSubFocusItem(this, true);
             } else {
@@ -2002,29 +1999,29 @@ void QQuickItem::setParentItem(QQuickItem *parentItem)
         if (wasVisible) {
             emit oldParentItem->visibleChildrenChanged();
         }
-    } else if (d->canvas) {
-        QQuickCanvasPrivate::get(d->canvas)->parentlessItems.remove(this);
+    } else if (d->window) {
+        QQuickWindowPrivate::get(d->window)->parentlessItems.remove(this);
     }
 
-    QQuickCanvas *oldParentCanvas = oldParentItem ? QQuickItemPrivate::get(oldParentItem)->canvas : 0;
-    QQuickCanvas *parentCanvas = parentItem ? QQuickItemPrivate::get(parentItem)->canvas : 0;
-    if (oldParentCanvas == parentCanvas) {
-        // Avoid freeing and reallocating resources if the canvas stays the same.
+    QQuickWindow *oldParentWindow = oldParentItem ? QQuickItemPrivate::get(oldParentItem)->window : 0;
+    QQuickWindow *parentWindow = parentItem ? QQuickItemPrivate::get(parentItem)->window : 0;
+    if (oldParentWindow == parentWindow) {
+        // Avoid freeing and reallocating resources if the window stays the same.
         d->parentItem = parentItem;
     } else {
-        if (oldParentCanvas)
-            d->derefCanvas();
+        if (oldParentWindow)
+            d->derefWindow();
         d->parentItem = parentItem;
-        if (parentCanvas)
-            d->refCanvas(parentCanvas);
+        if (parentWindow)
+            d->refWindow(parentWindow);
     }
 
     d->dirty(QQuickItemPrivate::ParentChanged);
 
     if (d->parentItem)
         QQuickItemPrivate::get(d->parentItem)->addChild(this);
-    else if (d->canvas)
-        QQuickCanvasPrivate::get(d->canvas)->parentlessItems.insert(this);
+    else if (d->window)
+        QQuickWindowPrivate::get(d->window)->parentlessItems.insert(this);
 
     d->setEffectiveVisibleRecur(d->calcEffectiveVisible());
     d->setEffectiveEnableRecur(0, d->calcEffectiveEnable());
@@ -2050,9 +2047,9 @@ void QQuickItem::setParentItem(QQuickItem *parentItem)
                 QQuickItemPrivate::get(scopeFocusedItem)->focus = false;
                 emit scopeFocusedItem->focusChanged(false);
             } else {
-                if (d->canvas) {
-                    QQuickCanvasPrivate::get(d->canvas)->setFocusInScope(scopeItem, scopeFocusedItem,
-                                                                  QQuickCanvasPrivate::DontChangeFocusProperty);
+                if (d->window) {
+                    QQuickWindowPrivate::get(d->window)->setFocusInScope(scopeItem, scopeFocusedItem,
+                                                                  QQuickWindowPrivate::DontChangeFocusProperty);
                 } else {
                     QQuickItemPrivate::get(scopeFocusedItem)->updateSubFocusItem(scopeItem, true);
                 }
@@ -2137,10 +2134,10 @@ QQuickItem *QQuickItem::parentItem() const
     return d->parentItem;
 }
 
-QQuickCanvas *QQuickItem::canvas() const
+QQuickWindow *QQuickItem::window() const
 {
     Q_D(const QQuickItem);
-    return d->canvas;
+    return d->window;
 }
 
 static bool itemZOrder_sort(QQuickItem *lhs, QQuickItem *rhs)
@@ -2206,92 +2203,68 @@ void QQuickItemPrivate::removeChild(QQuickItem *child)
     emit q->childrenChanged();
 }
 
-void QQuickItemPrivate::InitializationState::clear()
+void QQuickItemPrivate::refWindow(QQuickWindow *c)
 {
-    focusScope = 0;
-}
-
-void QQuickItemPrivate::InitializationState::clear(QQuickItem *fs)
-{
-    focusScope = fs;
-}
-
-QQuickItem *QQuickItemPrivate::InitializationState::getFocusScope(QQuickItem *item)
-{
-    if (!focusScope) {
-        QQuickItem *fs = item->parentItem();
-        while (fs->parentItem() && !fs->isFocusScope())
-            fs = fs->parentItem();
-        focusScope = fs;
-    }
-    return focusScope;
-}
-
-void QQuickItemPrivate::refCanvas(InitializationState *state, QQuickCanvas *c)
-{
-    // An item needs a canvas if it is referenced by another item which has a canvas.
+    // An item needs a window if it is referenced by another item which has a window.
     // Typically the item is referenced by a parent, but can also be referenced by a
-    // ShaderEffect or ShaderEffectSource. 'canvasRefCount' counts how many items with
-    // a canvas is referencing this item. When the reference count goes from zero to one,
-    // or one to zero, the canvas of this item is updated and propagated to the children.
-    // As long as the reference count stays above zero, the canvas is unchanged.
-    // refCanvas() increments the reference count.
-    // derefCanvas() decrements the reference count.
+    // ShaderEffect or ShaderEffectSource. 'windowRefCount' counts how many items with
+    // a window is referencing this item. When the reference count goes from zero to one,
+    // or one to zero, the window of this item is updated and propagated to the children.
+    // As long as the reference count stays above zero, the window is unchanged.
+    // refWindow() increments the reference count.
+    // derefWindow() decrements the reference count.
 
     Q_Q(QQuickItem);
-    Q_ASSERT((canvas != 0) == (canvasRefCount > 0));
+    Q_ASSERT((window != 0) == (windowRefCount > 0));
     Q_ASSERT(c);
-    if (++canvasRefCount > 1) {
-        if (c != canvas)
-            qWarning("QQuickItem: Cannot use same item on different canvases at the same time.");
-        return; // Canvas already set.
+    if (++windowRefCount > 1) {
+        if (c != window)
+            qWarning("QQuickItem: Cannot use same item on different windows at the same time.");
+        return; // Window already set.
     }
 
-    Q_ASSERT(canvas == 0);
-    canvas = c;
+    Q_ASSERT(window == 0);
+    window = c;
 
     if (polishScheduled)
-        QQuickCanvasPrivate::get(canvas)->itemsToPolish.insert(q);
-
-    InitializationState _dummy;
-    InitializationState *childState = state;
-
-    if (q->isFocusScope()) {
-        _dummy.clear(q);
-        childState = &_dummy;
-    }
+        QQuickWindowPrivate::get(window)->itemsToPolish.insert(q);
 
     if (!parentItem)
-        QQuickCanvasPrivate::get(canvas)->parentlessItems.insert(q);
+        QQuickWindowPrivate::get(window)->parentlessItems.insert(q);
 
     for (int ii = 0; ii < childItems.count(); ++ii) {
         QQuickItem *child = childItems.at(ii);
-        QQuickItemPrivate::get(child)->refCanvas(childState, c);
+        QQuickItemPrivate::get(child)->refWindow(c);
     }
 
-    dirty(Canvas);
+    dirty(Window);
 
     if (extra.isAllocated() && extra->screenAttached)
-        extra->screenAttached->canvasChanged(c);
+        extra->screenAttached->windowChanged(c);
     itemChange(QQuickItem::ItemSceneChange, c);
 }
 
-void QQuickItemPrivate::derefCanvas()
+void QQuickItemPrivate::derefWindow()
 {
     Q_Q(QQuickItem);
-    Q_ASSERT((canvas != 0) == (canvasRefCount > 0));
+    Q_ASSERT((window != 0) == (windowRefCount > 0));
 
-    if (!canvas)
+    if (!window)
         return; // This can happen when destroying recursive shader effect sources.
 
-    if (--canvasRefCount > 0)
-        return; // There are still other references, so don't set canvas to null yet.
+    if (--windowRefCount > 0)
+        return; // There are still other references, so don't set window to null yet.
 
     q->releaseResources();
     removeFromDirtyList();
-    QQuickCanvasPrivate *c = QQuickCanvasPrivate::get(canvas);
+    QQuickWindowPrivate *c = QQuickWindowPrivate::get(window);
     if (polishScheduled)
         c->itemsToPolish.remove(q);
+    QMutableHashIterator<int, QQuickItem *> itemTouchMapIt(c->itemForTouchPointId);
+    while (itemTouchMapIt.hasNext()) {
+        if (itemTouchMapIt.next().value() == q)
+            itemTouchMapIt.remove();
+    }
     if (c->mouseGrabberItem == q)
         c->mouseGrabberItem = 0;
     if ( hoverEnabled )
@@ -2301,7 +2274,7 @@ void QQuickItemPrivate::derefCanvas()
     if (!parentItem)
         c->parentlessItems.remove(q);
 
-    canvas = 0;
+    window = 0;
 
     itemNodeInstance = 0;
 
@@ -2317,33 +2290,33 @@ void QQuickItemPrivate::derefCanvas()
 
     for (int ii = 0; ii < childItems.count(); ++ii) {
         QQuickItem *child = childItems.at(ii);
-        QQuickItemPrivate::get(child)->derefCanvas();
+        QQuickItemPrivate::get(child)->derefWindow();
     }
 
-    dirty(Canvas);
+    dirty(Window);
 
     if (extra.isAllocated() && extra->screenAttached)
-        extra->screenAttached->canvasChanged(0);
-    itemChange(QQuickItem::ItemSceneChange, (QQuickCanvas *)0);
+        extra->screenAttached->windowChanged(0);
+    itemChange(QQuickItem::ItemSceneChange, (QQuickWindow *)0);
 }
 
 
 /*!
-Returns a transform that maps points from canvas space into item space.
+Returns a transform that maps points from window space into item space.
 */
-QTransform QQuickItemPrivate::canvasToItemTransform() const
+QTransform QQuickItemPrivate::windowToItemTransform() const
 {
     // XXX todo - optimize
-    return itemToCanvasTransform().inverted();
+    return itemToWindowTransform().inverted();
 }
 
 /*!
-Returns a transform that maps points from item space into canvas space.
+Returns a transform that maps points from item space into window space.
 */
-QTransform QQuickItemPrivate::itemToCanvasTransform() const
+QTransform QQuickItemPrivate::itemToWindowTransform() const
 {
     // XXX todo
-    QTransform rv = parentItem?QQuickItemPrivate::get(parentItem)->itemToCanvasTransform():QTransform();
+    QTransform rv = parentItem?QQuickItemPrivate::get(parentItem)->itemToWindowTransform():QTransform();
     itemToParentTransform(rv);
     return rv;
 }
@@ -2428,26 +2401,53 @@ bool QQuickItem::isComponentComplete() const
 }
 
 QQuickItemPrivate::QQuickItemPrivate()
-: _anchors(0), _stateGroup(0),
-  flags(0), widthValid(false), heightValid(false), baselineOffsetValid(false), componentComplete(true),
-  keepMouse(false), keepTouch(false), hoverEnabled(false), smooth(true), focus(false), activeFocus(false), notifiedFocus(false),
-  notifiedActiveFocus(false), filtersChildMouseEvents(false), explicitVisible(true),
-  effectiveVisible(true), explicitEnable(true), effectiveEnable(true), polishScheduled(false),
-  inheritedLayoutMirror(false), effectiveLayoutMirror(false), isMirrorImplicit(true),
-  inheritMirrorFromParent(false), inheritMirrorFromItem(false),
-  isAccessible(false),
-
-  dirtyAttributes(0), nextDirtyItem(0), prevDirtyItem(0),
-
-  canvas(0), canvasRefCount(0), parentItem(0), sortedChildItems(&childItems),
-
-  subFocusItem(0),
-
-  x(0), y(0), width(0), height(0), implicitWidth(0), implicitHeight(0),
-
-  baselineOffset(0),
-
-  itemNodeInstance(0), groupNode(0), paintNode(0)
+    : _anchors(0)
+    , _stateGroup(0)
+    , flags(0)
+    , widthValid(false)
+    , heightValid(false)
+    , baselineOffsetValid(false)
+    , componentComplete(true)
+    , keepMouse(false)
+    , keepTouch(false)
+    , hoverEnabled(false)
+    , smooth(true)
+    , antialiasing(false)
+    , focus(false)
+    , activeFocus(false)
+    , notifiedFocus(false)
+    , notifiedActiveFocus(false)
+    , filtersChildMouseEvents(false)
+    , explicitVisible(true)
+    , effectiveVisible(true)
+    , explicitEnable(true)
+    , effectiveEnable(true)
+    , polishScheduled(false)
+    , inheritedLayoutMirror(false)
+    , effectiveLayoutMirror(false)
+    , isMirrorImplicit(true)
+    , inheritMirrorFromParent(false)
+    , inheritMirrorFromItem(false)
+    , isAccessible(false)
+    , culled(false)
+    , dirtyAttributes(0)
+    , nextDirtyItem(0)
+    , prevDirtyItem(0)
+    , window(0)
+    , windowRefCount(0)
+    , parentItem(0)
+    , sortedChildItems(&childItems)
+    , subFocusItem(0)
+    , x(0)
+    , y(0)
+    , width(0)
+    , height(0)
+    , implicitWidth(0)
+    , implicitHeight(0)
+    , baselineOffset(0)
+    , itemNodeInstance(0)
+    , groupNode(0)
+    , paintNode(0)
 {
 }
 
@@ -2845,16 +2845,31 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty<QQuickTransform> *prop)
     explicit property changes. In such cases it may be better to use the
     \l opacity property instead.)
 
-    Setting this property to \c false automatically causes \l focus to be set
-    to \c false, and this item will longer receive mouse and keyboard events.
-    (In contrast, setting the \l opacity to 0 does not affect the \l focus
-    property and the receiving of key events.)
+    If this property is set to \c false, the item will no longer receive mouse
+    events, but will continue to receive key events and will retain the keyboard
+    \l focus if it has been set. (In contrast, setting the \l enabled property
+    to \c false stops both mouse and keyboard events, and also removes focus
+    from the item.)
 
     \note This property's value is only affected by changes to this property or
     the parent's \c visible property. It does not change, for example, if this
     item moves off-screen, or if the \l opacity changes to 0.
 */
 
+/*!
+    \qmlproperty bool QtQuick2::Item::enabled
+
+    This property holds whether the item receives mouse and keyboard events.
+    By default this is true.
+
+    Setting this property directly affects the \c enabled value of child
+    items. When set to \c false, the \c enabled values of all child items also
+    become \c false. When set to \c true, the \c enabled values of child items
+    are returned to \c true, unless they have explicitly been set to \c false.
+
+    Setting this property to \c false automatically causes \l activeFocus to be
+    set to \c false, and this item will longer receive keyboard events.
+*/
 
 /*!
   \qmlproperty AnchorLine QtQuick2::Item::anchors.top
@@ -2877,7 +2892,6 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty<QQuickTransform> *prop)
   \qmlproperty real QtQuick2::Item::anchors.verticalCenterOffset
   \qmlproperty real QtQuick2::Item::anchors.baselineOffset
 
-  \qmlproperty bool QtQuick2::Item::anchors.mirrored
   \qmlproperty bool QtQuick2::Item::anchors.alignWhenCentered
 
   Anchors provide a way to position an item by specifying its
@@ -2885,6 +2899,8 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty<QQuickTransform> *prop)
 
   Margins apply to top, bottom, left, right, and fill anchors.
   The \c anchors.margins property can be used to set all of the various margins at once, to the same value.
+  It will not override a specific margin that has been previously set; to clear an explicit margin
+  set it's value to \c undefined.
   Note that margins are anchor-specific and are not applied if an item does not
   use anchors.
 
@@ -2937,8 +2953,6 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty<QQuickTransform> *prop)
 
   To clear an anchor value, set it to \c undefined.
 
-  \c anchors.mirrored returns true it the layout has been \l {LayoutMirroring}{mirrored}.
-
   \c anchors.alignWhenCentered (default true) forces centered anchors to align to a
   whole pixel, i.e. if the item being centered has an odd width/height the item
   will be positioned on a whole pixel rather than being placed on a half-pixel.
@@ -3028,6 +3042,8 @@ void QQuickItem::setClip(bool c)
   This function is called to handle this item's changes in
   geometry from \a oldGeometry to \a newGeometry. If the two
   geometries are the same, it doesn't do anything.
+
+  Derived classes must call the base class method within their implementation.
  */
 void QQuickItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
 {
@@ -3116,7 +3132,7 @@ QSGNode *QQuickItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
 /*!
     This function is called when the item's scene graph resources are no longer needed.
     It allows items to free its resources, for instance textures, that are not owned by scene graph
-    nodes. Note that scene graph nodes are managed by QQuickCanvas and should not be deleted by
+    nodes. Note that scene graph nodes are managed by QQuickWindow and should not be deleted by
     this function. Scene graph resources are no longer needed when the parent is set to null and
     the item is not used by any \l ShaderEffect or \l ShaderEffectSource.
 
@@ -3254,6 +3270,7 @@ void QQuickItem::hoverLeaveEvent(QHoverEvent *event)
     Q_UNUSED(event);
 }
 
+#ifndef QT_NO_DRAGANDDROP
 void QQuickItem::dragEnterEvent(QDragEnterEvent *event)
 {
     Q_UNUSED(event);
@@ -3275,6 +3292,7 @@ void QQuickItem::dropEvent(QDropEvent *event)
 {
     Q_UNUSED(event);
 }
+#endif // QT_NO_DRAGANDDROP
 
 bool QQuickItem::childMouseEventFilter(QQuickItem *, QEvent *)
 {
@@ -3396,7 +3414,7 @@ void QQuickItem::setBaselineOffset(qreal offset)
  * Schedules a call to updatePaintNode() for this item.
  *
  * The call to QQuickItem::updatePaintNode() will always happen if the
- * item is showing in a QQuickCanvas.
+ * item is showing in a QQuickWindow.
  *
  * Only items which specifies QQuickItem::ItemHasContents are allowed
  * to call QQuickItem::update().
@@ -3413,11 +3431,11 @@ void QQuickItem::polish()
     Q_D(QQuickItem);
     if (!d->polishScheduled) {
         d->polishScheduled = true;
-        if (d->canvas) {
-            QQuickCanvasPrivate *p = QQuickCanvasPrivate::get(d->canvas);
+        if (d->window) {
+            QQuickWindowPrivate *p = QQuickWindowPrivate::get(d->window);
             bool maybeupdate = p->itemsToPolish.isEmpty();
             p->itemsToPolish.insert(this);
-            if (maybeupdate) d->canvas->maybeUpdate();
+            if (maybeupdate) d->window->maybeUpdate();
         }
     }
 }
@@ -3482,8 +3500,8 @@ QTransform QQuickItem::itemTransform(QQuickItem *other, bool *ok) const
     // invalid cases
     if (ok) *ok = true;
 
-    QTransform t = d->itemToCanvasTransform();
-    if (other) t *= QQuickItemPrivate::get(other)->canvasToItemTransform();
+    QTransform t = d->itemToWindowTransform();
+    if (other) t *= QQuickItemPrivate::get(other)->windowToItemTransform();
 
     return t;
 }
@@ -3641,6 +3659,11 @@ QQmlListProperty<QQuickTransform> QQuickItem::transform()
                                                      QQuickItemPrivate::transform_clear);
 }
 
+/*!
+  \reimp
+  Derived classes should call the base class method before adding their own action to
+  perform at classBegin.
+*/
 void QQuickItem::classBegin()
 {
     Q_D(QQuickItem);
@@ -3653,6 +3676,11 @@ void QQuickItem::classBegin()
         d->extra->layer->classBegin();
 }
 
+/*!
+  \reimp
+  Derived classes should call the base class method before adding their own actions to
+  perform at componentComplete.
+*/
 void QQuickItem::componentComplete()
 {
     Q_D(QQuickItem);
@@ -3672,6 +3700,11 @@ void QQuickItem::componentComplete()
 
     if (d->extra.isAllocated() && d->extra->contents)
         d->extra->contents->complete();
+
+    if (d->window && d->dirtyAttributes) {
+        d->addToDirtyList();
+        QQuickWindowPrivate::get(d->window)->dirtyItem(this);
+    }
 }
 
 QQuickStateGroup *QQuickItemPrivate::_states()
@@ -3845,6 +3878,7 @@ void QQuickItemPrivate::deliverHoverEvent(QHoverEvent *e)
     }
 }
 
+#ifndef QT_NO_DRAGANDDROP
 void QQuickItemPrivate::deliverDragEvent(QEvent *e)
 {
     Q_Q(QQuickItem);
@@ -3865,6 +3899,7 @@ void QQuickItemPrivate::deliverDragEvent(QEvent *e)
         break;
     }
 }
+#endif // QT_NO_DRAGANDDROP
 
 void QQuickItem::itemChange(ItemChange change, const ItemChangeData &value)
 {
@@ -4072,11 +4107,10 @@ void QQuickItem::setZ(qreal v)
   \endqml
   \endtable
 
-  If an item's opacity is set to 0, the item will no longer receive mouse
-  events, but will continue to receive key events and will retain the keyboard
-  \l focus if it has been set. (In contrast, setting the \l visible property
-  to \c false stops both mouse and keyboard events, and also removes focus
-  from the item.)
+  Changing an items opacity will not affect delivery of input events.  (In contrast
+  setting \l visible property to \c false stops mouse events, and setting the
+  \l enabled property to \c false stops mouse and keyboard events, and also removes
+  active focus from the item.)
 */
 
 /*!
@@ -4215,9 +4249,9 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
     dirty(Visible);
     if (parentItem) QQuickItemPrivate::get(parentItem)->dirty(ChildrenStackingChanged);
 
-    if (canvas) {
-        QQuickCanvasPrivate *canvasPriv = QQuickCanvasPrivate::get(canvas);
-        if (canvasPriv->mouseGrabberItem == q)
+    if (window) {
+        QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window);
+        if (windowPriv->mouseGrabberItem == q)
             q->ungrabMouse();
     }
 
@@ -4263,13 +4297,13 @@ void QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem *scope, bool newEffec
 
     effectiveEnable = newEffectiveEnable;
 
-    if (canvas) {
-        QQuickCanvasPrivate *canvasPriv = QQuickCanvasPrivate::get(canvas);
-        if (canvasPriv->mouseGrabberItem == q)
+    if (window) {
+        QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window);
+        if (windowPriv->mouseGrabberItem == q)
             q->ungrabMouse();
         if (scope && !effectiveEnable && activeFocus) {
-            canvasPriv->clearFocusInScope(
-                    scope, q,  QQuickCanvasPrivate::DontChangeFocusProperty | QQuickCanvasPrivate::DontChangeSubFocusItem);
+            windowPriv->clearFocusInScope(
+                    scope, q,  QQuickWindowPrivate::DontChangeFocusProperty | QQuickWindowPrivate::DontChangeSubFocusItem);
         }
     }
 
@@ -4278,9 +4312,9 @@ void QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem *scope, bool newEffec
                 (flags & QQuickItem::ItemIsFocusScope) && scope ? q : scope, newEffectiveEnable);
     }
 
-    if (canvas && scope && effectiveEnable && focus) {
-        QQuickCanvasPrivate::get(canvas)->setFocusInScope(
-                scope, q, QQuickCanvasPrivate::DontChangeFocusProperty | QQuickCanvasPrivate::DontChangeSubFocusItem);
+    if (window && scope && effectiveEnable && focus) {
+        QQuickWindowPrivate::get(window)->setFocusInScope(
+                scope, q, QQuickWindowPrivate::DontChangeFocusProperty | QQuickWindowPrivate::DontChangeSubFocusItem);
     }
 
     emit q->enabledChanged();
@@ -4310,10 +4344,11 @@ QString QQuickItemPrivate::dirtyToString() const
     DIRTY_TO_STRING(ChildrenStackingChanged);
     DIRTY_TO_STRING(ParentChanged);
     DIRTY_TO_STRING(Clip);
-    DIRTY_TO_STRING(Canvas);
+    DIRTY_TO_STRING(Window);
     DIRTY_TO_STRING(EffectReference);
     DIRTY_TO_STRING(Visible);
     DIRTY_TO_STRING(HideReference);
+    DIRTY_TO_STRING(Antialiasing);
 
     return rv;
 }
@@ -4324,11 +4359,11 @@ void QQuickItemPrivate::dirty(DirtyType type)
     if (type & (TransformOrigin | Transform | BasicTransform | Position | Size))
         transformChanged();
 
-    if (!(dirtyAttributes & type) || (canvas && !prevDirtyItem)) {
+    if (!(dirtyAttributes & type) || (window && !prevDirtyItem)) {
         dirtyAttributes |= type;
-        if (canvas) {
+        if (window && componentComplete) {
             addToDirtyList();
-            QQuickCanvasPrivate::get(canvas)->dirtyItem(q);
+            QQuickWindowPrivate::get(window)->dirtyItem(q);
         }
     }
 }
@@ -4337,11 +4372,11 @@ void QQuickItemPrivate::addToDirtyList()
 {
     Q_Q(QQuickItem);
 
-    Q_ASSERT(canvas);
+    Q_ASSERT(window);
     if (!prevDirtyItem) {
         Q_ASSERT(!nextDirtyItem);
 
-        QQuickCanvasPrivate *p = QQuickCanvasPrivate::get(canvas);
+        QQuickWindowPrivate *p = QQuickWindowPrivate::get(window);
         nextDirtyItem = p->dirtyItemList;
         if (nextDirtyItem) QQuickItemPrivate::get(nextDirtyItem)->prevDirtyItem = &nextDirtyItem;
         prevDirtyItem = &p->dirtyItemList;
@@ -4390,6 +4425,16 @@ void QQuickItemPrivate::derefFromEffectItem(bool unhide)
     }
 }
 
+void QQuickItemPrivate::setCulled(bool cull)
+{
+    if (cull == culled)
+        return;
+
+    culled = cull;
+    if ((cull && ++extra->hideRefCount == 1) || (!cull && --extra->hideRefCount == 0))
+        dirty(HideReference);
+}
+
 void QQuickItemPrivate::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data)
 {
     Q_Q(QQuickItem);
@@ -4461,7 +4506,7 @@ void QQuickItemPrivate::itemChange(QQuickItem::ItemChange change, const QQuickIt
     \property QQuickItem::smooth
     \brief Specifies whether the item is smoothed or not
 
-    Primarily used in image based elements to decide if the item should use smooth
+    Primarily used in image based items to decide if the item should use smooth
     sampling or not. Smooth sampling is performed using linear interpolation, while
     non-smooth is performed using nearest neighbor.
 
@@ -4471,10 +4516,10 @@ void QQuickItemPrivate::itemChange(QQuickItem::ItemChange change, const QQuickIt
 */
 
 /*!
-    Returns true if the item should be drawn with antialiasing and
+    Returns true if the item should be drawn with
     smooth pixmap filtering, false otherwise.
 
-    The default is false.
+    The default is true.
 
     \sa setSmooth()
 */
@@ -4502,6 +4547,47 @@ void QQuickItem::setSmooth(bool smooth)
     emit smoothChanged(smooth);
 }
 
+/*!
+    \property QQuickItem::antialiasing
+    \brief Specifies whether the item is antialiased or not
+
+    Primarily used in Rectangle and image based elements to decide if the item should
+    use antialiasing or not. Items with antialiasing enabled require more memory and
+    are potentially slower to render.
+
+    The default is false.
+*/
+
+/*!
+    Returns true if the item should be drawn with antialiasing, false otherwise.
+
+    The default is false.
+
+    \sa setAntialiasing()
+*/
+bool QQuickItem::antialiasing() const
+{
+    Q_D(const QQuickItem);
+    return d->antialiasing;
+}
+
+/*!
+    Sets whether the item should be drawn with antialiasing to \a antialiasing.
+
+    \sa antialiasing()
+*/
+void QQuickItem::setAntialiasing(bool antialiasing)
+{
+    Q_D(QQuickItem);
+    if (d->antialiasing == antialiasing)
+        return;
+
+    d->antialiasing = antialiasing;
+    d->dirty(QQuickItemPrivate::Antialiasing);
+
+    emit antialiasingChanged(antialiasing);
+}
+
 QQuickItem::Flags QQuickItem::flags() const
 {
     Q_D(const QQuickItem);
@@ -4522,8 +4608,8 @@ void QQuickItem::setFlags(Flags flags)
     Q_D(QQuickItem);
 
     if ((flags & ItemIsFocusScope) != (d->flags & ItemIsFocusScope)) {
-        if (flags & ItemIsFocusScope && !d->childItems.isEmpty() && d->canvas) {
-            qWarning("QQuickItem: Cannot set FocusScope once item has children and is in a canvas.");
+        if (flags & ItemIsFocusScope && !d->childItems.isEmpty() && d->window) {
+            qWarning("QQuickItem: Cannot set FocusScope once item has children and is in a window.");
             flags &= ~ItemIsFocusScope;
         } else if (d->flags & ItemIsFocusScope) {
             qWarning("QQuickItem: Cannot unset FocusScope flag.");
@@ -4666,7 +4752,7 @@ qreal QQuickItem::implicitWidth() const
 
     Defines the natural width or height of the Item if no \l width or \l height is specified.
 
-    The default implicit size for most items is 0x0, however some elements have an inherent
+    The default implicit size for most items is 0x0, however some items have an inherent
     implicit size which cannot be overridden, e.g. Image, Text.
 
     Setting the implicit size is useful for defining components that have a preferred size
@@ -4912,25 +4998,28 @@ void QQuickItem::setFocus(bool focus)
     if (d->focus == focus)
         return;
 
-    if (d->canvas || d->parentItem) {
+    if (d->window || d->parentItem) {
         // Need to find our nearest focus scope
         QQuickItem *scope = parentItem();
         while (scope && !scope->isFocusScope() && scope->parentItem())
             scope = scope->parentItem();
-        if (d->canvas) {
+        if (d->window) {
             if (focus)
-                QQuickCanvasPrivate::get(d->canvas)->setFocusInScope(scope, this);
+                QQuickWindowPrivate::get(d->window)->setFocusInScope(scope, this);
             else
-                QQuickCanvasPrivate::get(d->canvas)->clearFocusInScope(scope, this);
+                QQuickWindowPrivate::get(d->window)->clearFocusInScope(scope, this);
         } else {
             // do the focus changes from setFocusInScope/clearFocusInScope that are
-            // unrelated to a canvas
+            // unrelated to a window
             QVarLengthArray<QQuickItem *, 20> changed;
             QQuickItem *oldSubFocusItem = QQuickItemPrivate::get(scope)->subFocusItem;
             if (oldSubFocusItem) {
                 QQuickItemPrivate::get(oldSubFocusItem)->updateSubFocusItem(scope, false);
                 QQuickItemPrivate::get(oldSubFocusItem)->focus = false;
                 changed << oldSubFocusItem;
+            } else if (!scope->isFocusScope() && scope->hasFocus()) {
+                QQuickItemPrivate::get(scope)->focus = false;
+                changed << scope;
             }
             d->updateSubFocusItem(scope, focus);
 
@@ -4938,11 +5027,22 @@ void QQuickItem::setFocus(bool focus)
             changed << this;
             emit focusChanged(focus);
 
-            QQuickCanvasPrivate::notifyFocusChangesRecur(changed.data(), changed.count() - 1);
+            QQuickWindowPrivate::notifyFocusChangesRecur(changed.data(), changed.count() - 1);
         }
     } else {
+        QVarLengthArray<QQuickItem *, 20> changed;
+        QQuickItem *oldSubFocusItem = d->subFocusItem;
+        if (!isFocusScope() && oldSubFocusItem) {
+            QQuickItemPrivate::get(oldSubFocusItem)->updateSubFocusItem(this, false);
+            QQuickItemPrivate::get(oldSubFocusItem)->focus = false;
+            changed << oldSubFocusItem;
+        }
+
         d->focus = focus;
+        changed << this;
         emit focusChanged(focus);
+
+        QQuickWindowPrivate::notifyFocusChangesRecur(changed.data(), changed.count() - 1);
     }
 }
 
@@ -4995,11 +5095,11 @@ void QQuickItem::setFiltersChildMouseEvents(bool filter)
 bool QQuickItem::isUnderMouse() const
 {
     Q_D(const QQuickItem);
-    if (!d->canvas)
+    if (!d->window)
         return false;
 
     QPointF cursorPos = QGuiApplicationPrivate::lastCursorPosition;
-    return contains(mapFromScene(cursorPos)); // ### refactor: d->canvas->mapFromGlobal(cursorPos))))
+    return contains(mapFromScene(d->window->mapFromGlobal(cursorPos.toPoint())));
 }
 
 bool QQuickItem::acceptHoverEvents() const
@@ -5017,35 +5117,35 @@ void QQuickItem::setAcceptHoverEvents(bool enabled)
 void QQuickItem::grabMouse()
 {
     Q_D(QQuickItem);
-    if (!d->canvas)
+    if (!d->window)
         return;
-    QQuickCanvasPrivate *canvasPriv = QQuickCanvasPrivate::get(d->canvas);
-    if (canvasPriv->mouseGrabberItem == this)
+    QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(d->window);
+    if (windowPriv->mouseGrabberItem == this)
         return;
 
-    QQuickItem *oldGrabber = canvasPriv->mouseGrabberItem;
-    canvasPriv->mouseGrabberItem = this;
+    QQuickItem *oldGrabber = windowPriv->mouseGrabberItem;
+    windowPriv->mouseGrabberItem = this;
     if (oldGrabber) {
         QEvent ev(QEvent::UngrabMouse);
-        d->canvas->sendEvent(oldGrabber, &ev);
+        d->window->sendEvent(oldGrabber, &ev);
     }
 }
 
 void QQuickItem::ungrabMouse()
 {
     Q_D(QQuickItem);
-    if (!d->canvas)
+    if (!d->window)
         return;
-    QQuickCanvasPrivate *canvasPriv = QQuickCanvasPrivate::get(d->canvas);
-    if (canvasPriv->mouseGrabberItem != this) {
+    QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(d->window);
+    if (windowPriv->mouseGrabberItem != this) {
         qWarning("QQuickItem::ungrabMouse(): Item is not the mouse grabber.");
         return;
     }
 
-    canvasPriv->mouseGrabberItem = 0;
+    windowPriv->mouseGrabberItem = 0;
 
     QEvent ev(QEvent::UngrabMouse);
-    d->canvas->sendEvent(this, &ev);
+    d->window->sendEvent(this, &ev);
 }
 
 bool QQuickItem::keepMouseGrab() const
@@ -5088,20 +5188,20 @@ void QQuickItem::setKeepMouseGrab(bool keep)
 
     \sa ungrabTouchPoints(), setKeepTouchGrab()
 */
-void QQuickItem::grabTouchPoints(const QList<int> &ids)
+void QQuickItem::grabTouchPoints(const QVector<int> &ids)
 {
     Q_D(QQuickItem);
-    if (!d->canvas)
+    if (!d->window)
         return;
-    QQuickCanvasPrivate *canvasPriv = QQuickCanvasPrivate::get(d->canvas);
+    QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(d->window);
 
     QSet<QQuickItem*> ungrab;
     for (int i = 0; i < ids.count(); ++i) {
-        QQuickItem *oldGrabber = canvasPriv->itemForTouchPointId.value(ids.at(i));
+        QQuickItem *oldGrabber = windowPriv->itemForTouchPointId.value(ids.at(i));
         if (oldGrabber == this)
             return;
 
-        canvasPriv->itemForTouchPointId[ids.at(i)] = this;
+        windowPriv->itemForTouchPointId[ids.at(i)] = this;
         if (oldGrabber)
             ungrab.insert(oldGrabber);
     }
@@ -5117,11 +5217,11 @@ void QQuickItem::grabTouchPoints(const QList<int> &ids)
 void QQuickItem::ungrabTouchPoints()
 {
     Q_D(QQuickItem);
-    if (!d->canvas)
+    if (!d->window)
         return;
-    QQuickCanvasPrivate *canvasPriv = QQuickCanvasPrivate::get(d->canvas);
+    QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(d->window);
 
-    QMutableHashIterator<int, QQuickItem*> i(canvasPriv->itemForTouchPointId);
+    QMutableHashIterator<int, QQuickItem*> i(windowPriv->itemForTouchPointId);
     while (i.hasNext()) {
         i.next();
         if (i.value() == this)
@@ -5195,22 +5295,22 @@ QPointF QQuickItem::mapToItem(const QQuickItem *item, const QPointF &point) cons
 QPointF QQuickItem::mapToScene(const QPointF &point) const
 {
     Q_D(const QQuickItem);
-    return d->itemToCanvasTransform().map(point);
+    return d->itemToWindowTransform().map(point);
 }
 
 QRectF QQuickItem::mapRectToItem(const QQuickItem *item, const QRectF &rect) const
 {
     Q_D(const QQuickItem);
-    QTransform t = d->itemToCanvasTransform();
+    QTransform t = d->itemToWindowTransform();
     if (item)
-        t *= QQuickItemPrivate::get(item)->canvasToItemTransform();
+        t *= QQuickItemPrivate::get(item)->windowToItemTransform();
     return t.mapRect(rect);
 }
 
 QRectF QQuickItem::mapRectToScene(const QRectF &rect) const
 {
     Q_D(const QQuickItem);
-    return d->itemToCanvasTransform().mapRect(rect);
+    return d->itemToWindowTransform().mapRect(rect);
 }
 
 QPointF QQuickItem::mapFromItem(const QQuickItem *item, const QPointF &point) const
@@ -5222,21 +5322,21 @@ QPointF QQuickItem::mapFromItem(const QQuickItem *item, const QPointF &point) co
 QPointF QQuickItem::mapFromScene(const QPointF &point) const
 {
     Q_D(const QQuickItem);
-    return d->canvasToItemTransform().map(point);
+    return d->windowToItemTransform().map(point);
 }
 
 QRectF QQuickItem::mapRectFromItem(const QQuickItem *item, const QRectF &rect) const
 {
     Q_D(const QQuickItem);
-    QTransform t = item?QQuickItemPrivate::get(item)->itemToCanvasTransform():QTransform();
-    t *= d->canvasToItemTransform();
+    QTransform t = item?QQuickItemPrivate::get(item)->itemToWindowTransform():QTransform();
+    t *= d->windowToItemTransform();
     return t.mapRect(rect);
 }
 
 QRectF QQuickItem::mapRectFromScene(const QRectF &rect) const
 {
     Q_D(const QQuickItem);
-    return d->canvasToItemTransform().mapRect(rect);
+    return d->windowToItemTransform().mapRect(rect);
 }
 
 
@@ -5314,9 +5414,9 @@ QRectF QQuickItem::mapRectFromScene(const QRectF &rect) const
 
   \l {Filter}{Filters} include things like \l {Blur}{blurring}
   the item, or giving it a \l Reflection.  Some
-  filters may not be available on all canvases; if a filter is not
-  available on a certain canvas, it will simply not be applied for
-  that canvas (but the QML will still be considered valid).
+  filters may not be available on all windows; if a filter is not
+  available on a certain window, it will simply not be applied for
+  that window (but the QML will still be considered valid).
 
   \qml
   Item {