Because no default constructor exists. A default constructor is one that can be called with no parameters. You only have a constructor that can be called with an instance of an FObjectInitializer.
You have three options:
remove the FObjectInitializer& from your FRichTextTooltipS constructor. You’re not dealing with an object, so you shouldn’t need an FObjectInitializer.
create a second constructor that take 0 parameters.
remove the USTRUCT and GENERATED body from your FRichTextrTooltipS structure. The FRichTextDecorator that you’re inheriting from doesn’t appear to be a USTRUCT so if you derive from it, it probably shouldn’t be one either.
Hi MagForceSeven I’ve tried removing the parameters, super from FRichTextTooltipS and the generator body but I’m still getting the here the updated code
Note: I’m also not sure what you mean by removing USTRUCT? are you refereeing the F prefix because the class isn’t a struct or have struct generator body
.H
class FRichTextTooltipS : public FRichTextDecorator {
public:
FRichTextTooltipS();
virtual bool Supports(const FTextRunParseResults& RunParseResult, const FString& Text) const override {
};
};
UCLASS()
class UNREALCOC_API URichTextTooltip : public URichTextBlockDecorator {
GENERATED_BODY()
public:
};
My mistake, I thought you might have omitted it. It’s the only reason you should have had the GENERATED_BODY macro.
Okay, I think I know what the deal is. It’s because of how FRichTextDecorator is setup. You just don’t see a whole lot of “regular” C++ in the engine. The only constructor it provides takes a parameter so you’ll probably need to take that parameter.
and for the header you would just match that declaration. If you want to pass more parameters to your constructor you can. If you can get that InOwner from a custom parameter of your constructor you can. As long as you can pass a URichTextBlock* parameter to the FRichTextDecorator constructor.
Note: Super doesn’t work here because that’s powered by the GENERATED_BODY macro which (as this isn’t a USTRUCT) can’t be used so you’ve got to directly specify the parent type as normal (for C++ at least).