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"

Why do STreeView sub-nodes not expand?

Hello everyone,

I'm using an STreeView and when I try to expand a node with children NOT on the root level it doesn't work and won't expand, neither with double-clicking nor using an SExpanderArrow.

The nodes contain valid children ( OnGetChildren returns the children and SExpanderArrow is visible).

I tried binding OnMouseDoubleClick event and call SetItemExpansion manually, but it doesn't work either. However when using this event, IsItemExpanded returns true right after calling SetItemExpansion.

To create custom TreeRows and TreeNodes I used the SceneOutliner as a reference, and I don't understand what I'm doing differently from it (I'm using STreeView as it is, I'm not inheriting from it, though).

Any help would be greatly appreciated.


Product Version: Not Selected
more ▼

asked Jul 04 '14 at 01:55 PM in C++ Programming

avatar image

Brice H.
26 2 4 6

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

2 answers: sort voted first

I fixed this bug, which I had forgotten for a while:

Don't dynamically create an array of children in the OnGetChildren method. Store the children nodes in a member variable and return it; OnGetChildren is just a getter.

more ▼

answered Oct 17 '14 at 02:16 PM

avatar image

Brice H.
26 2 4 6

avatar image Hyper4Volt Oct 10 '18 at 08:03 AM

Hey, you probably dont even remember becuase it was like 4 years ago, But do you think you can help me? Im getting the same issues and I dont really understand what you mean by returnning the member variable

avatar image muchcharles Jan 31 '19 at 03:58 AM

I had the same thing happen as OP. What I did is in my FItemInfo I added a member variable like this:

 class FItemInfo
     TArray<TSharedPtr<FItemInfo>> Children;

, then OnGetChildren, I populate that array and also output the elements from it into the out array reference. Before I was only outputting the elements without keeping my own shared ptr of the children.

avatar image Kobe Byrant Mar 15 '19 at 02:17 AM

Can you tell me more details? Because I have the same problem

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

I did it!

We can't do array operations in OnAddChildren() We should declare a struct in .h,like this:

 struct FDialogNameInfo
       FDialogNameInfo(FString Name) : DialogId(Name){}

        FString DialogId;
        TArray<TSharedPtr<FDialogNameInfo>> Children;

 TArray<TSharedPtr< FDialogNameInfo>>DialogTreeInfo

And then,We need to match the father and the child in the TreeItemSounce and DialogTreeInfo one by one.

Specifically, you can get an algorithm according to your data structure. The example in the engine can see SSkeletonSlotName.h and .cpp


 void FDialogRootCustomization::OnAddSubChildren(TSharedPtr<FDialogNameInfo> Info,TArray<TSharedPtr<FDialogNameInfo>>&OutChildren)

{ OutChildren = InInfo->Children; }

more ▼

answered Mar 20 '19 at 01:29 AM

avatar image

Kobe Byrant
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