Propagate signal to every children widgets


Hi,

Please let me know if I could send a signal when pressing a button on every child widget which attached to the parent widget by using Editor Widget Utilities.

For example: if I click “All On”, all “Text Block” items will be checked and vice versa.

Thanks

You can query container panels for their children like so:

Cast to Check Box if you want to fetch checkboxes. But it depends on how you actually structured it.

Can’t tell from the pic if the Check Box + Text Block is a user widget. If it is, you’d need to fetch those user widgets first → cast → get checkbox → tick it.

You can, ofc, also:

image

1 Like

OMG. Too easy, thank you so much.
I thought we could use something a bit complex to achieve.

Btw, I’m trying to create a validation list in UE, and it will check criteria depending on whether the check is checked or not.

Thanks.

1 Like

Hi, @Everynone,

in this case, are we able to use event dispatcher to send a signal from the parent widget to all children ones?

You could but the parent is already fully aware of its children so there’s no need for an Event Dispatcher. Call the children directly. We’re doing this, right:


You’d use an Event Dispatcher if you wanted a Child talk to the Parent.

Lets say you manually tick one of the checkboxes and you want the widget with the All On button to know about it - that’s a job an Event Dispatcher.

1 Like

Hi @Everynone ,

Thank you btw,
Please let me know how to add an item to ListVew widget.

I tried like in the image but no luck
image

Search for it. There’s plenty of tuts and I’ve posted it several times already.

In short, you do not add widgets to list view, you construct objects and the list view manages the widgets’ lifespan for you.

It’s a different forkflow.

1 Like

Thank you,

I managed to solve it.
yeah, it’s quite a different way compared with what I’ve done in PySide.
I find a ListWidget needs an ObjectData and a Widget to represent the data.

1 Like