You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose that I have several node styles, and I would like to switch between them to indicate a state of a node (perhaps using a distinct backColor). On the level of my qan::Node subclass, I call getItem()->setStyle(x), after which I would expect that the QML code would adapt to my changes. Instead I see no difference.
In my particular case, I am using RectNodeTemplate, which internally relies on RectSolidBackground. By diving deep into the UI code, I found that because of lazy-loading, the node template only assigns the style property when the nodeItem property changes. Furthermore, there are protections against configuring nodeItem to null or undefined, which make it impossible to reset the nodeItem and explicitly set it again as a workaround.
By local experimentation, I figured out that the following patch to src/RectNodeTemplate.qml corrects the issue. It simply adds a change handler to nodeItem.style, which passes on the change to the loaded delegate. You may perhaps want to implement analogous fix to edges and groups.
I can confirm that this patch solves the issue with node styles on the latest develop branch! Nice work @petrmanek , now it would be great if the changes can be cleanly integrated.
Suppose that I have several node styles, and I would like to switch between them to indicate a state of a node (perhaps using a distinct
backColor
). On the level of myqan::Node
subclass, I callgetItem()->setStyle(x)
, after which I would expect that the QML code would adapt to my changes. Instead I see no difference.In my particular case, I am using
RectNodeTemplate
, which internally relies onRectSolidBackground
. By diving deep into the UI code, I found that because of lazy-loading, the node template only assigns thestyle
property when thenodeItem
property changes. Furthermore, there are protections against configuringnodeItem
tonull
orundefined
, which make it impossible to reset thenodeItem
and explicitly set it again as a workaround.By local experimentation, I figured out that the following patch to
src/RectNodeTemplate.qml
corrects the issue. It simply adds a change handler tonodeItem.style
, which passes on the change to the loaded delegate. You may perhaps want to implement analogous fix to edges and groups.The text was updated successfully, but these errors were encountered: