How to update internal values in C++ struct in editor?

I have a custom struct that I’ve made in C++. Most of the properties are editable in the editor, but a couple of them are derived from calculations made on some of the user-entered values. I can get these values to calculate fine in the constructor, but I need them to update when the dependent values are changed in the editor. I am trying to use code that is suggested to do this for classes (from this page), but it’s not working.

Here’s what I’m trying:

	void CalculateValues()
	{
		ThinningSpeedRange = ThinningSpeedMax - ThinningSpeedMin;
	}

	#if WITH_EDITOR
	void FBrushSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
	{
		CalculateValues();

		Super::PostEditChangeProperty(PropertyChangedEvent);
	}
	#endif

Is there a different approach to doing this when working with structs?

No, because struct don’t have a base which would let engine code to call PostEditChangeProperty. You need to implement this function in object that contains it, best would be if you do so on some base class.

Alternaticly you try write custom widget for you struct and call function on update of widget

But you will need to learn Slate first

Ah, ok. No problem, I can implement this in another way. Thanks for letting me know!