Give something like this a try:

Structure1.qml
Item {
            id:item
            property string image1source: ""
            property string image2 source: ""

            Image {
id: image1
source: image1source
}
            Image {
id: image2
source: image2source
}

}

I then inherit this structure, and set the additional info at runtime:
CompleteObject1.qml
Structure {
            id:structure1Item

            Component.onCompleted: {
                        structure1Item.image1source = "image1.png"
                        structure1Item.image2source = "image2.png"
            }
}


Nate


From: interest-bounces+nate.rogers=raymondcorp....@qt-project.org 
[mailto:interest-bounces+nate.rogers=raymondcorp....@qt-project.org] On Behalf 
Of Jason H
Sent: Friday, January 03, 2014 10:23 AM
To: interest@qt-project.org
Subject: [Interest] QML "container" inheritience and sharing IDs

I have a structured QML document that is nothing more than Items and Images. 
Some Images are collected into an Item and an id is assigned.


Structure1.qml
Item {
            id:item
            Image { id: image1}
            Image { id: image2}
}

I then inherit this structure, and set the additional info at runtime:
CompleteObject1.qml
Structure {
            Component.onCompleted: {
                                                                                
                image1.source = "image1.png"
                                                                                
                image2.source = "image2.png"
            }
}

But when I load CompleteObject.qml it says "image1 not defined"
How can I expose the Structure ids to the CompleteObject?

(The structure and objects are functionally independent, except that they have 
matching IDs, such that StructureN intersects CompleteObjectN makes an instance 
)

Thanks!



Confidentiality Notice:

The preceding e-mail message (including any attachments) contains information 
that may be confidential, protected by applicable legal privileges, or 
constitute non-public information. It is intended to be conveyed only to the 
designated recipient(s). If you are not an intended recipient of this message, 
please notify the sender by replying to this message and then delete it from 
your system. Use, dissemination, distribution or reproduction of this message 
by unintended recipients is 
not authorized and may be unlawful.


_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to