[Qt-interest] class composition & communication in Qt

Markus Franke Franke.M at sebakmt.com
Thu Sep 30 13:40:23 CEST 2010


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.

Hope this helps,
Markus


qt-interest-bounces at trolltech.com schrieb am 29.09.2010 16:48:05:

> Hi all,
>  
> I have a MainWindow and a widget member class.
>  
> The widget,  while painting, needs information from MainWindow. So what 
> is the best way to access information from the member class to the 
> holding class? Is there an usual pattern in Qt or GOF for this problem?
>  
> thanks
> pm
>  _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest



"Disclaimer: This message is intended only for the use of the individual 
or entity to
which it is addressed and may contain information which is privileged, 
confidential, proprietary,
or exempt from disclosure under applicable law. If you are not the 
intended recipient or the person
responsible for delivering the message to the intended recipient, you are 
strictly prohibited from
disclosing, distributing, copying, or in any way using this message. If 
you have received this 
communication in error, please notify the sender and destroy and delete 
any copies you may have
received."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100930/7000aa6b/attachment.html 


More information about the Qt-interest-old mailing list