> -----Original Message----- > From: Alexander Ivash <elder...@gmail.com> > Sent: Wednesday, 12 September 2018 6:07 PM > To: Mitch Curtis <mitch.cur...@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.cur...@qt.io>: > > > > > -----Original Message----- > > > From: Interest <interest-bounces+mitch.curtis=qt...@qt-project.org> > > > On Behalf Of Alexander Ivash > > > Sent: Wednesday, 12 September 2018 6:02 PM > > > To: interest@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@qt-project.org > > > http://lists.qt-project.org/mailman/listinfo/interest _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest