[Qt-interest] class composition & communication in Qt

Andre Somers andre at familiesomers.nl
Thu Sep 30 15:40:12 CEST 2010


  Op 30-9-2010 13:40, Markus Franke schreef:
>
> Hi pm,
>
> a signal-slot connection is in most cases the best solution as it 
> provides a loose coupling between the parent and the child widget.
>
> You should not use parentWidget() in a child widget (including a 
> corresponding cast) and expect to get what you want.
> This would force the child widget always to be used within the same 
> parent widget.
>
I agree, but sometimes, this is what you want. In that case, you should 
however force the type of your parent widget by having the parent 
argument in the constructor for your widget explicitly be of that type 
(for some private subwidget, for instance).

André

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100930/55dc819b/attachment.html 


More information about the Qt-interest-old mailing list