Understanding QQuickItem
-
Hey, I need to display a pixmap to qml via a
QQuickItem
and after reading the documentation, I am still not entirely sure how it works.From what I get, the key methods are
geometryChange
andupdatePaintNode
.updatePaintNode
seems to be called (only?) whenQQuickItem::update
is called and it is the function that does the actual updating of the visual item, is that correct?Also, when exactly is
geometryChange
called? Does this simply happen every time when an QQuickObject's size, position, ... changes?Is the
QQuickItem::update
method ever called from Qt itself, or am I responsible to do this, in react togeometryChange
being called?Thanks in advance.
-
@Creaperdown Do you have access to the full pixmap? You could load it on the qml side and implement the scrolling (e.g.,
Flickable
) and zooming (scale
property) there. If that's no applicable to your use case, then I don't know, I have no experience with usingQQuickItem
directly unfortunately... -
QQuickImageProvider is likely the easier route to follow.
Image
inheritsItem
, which instantiates QQuickItem. I don't believe that any of the properties in QQuickItem are final. -
@Creaperdown are you mixing qwidget and qml?