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

Monster{

    id: npc

    property int attack: 3

    property int defend: 2

}


SpecificMonster {

    // would like to inherit from monster so that it shares functionality and

    // properties that are not overridden

    id: npc1

    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?
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to