onPaint event not triggered twice
-
@itzwich1 said in onPaint event not triggered twice:
Component.onCompleted:{
value: 20 //Works not (Only one of both Arrows will draw with onPaint
}This syntax is incorrect. It should be:
Component.onCompleted:{ value = 20 } -
@itzwich1 said in onPaint event not triggered twice:
Component.onCompleted:{
value: 20 //Works not (Only one of both Arrows will draw with onPaint
}This syntax is incorrect. It should be:
Component.onCompleted:{ value = 20 } -
Assignment like this (with
=) breaks bindings (with:). So, if you rely on some property to set the value (likevalue: someOtherValue), don't add override inonCompleted. -
Assignment like this (with
=) breaks bindings (with:). So, if you rely on some property to set the value (likevalue: someOtherValue), don't add override inonCompleted. -
OK, now I begin to understand :-) Try forcing a repaint in your setter for
valueproperty (in C++). -
OK, now I begin to understand :-) Try forcing a repaint in your setter for
valueproperty (in C++). -
You can call
updatePaintNode(yourMainNode, nullptr);if you have the main node stored somewhere. Alternatively, mark the node as dirty https://doc.qt.io/qt-5/qsgnode.html#markDirty -
You can call
updatePaintNode(yourMainNode, nullptr);if you have the main node stored somewhere. Alternatively, mark the node as dirty https://doc.qt.io/qt-5/qsgnode.html#markDirty -
Verify if it's called or not with debugger or
qDebug.Maybe paste the drawing code here, perhaps there's something wrong there?