How to expose a UserWidget created in C++?

I want to use a UserWidget as a template.

This is the class:
btn

However it doesn’t appear in the list when I search for it.

custombutton

I can see the ones I’ve made with blueprints. But I can’t see the ones I’ve made with C++.

I’ve been trying some class modifiers but no success.

UCLASS(Abstract, BlueprintType, Blueprintable)

How to do it?
Thank you so much!!

I don’t believe they will show up under User Created until you create a new User Widget derived from your parent C++ class. Have you created a new widget and selected your parent class as the base?

1 Like

Yes, if I derive a blueprint from the class it appears.
But that takes all the charm out of it.
It doesn’t make much sense, as I could have done the same just using blueprints.

I wanted to use C++ for as many things as possible.
It has happened to me on many occasions that the blueprints are broken for some reason.

It is easier to recover the work if it is in C++. It is even possible to go back to previous versions of the engine if necessary. That’s why I want to do as much as possible in C++.

So I’m trying to see what can be done with the UIs.

Thank you very much for your comment!!

Hello!
Has this problem been resolved?
I have the same problem.

Derive the blueprint from the class. Then you must declare the same variables in the blueprint (with the same type and name). Then you must bind them.

1 Like