Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[REQUEST] Access inherited UI elements from child UserWidget

Currently, when you have a child widget that inherits a parent widget, there is no way of accessing the parent UI elements from the child UI (in the Designer View).

Say I have a custom button user widget (MyBaseButton) and a custom canvas (MyButtonMenu) that gets some MyBaseButtons and places them in a specific way.

Now I need a button that does everything MyBaseButton does, but is displayed slightly differently, so I create a new user widget, MySpecialButton which inherits MyBaseButton. But now I have no way of changing any property of MyBaseButton. Anything I add to the Designer view hierarchy makes the MyBaseButton disappear. If I just want MySpecialButton to be a scaled version of MyBaseButton, I can't do that.

And creating another widget MyOtherButton that does not inherit MyBaseButton but instead has MyBaseButton as a child doesn't solve this since I still want MyButtonMenu to layout the button.

Can anyone offer any insight on this issue I'm facing?

Are there any plans to improve UserWidgets in this aspect?

Thanks a lot!

Product Version: UE 4.13
more ▼

asked Nov 09 '16 at 04:19 AM in Using UE4

avatar image

80 5 10 15

avatar image skyphyr May 06 '17 at 10:09 PM
  • this is the equivalent of having blueprint actors unable to modify inherited components. It makes things like adding animation incredibly painful, plus you don't even get an accurate display of your userwidget in the designer because the inherited items don't draw there. Majin's workaround is very labor intensive and at least double's the memory footprint of your class.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

This is one of the oldest problems I've faced and has annoyed me greatly.

I support a feature request for this.

Here's a step-by-step guide on how I created my own fix for it.

  1. Create parent widget, including functionality and design elements

  2. Copy the widget and rename it (I usually add _child)

  3. Delete every function from the _child widget (functions you created in the parent)

  4. Rename all your widget design elements (I change their variable names to have an _c)

  5. Delete all variables which are not widgets (bools, ints, etc)

  6. Re-parent blueprint to your parent widget

  7. Modify your child blueprint on construct and make sure you set your _c variables to the parent variables (so if you have a border in your parent named frame and the one in child named frame_c, on construct set frame to frame_c)

Now you have access to all your functions and variables from your parent widget in a child widget that you can manipulate design elements for.

From this point, you can create multiple child widgets with various changes by simply duplicating the _child widget.

more ▼

answered Nov 09 '16 at 04:10 PM

avatar image

1.2k 31 8 33

avatar image Zheak Mar 16 '19 at 07:21 AM

It pains me greatly that a powerful engine like UE has not yet addressed this, but I appreciate this workaround greatly.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question