diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-01-17 22:08:56 +0100 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-01-17 22:08:56 +0100 |
commit | 9c54d0ef8f6442e32d5762edccef46db80b68681 (patch) | |
tree | 0fdbc2be98a2e7fd7728a3860d56c94db3e173bb /src/quick/items/qquickitem.cpp | |
parent | 1512835ee1425a3e874d2f2dd2b01f1a1ea7b763 (diff) | |
parent | 36a42ed6b11dce102d0e0f93fbd441011b003157 (diff) |
Merge branch 'stable' into dev
Conflicts:
src/qml/doc/qtqml.qdocconf
src/quick/doc/qtquick.qdocconf
Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 3af378dd84..8e2a8c2ddc 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtQml module of the Qt Toolkit. @@ -1572,7 +1572,7 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus) You can subclass QQuickItem to provide your own custom visual item that inherits these features. - \section2 Custom Items using Scene Graph + \section1 Custom Scene Graph Items All visual QML items are rendered using the scene graph, a low-level, high-performance rendering stack, closely tied to @@ -1590,7 +1590,7 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus) To read more about how the scene graph rendering works, see \l{Scene Graph and Rendering} - \section2 Custom Items using QPainter + \section1 Custom QPainter Items The QQuickItem provides a subclass, QQuickPaintedItem, which allows the users to render content using QPainter. @@ -2992,9 +2992,11 @@ void QQuickItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeo } /*! - Called by the rendering thread, as a result of - QQuickItem::update(), when it is time to sync the state of the QML - objects with the scene graph objects. + Called on the render thread when it is time to sync the state + of the item with the scene graph. + + The function is called as a result of QQuickItem::update(), if + the user has set the QQuickItem::ItemHasContents flag on the item. The function should return the root of the scene graph subtree for this item. Most implementations will return a single @@ -3025,11 +3027,17 @@ void QQuickItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeo the visual outcome is identical. \warning It is crucial that OpenGL operations and interaction with - the scene graph happens exclusively on the rendering thread, + the scene graph happens exclusively on the render thread, primarily during the QQuickItem::updatePaintNode() call. The best rule of thumb is to only use classes with the "QSG" prefix inside the QQuickItem::updatePaintNode() function. + \warning This function is called on the render thread. This means any + QObjects or thread local storage that is created will have affinity to the + render thread, so apply caution when doing anything other than rendering + in this function. Similarily for signals, these will be emitted on the render + thread and will thus often be delivered via queued connections. + \sa QSGMaterial, QSGSimpleMaterial, QSGGeometryNode, QSGGeometry, QSGFlatColorMaterial, QSGTextureMaterial, QSGNode::markDirty() */ |