Friday 15 January 2010

qt - Can QSGNode inherit QObject? -



qt - Can QSGNode inherit QObject? -

can qsgnode inherit qobject , connect signals , slots? have tried slot called when rendering done.

i had matrix of cells. using qml display them on bi dimensional listview (a listview had in each delegate listview). lacked performance changed scenegraph. problem info model. i'm passing qlist, column has qlist. each row has cells have signals. cells change. want notify render updates on signals. solution until have improve 1 create each cell trigger changed signal on respective column it's turn turn update flag on main qquickitem implementing scene.

ideas?

you should connect signals model qquickitem handles qsgnode instead of straight connecting qsgnode. qsgnode objects supposed handled within qsgrenderingthread.

qobjects 'live' in 1 thread. thread emit , receive signals. making qsgnode qobject, must pay attending emitting , receiving threads otherwise you'll symptoms ones describe. unless specify qt::directconnection when create connection, if signal emitted 1 thread , received object living in thread, signal converted message , dispatched later using qeventloop.

a practice have construction ones provided in qt examples :

qquickitem handles signal connections , stores properties. depending on has changed, qquickitem sends commands qsgnode recalculate parts of geometry. done through qquickitem::updatepaintnode()

qt scenegraph

No comments:

Post a Comment