<snip, detect parent/child changes from QML in C++>

Martin spaketh:

>  QGraphicsItem::itemChange() may do what you want:
>
>
>
> http://doc.qt.nokia.com/4.7-snapshot/qgraphicsitem.html#itemChange
>

Works great!  Thanks!

Related question:  Now that I'm in the QGraphicsItem world, which is *not* a
QObject with properties, how does QML expose attributes (since those are
*all* properties based)?

For example, the QGraphicsItem::boundingRect() is always (0,0,-1,-1), even
though the referenced QML component *has* width and height.  Similarly, the
QGraphicsItem::opaqueArea()::boundingRect() is always (0,0,0,0).  Does the
QGraphicsItem have *any* opinion about or state from attributes in the QML
element?  (e.g., what attributes can I trust in the QGraphicsItem as being
those used by the QML element?)

What is the intended mechanism by which I interrogate the QGraphicsItem?
(Is the expectation that the user will merely attempt to downcast to
QGraphicsObject or QDeclarativeItem, handling the scenarios where it is not
that type?)  For examle, I *assume* that the MouseArea will trigger child
notification, but it is not a QDeclarativeItem.  In contrast, a Rectangle{}
or Text{} trigger child notification, and "happen to be" QDeclarativeItem
instances.

Thanks!

--charley
_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to