[Qt-interest] class composition & communication in Qt

Kustaa Nyholm Kustaa.Nyholm at planmeca.com
Thu Sep 30 14:14:26 CEST 2010


-- 
Kustaa Nyholm
Research Manager, Software
Research and Technology Division
PLANMECA OY
Asentajankatu 6
00880 HELSINKI
FINLAND

Please note our new telephone and fax numbers!
Tel: +358 20 7795 572 (direct)
Fax: +358 20 7795 676
GSM: +358 40 580 5193
e-mail: kustaa.nyholm at planmeca.com


> From: Markus Franke <Franke.M at sebakmt.com>
> Date: Thu, 30 Sep 2010 14:40:23 +0300
> To: pmqt71 <pmqt71 at gmail.com>
> Cc: <qt-interest at trolltech.com>
> Conversation: [Qt-interest] class composition & communication in Qt
> Subject: Re: [Qt-interest] class composition & communication in Qt
> 
> 
> 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
>> <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."





More information about the Qt-interest-old mailing list