Uh.....Compiler issue..maybe?

So, a funny thing happened:
error C2664: ‘SImage::FArguments::WidgetArgsType &SImage::FArguments::Image(const TAttribute &)’ :

cannot convert argument 2

from ‘const FSlateBrush (__cdecl AShell_UI_InventoryWidget::* )(void) const’

to ‘const FSlateBrush (__cdecl AShell_UI_InventoryWidget::* )(void) const’

Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

So, my only real question I suppose, is what is the compiler trying to tell me here… Error occured in this line while attempting to call a function which is a member of AShell_UI_InventoryWidget from

SNew(SImage).Image(this, &AShell_UI_InventoryWidget::GetItemSlateBrush)

I pulled this from a couple of other posts here, though I am unsure as to the usage of SImage::Image(this, …) as the only documentation I could find in the API only lists SImage::SetImage(FSlateBrush). SImage::Image is a member variable in the API docs and it’s just an FName for the name of the BrushResources. In either case SImage.Image(…) declarative syntax requires an FSlateBrush, which is somewhat confusing anyway.

Function Signature:
const FSlateBrush GetItemSlateBrush() const;

Did I miss something here? Do I need to make a delegate for this to make the above SImage.Image call?

Did the syntax parsing of AnswerHub eat the *, or is that not returning a const FSlateBrush*?

Son of a…Clearly I must be tired. Though, in my defense it does appear that the compiler is trying to tell me I need to cast to convert from one item to another of the exact same type. Thank you for your help :).

I agree that that’s a terrible error :slight_smile:

Sometimes I find that you need to read the output window rather than the error list to get all the details you need. I imagine it also listed the return and parameter types there, so you could see what cast it was actually trying to perform.