nodeeditor icon indicating copy to clipboard operation
nodeeditor copied to clipboard

ShadowColor not taken into account when setting NodeStyle after creation

Open DexterMagnific opened this issue 5 years ago • 2 comments

Hi,

The ShadowColor set on a node after its creation is not taken into account. This is because it is not forwarded to the QGraphicsDropShadowEffect installed:

NodeStyle s(n->nodeDataModel()->nodeStyle());

s.ShadowColor = color;
n->nodeDataModel()->setNodeStyle(s);

Workaround: Set it manually

static_cast<QGraphicsDropShadowEffect *>(n->nodeGraphicsObject().graphicsEffect())->setColor(s.ShadowColor);

DexterMagnific avatar Apr 29 '19 07:04 DexterMagnific

Hi,

I simply was not intended to make colored shadows. Shadow is shadow -- it is gray/black/dark.

Of course except when you have a good reason to do so. Could you please explain your use case?

Regards,

Dmitry

paceholder avatar Apr 30 '19 09:04 paceholder

Use case: we have an app in which we offer the ability to the user to set custom node background color (single background, all GradientX are the same). When changing the color, we also change the shadow color to the selected color (darker). We think it looks nicer when the shadow follows the bg color.

Apart from any use case consideration, a setStyle() should do its job right: apply all the entries to the object, including ShadowColor.

DexterMagnific avatar Apr 30 '19 10:04 DexterMagnific