[Interest] Is it possible to define and inherit component in the same QML file?

Mitch Curtis mitch.curtis at qt.io
Wed Sep 12 18:10:36 CEST 2018


> -----Original Message-----
> From: Alexander Ivash <elderorb at gmail.com>
> Sent: Wednesday, 12 September 2018 6:07 PM
> To: Mitch Curtis <mitch.curtis at qt.io>
> Subject: Re: [Interest] Is it possible to define and inherit component in the
> same QML file?
> 
> Thanks, that's what I thought, but still hoped. Is this something can be added
> in future?

Somehow I doubt it, but only the QML engine developers can give an authoritative answer.

> ср, 12 сент. 2018 г. в 19:05, Mitch Curtis <mitch.curtis at qt.io>:
> >
> > > -----Original Message-----
> > > From: Interest <interest-bounces+mitch.curtis=qt.io at qt-project.org>
> > > On Behalf Of Alexander Ivash
> > > Sent: Wednesday, 12 September 2018 6:02 PM
> > > To: interest at qt-project.org
> > > Subject: [Interest] Is it possible to define and inherit component
> > > in the same QML file?
> > >
> > > Like this:
> > >
> > > property Component baseDelegate: Item { }
> > >
> > > property Component textDelegate: baseDelegate { }
> > >
> > > property Component imageDelegate: baseDelegate { } .....
> > >
> > > Currently it doesn't work, but maybe there are some tricks to
> > > achieve behaviour like this without moving baseDelegate to
> 'BaseDelegate.qml'.
> > > And yes, I'm aware of composition, but the question is about inheritance.
> >
> > I don't think there's any way to do that without creating a separate file for
> it first.
> >
> > > _______________________________________________
> > > Interest mailing list
> > > Interest at qt-project.org
> > > http://lists.qt-project.org/mailman/listinfo/interest


More information about the Interest mailing list