Rid QtWidget signals inside QObject
-
Hello guys,
I have a tab based software, for each tab I wrote a class to separate the code and control each module. I used findChild method to get access to the widgets inside of the related tab. My problem is trying to delete the instance of a specific tab and disconnect all signals of the widgets inside of a QObject on the destruct method instead of selecting a widget one by one and disconnecting their signals.
Thanks in advance!
-
Hello guys,
I have a tab based software, for each tab I wrote a class to separate the code and control each module. I used findChild method to get access to the widgets inside of the related tab. My problem is trying to delete the instance of a specific tab and disconnect all signals of the widgets inside of a QObject on the destruct method instead of selecting a widget one by one and disconnecting their signals.
Thanks in advance!
@Omicron91 said in Rid QtWidget signals inside QObject:
I have a tab based software, for each tab I wrote a class to separate the code and control each module. I used findChild method to get access to the widgets inside of the related tab.

why bother with encapsulation at all when you do this ?
My problem is trying to delete the instance of a specific tab and disconnect all signals of the widgets inside of a QObject on the destruct method instead of selecting a widget one by one and disconnecting their signals.
when done properly, connects will "disconnect" as soon as one of the object instances gets destroyed, there should be no need for manual disconnect calls.