I would like to style individual nodes with distinct styles. However this is not working as I would expect. Here is what I'm doing:
auto* vNode = qanGraph->insertNode<myNodeType>();
qan::NodeItem* vNodeItem = vNode->getItem();
qan::NodeStyle* vNodeStyle = new qan::NodeStyle(vNodeItem);
vNodeStyle->setBorderColor(QColor(100, 100, 200, 255));
vNodeItem->setStyle(vNodeStyle);
The items will all use the default node style, rather than my custom node style. I tried to follow this up in the code, but I'm quite a bit lost between StyleManager, Node::style() and NodeItem::getStyle().
After a longer investigation, it seems that in QML I override the default style, when the component is completed. This override of the default style seems to modify how my graph is rendered. If I do not override the defaults in QML, everything works fine and the C++ style is respected.
I would like to style individual nodes with distinct styles. However this is not working as I would expect. Here is what I'm doing:
The items will all use the default node style, rather than my custom node style. I tried to follow this up in the code, but I'm quite a bit lost between
StyleManager,Node::style()andNodeItem::getStyle().After a longer investigation, it seems that in QML I override the default style, when the component is completed. This override of the default style seems to modify how my graph is rendered. If I do not override the defaults in QML, everything works fine and the C++ style is respected.