x

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"

C++ Adding Widget to WidgetTree doesn't update Hierarchy view in editor

I'm adding a UIMage to the WidgetTree RootWidget for a custom cursor class using UUserWidget. While this works and the design view show the image the Hierarchy view that lists the widgets continues to show the Canvas panel that is automatically added.

In the UMGEditor the hierarcy view is managed by a WidgetTreeView but I can't tell how to tell it to update it's view of the items in the UUserWidget.

I override the RebuildWidget likes this:

       if(MyImage == nullptr)
       {
         MyImage = WidgetTree->ConstructWidget<UImage>(UImage::StaticClass(), TEXT("CursorImage"));
         WidgetTree->RootWidget = MyImage;
         if(IsDesignTime()) {
           WidgetTree->SetFlags(RF_Transactional);
           WidgetTree->Modify();
         }
         FName DefaultText = TEXT("Default");
         SetCursor(DefaultText);
       }
     
       return UUserWidget::RebuildWidget();
     

If a default texture has been set it even display in the design view. Just can't get that menu on the side to update.

Product Version: UE 4.11
Tags:
more ▼

asked Jun 18 '16 at 09:15 PM in C++ Programming

avatar image

dormlock
78 6 8 11

avatar image JavierRamello Aug 08 '16 at 10:24 AM

Did you find a solution for this? I am having the same problem

avatar image Ovodus Sep 30 '16 at 10:52 AM

That's my problem too. Please anybody, share at least your thoughts about it.

avatar image Efron Jul 22 '17 at 12:34 PM

I have same problem, any one can help!!!!!!!!!!!1

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

5 answers: sort voted first

I have same problem, too :(

more ▼

answered Aug 17 '16 at 09:13 AM

avatar image

mujjai
1 1

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

I have same problem, too :(

more ▼

answered Jul 22 '17 at 12:33 PM

avatar image

Efron
11 2 4 6

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

Maybe because you're rebuilding the widget after you're setting everything?

more ▼

answered Jan 02 '18 at 01:50 PM

avatar image

EA_Firestorm
1

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

You can editor widget in blueprint.And use WidgetTree->FindWidget() anywhere you want in cpp.

more ▼

answered Mar 20 '18 at 09:09 AM

avatar image

a409197988
6 2 1

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

have anyone solve this problem?

more ▼

answered Jan 09 '19 at 06:14 AM

avatar image

guoweilong
1 1

(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