qt - How update a QQuickItem created only at C++ level -
i have qquickitem
derived class below
class myqquickitem : public qquickitem { q_object public: myqquickitem(qquickitem *parent = 0); ~ myqquickitem(); qsgnode *updatepaintnode(qsgnode *, updatepaintnodedata *); };
i have own texturenode
class well.
i have myqquickitem
registered on qml side & embedded in main.qml
below.
myqquickitem { id: my_quick_item objectname: "myqquickitemobject" visible: false width: 500 height: 500 }
on trigger of signal, have connected slot in myqquickitem
, call this->update()
. of course triggers updatepaintnode
& able repaint myqquickitem
new content want.
is possible trigger updatepaintnode
on qquickitem
without declaring @ in qml file?
i want dynamically create myqquickitem
@ c++ level & not have defined or declared @ in main.qml
how can this?
core question: how can create qquickitem purely @ c++ level updatable new content calling update on updatepaintnode fired?
update: able create qquickitem
in following way.
qquickview * view = new qquickview; view->setsource(qurl(qstringliteral("qrc:/myqquickitem.qml"))); qquickitem * myquickitem_object = view->rootobject();
but problem cant updatepaintnode
fire when call this->update
. what should qquickitem
update itself?
wiki
Comments
Post a Comment