On Monday, 2013-11-04, 21:48:11, Alan Alpert wrote: > On Sat, Nov 2, 2013 at 5:06 AM, Kevin Krammer <[email protected]> wrote:
> > The thing is that the widgets wouldn't have non-Widget parents, at least
> > not in DeclarativeWidgets. The parent is either a widget or, most of the
> > times, a layout. The layouts' addWidget methods reparent to their parent
> > widget.
> >
> > Therefore one option might be to just not call set parent on widget
> > objects
> > and let the list property code deal with reparenting.
>
> I'm surprised this works. There's implicit QObject parenting built
> into the language, for example:
> QtObject {
> id: foo
> property Widget bar: Widget{}
> }
>
> Will automatically make foo the qobject parent of bar.
>
> I'm not certain, but I think this happens before it gets assigned to
> the property which might make any declarative widgets example using
> layouts crash in debug builds...
Interesting, will have to try that. So far we've never used a widget as a
named property, only ever as part of a declarative list property.
Cheers,
Kevin
--
Kevin Krammer | [email protected] | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
