BugSwat
(BugSwat)
November 16, 2017, 2:51pm
1
I have the following working code in my derived class Derived:
SLATE_BEGIN_ARGS(Derived)
: _m_pStyle()
{}
SLATE_ATTRIBUTE(TSharedPtr<StyleBase>, m_pStyle)
SLATE_END_ARGS()
The member “m_pStyle” is in the base class Base.
I’d like to NOT have the above code in the derived class, but only in the base class.
I’d like to NOT have all derived classes have to touch all members.
How do I do that?
You could replace SLATE_BEGIN_ARGS with its contents, then change the arguments struct to derive from the base classes arguments like so
public:
struct FArguments : public SMyBaseClassWidget::FArguments
{
typedef FArguments SMyDerivedWidget::FArguments;
FORCENOINLINE FArguments()
{}
SLATE_ATTRIBUTE(TSharedPtr<StyleBase>, m_pStyle)
SLATE_END_ARGS()
This is pretty messy though and you would have to manually update it if the SLATE_BEGIN_ARGS macro changes
Acually this has further issues, as the return type of ‘Me’ would be the base classes arguments you would not be able to use SNew
BugSwat
(BugSwat)
November 16, 2017, 10:14pm
4
Thank you. I don’t understand all of your answer but it seems you know enough to not want to do it.
I’ll switch to
use set(ter) methods
go around the construct method and just construct when I am ready
Thanks.