@JonB said in Connection signals for dynamically created widgets:
Bit it does not! QGraphicsItems do not inherit QObject, only QGraphicsObjects do.
You're right! I got confused when going up the inheritance tree in the documentation, I clicked on "inherited by QGraphicsObject" at some point thinking it was "inherits" instead.
I didn't specify in a written manner that my StateWidget was a QGraphicsEllipseItem as I had added the declaration of the class in the first message. I changed the class to inherit QObject as well though and it worked!
class StateWidget : public QObject, public QGraphicsEllipseItem { ... }The order of inheritance is important too.
The "Test n" below comes from the AutomatLab::StateParams function so the signal is properly forwarded to the main UI instance!
76d99a60-a567-4fff-9e5f-02f7a87ab787-image.png
Thank you for your help!