need help understanding "connect"
-
This post is deleted!
-
@AnneRanch
Can you explain in simple English, what is the purpose of your nested loops and arrays? -
@AnneRanch
To make your code work, you need to do the right things right. I don’t know exactly what you want to achieve. How your menus should look like. Draw them on a sheet of paper and post a photo.
Your issues are not related to understanding “connect”. Your connect statements are syntactically correct, meaning you are doing it right. But you want to connect signals from objects in a nested container all to the same slot. So the slot has to know, who fired the signal. That’s where the drama starts. Why hide information at one place by architecture, so you have to dig it out on the other end, in the slot. Why not write a slot or a lambda for each action you want to connect to? Your issue is in the loops around nested containers, not in “connect”. I haven’t seen a use case that requires such a complicated structure. Maybe it’s necessary in your case. Let us know. Tell us why. You are not handling the structure well, otherwise you wouldn’t connect to a nullptr. If you want to fix your code, this is where to look.