Hello ,a question puzzles me so much time ,who can help me?

The most important problem in my design is that i can not get the actual width 
and height of image after changing the source of image.
// the example :    the actual size of "0001.jpg"  is 5120*3840,  "0002.jpg" is 
3000*4000,
// my screen is 1920*1080 , so the image should be scaled,
//**********************************************************
        Image {
             id : image1
             source:"0001.jpg"
             sourceSize.width:1920
             sourceSize.height:1080
             Component.onCompleted:{
           /*
            *  this the process of scaling width and height . 
            *  image size:5210*3840      after scale :1440*1080
                image size:7680*4320      after scale :1920*1080
                image size:3000*4000      after scale : 810*1080
            */
             width = 1440
             height =1080
}
}
            keys.onPressed:{
               if (event.key == Qt.Key_Right) {
                 image1.source = "0002.jpg"
                  console.log("image1.width::"+image1.width+" 
image1.height::"+image1.height)
//********************************************************************
// here, the actual size of "0002.jpg" is 3000*4000,but after pressing the 
button of "Right",
// the image1.width couldn't change, it is 1440,height is 1080
// so this is the problem: after changing the source of image, the width and 
height of image1(id) could //not  change  at the same time
}
}
At 2011-03-24 23:44:45,"Yuvraaj Kelkar" <[email protected]> wrote:
>Sorry to reply to myself but I clicked send before pasting the links
>to the QML involved:
>http://code.google.com/p/qgvdial/source/browse/trunk/qml/ContactsList.qml
>http://code.google.com/p/qgvdial/source/browse/trunk/qml/ContactDetails.qml
>
>On Thu, Mar 24, 2011 at 8:43 AM, Yuvraaj Kelkar <[email protected]> wrote:
>> Here's a working example:
>> http://code.google.com/p/qgvdial/source/browse/trunk/src/ContactsModel.cpp#16
>>
>> It's my oft clichéd contacts model in which each contact has a model
>> containing phone entries.
>>
>> Hope this helps
>>
>> 2011/3/24 wz <[email protected]>:
>>> I just tell you it is possible!
>>>
>>> At 2011-03-24 20:29:28,"Alexey Zaryanov" <[email protected]> wrote:
>>>
>>> If i have C++ model where each item have another model inside. How can id
>>> implement this?
>>> For example:
>>> Listview{
>>>    model: myCPPmodel
>>>    .............
>>>    ............
>>>    delegate: Item{
>>>      .............
>>>      ListView{
>>>           model: myModelFromCPPmodel
>>>            ....
>>>      {
>>>
>>>    }
>>> }
>>>
>>> It is possible ?
>>>
>>>
>>>
>>> _______________________________________________
>>> Qt-qml mailing list
>>> [email protected]
>>> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>>>
>>>
>>

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to