[Qt-interest] class composition & communication in Qt
程梁
chengliang.soft at gmail.com
Thu Sep 30 07:02:46 CEST 2010
When you create this widget, you can pass the main window's pointer as its
parent.
All widgets in Qt have one argument "parent" in their constructor and you
can get
this parent using parent() function with necessary casting. This may help
you.
2010/9/29 pmqt71 <pmqt71 at gmail.com>
> 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
>
>
--
Cheng Liang
from: chengliang.soft at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100930/2283f3f9/attachment.html
More information about the Qt-interest-old
mailing list