Ok… just now I’m using the other method for this reason…
but basically in the creation of all my Widgets I had this problem.
I had to get the references to using blueprints.
Are you creating widgets in C++ or are you trying to reference blueprint widgets?
If they are BP widgets it’s pretty obvious why it’s not working (you can’t use the name of a BP class in C++, you can set them all to TSubclassOf<UUserWidget> and set their value in a child blueprint.
Let me know what’s the answer of the previous question to provide you better info.
Just for you to know, the names of the classes starting with “UC” are out of standard by the way. This is not your issue but it’s better to respect the naming convention:
However, all the graphic design (layout) is done in the blueprint.
So, then I understood that in order to use StaticClass() the class must be made 100% in C++…
I feel like a fool!!
Yes, I use C to know that it’s a class made in C++… at least temporarily, because I’m translating my bluprints to C++… it’s just a way to temporarily distinguish it
I forgot to mention that calling ::StaticClass() on a TSubclassOf<> is kinda nonsense, because it’s already returning a variable of type UClass, as you can see MyWidgetSubclass is purple, you can call ::StaticClass() on UObjects (Blue ones):
You can set this variables in a child blueprint and use them in C++, but remember to check if they are valid!