[Development] QML Component inheriting?

Sivan Greenberg sivan at omniqueue.com
Thu Oct 4 12:36:19 CEST 2012


IIRC, this was supported long ago and is the basis for the extreme
reuse QML enables.

-Sivan

On Thu, Oct 4, 2012 at 12:27 PM, Tomasz Siekierda <sierdzio at gmail.com> wrote:
>> What i really miss in QML is the ability to let a component inherit
>> functionality from another component.
>
> This is already a feature: just create your components in separate files and
> use this:
>
> // BaseButton.qml
> Item
> {
>    property int someNum: 100
>    ... the basics for a button.
> }
>
> // SpecialButton.qml
> BaseButton // SpecialButton
>
> {
>    somenum: 500
>    ... A BaseButton adjusted for special cases
> }
>
> // FancyButton.qml
> BaseButton //FancyButton
>
> {
>    ... Fancy button with special effects, shaders and whatever you can think
> of
> }
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>



-- 
-Sivan



More information about the Development mailing list