aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-08-16 17:58:27 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2021-09-29 16:14:44 +0200
commite57ba6916efec2a9506b5b12ed34e402c48955d1 (patch)
treee135ed41875a968739b459b0db7f9abe964534c7 /src/quick/items/qquickitem_p.h
parent6a50f9350d8abf65e23c65daef76b862097ec7e8 (diff)
Large Text: populate only lines visible in Window into SG
Text is rendered top-to-bottom: QQuickTextNode::addTextLayout() iterates lines of text. Now it first maps the window size() rectangle into the Text item's coordinate system, and treats that as the viewport: lines whose y coordinates fall outside are omitted. This saves a huge amount of time and memory when the text is large. So Flickable { Text { } } can actually be used in an ebook reader now, for example. QQuickItemPrivate::transformChanged(parent) is now used to inform all children when a parent moves; so e.g. when a content item is moved inside a "viewport" item (like a Flickable, or any other item that is being used as a clipping viewport or just as a holder), all children of the content item will be notified; and QQuickTextPrivate uses this occasion to mark itself dirty so that the updatePaintNode() will be called again. This happens directly after the actual movement: QQuickTextPrivate::transformChanged qquicktext.cpp 2990 QQuickItemPrivate::transformChanged qquickitem.cpp 5200 QQuickItemPrivate::dirty qquickitem.cpp 6339 QQuickItem::setY qquickitem.cpp 6830 QQuickFlickablePrivate::setViewportY qquickflickable.cpp 1800 Task-number: QTBUG-60491 Task-number: QTBUG-90734 Change-Id: I152d23caa725f194a186a604fbc8d0c07f597b16 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/quick/items/qquickitem_p.h')
-rw-r--r--src/quick/items/qquickitem_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index f55c655723..0d35cfd48c 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -617,7 +617,7 @@ public:
}
QPointF computeTransformOrigin() const;
- virtual void transformChanged();
+ virtual void transformChanged(QQuickItem *transformedItem);
QPointF adjustedPosForTransform(const QPointF &centroid,
const QPointF &startPos, const QVector2D &activeTranslatation,