[Interest] qml 'subclasses'
jswigart at gmail.com
Thu May 10 16:39:04 CEST 2012
I'm relatively new to QML so I'm not sure how to accomplish this.
Basically I want to define a custom object in QML, with custom properties
and functionality, and then I want to be able to 'subclass' that component
with different date for those standardized properties and whatever else
needs tailored to the instance.
To use a game analogy
property int attack: 3
property int defend: 2
// would like to inherit from monster so that it shares functionality and
// properties that are not overridden
property int attack: 4
property int defend: 4
I could create a separate file/database of the instances, and
instantiate the monster component and fill in their properties with
setProperty, but I would like to keep everything in QML, in case a
specific subclass needs to provide more interactive functionality,
animation, or whatever else QML can provide.
Is there any way to do this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest