[Qt-interest] Calling parent Widget slot
Donal O'Connor
donaloconnor at gmail.com
Thu Apr 9 17:08:20 CEST 2009
Hi Ender,
Good idea indeed.
I just tried changing the constructor to pass "MyParentWidgetType" class
instead of QWidget * parent.... and created a MyParentWidgetType * m_parent
member variable and called the status from this and that worked fine without
segmentation fault. Quite strange, I thought both ways were same in theory.
Over all though, the signal/slot method is better idea. I've implemented it
and it works perfectly.
Cheers!
Regards,
Donal
On Thu, Apr 9, 2009 at 4:02 PM, Ender EREL <erelender at yahoo.com> wrote:
> I don't know what the problem is, but i have a suggestion. Create a
> custom signal in the child widget and whenever you need to set the
> status from the child, emit that signal. In the parent, connect this
> signal to the custom slot and you are good to go. This way the child
> doesn't need to know about the parent.
>
> Ender EREL
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090409/ccf0fb27/attachment.html
More information about the Qt-interest-old
mailing list