[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:05:18 CEST 2018


> -----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