Re: SIGNAL SLOT performance
You can access to the parent widget with method QWidget::parentWidget ().
SIGNAL/SLOT mechanism allow you to have a responsive GUI.
If you call directly parent's method you bypass application event loop and then you have to pay attention to the responsiveness of your GUI.
Re: SIGNAL SLOT performance
If you are inheriting the class, the functions will be available to you, isnt it ?
Why do you need to call them separately ?
And signal/slot arent slow.... are you facing problems with it right now ?
Re: SIGNAL SLOT performance
Hi,
Thanks, but I never told that the classes are widgets and never told that the child classes are dervied from the first class.
The class A contains a QList<B*>. So class A contains a list of class B object pointers.
When a object B is created and inserted to the list I make some connections that when the object of the class B does something it emits a signal to class A. Is more clear now?
So, is a good idea to pass a parent pointer to the child classes to access direcly to the class A methods or is better to use SIGNAL SLOT mechanism?
Thanks,
Re: SIGNAL SLOT performance
I would use "pass parent pointer to a child", because as was told above, you will use direct calls. but if you don't know anything about parent, i.e. you can't say what kind of objects can be parent then it would be better to implement connection interface between classes using SIGNALS and SLOTS.
Re: SIGNAL SLOT performance
Hi,
Thanks spirit, it was what I suspect.