Hi, I am trying to use SSuggestionBox to display some possible questions from an array. I have the following code but I get the error ‘cannot access protected member declared in class’. If I set the variable to public I get another error.
In the header file there is this code:
class PROJECT_API SMyChatWidget : public SCompoundWidget
{ ...
void Construct(const FArguments& InArgs);
TSharedPtr< SSuggestionTextBox > InputTextBox;
...
}
In the cpp file there is this code:
void SMyChatWidget::Construct(const FArguments& InArgs){
...
SAssignNew(InputTextBox, SSuggestionTextBox)
...
TArray<FString> suggestions = { TEXT(hey), TEXT(Hey)};
InputTextBox -> SetSuggestions (suggestions, true);
}
Any help is appreciated. Thankyou!