December 11, 2011

spode spode
Lab Rat
317 posts

[Solved] Image sourcesizes

 

  1. Image { ...
  2. sourceSize.width: parent.width * 2 / 3
  3.  }

i like the width, but i do not like the height of the image. how do you modify solely the height?

6 replies

December 11, 2011

sierdzio sierdzio
Area 51 Engineer
4109 posts

Well, use the same line as above, but substitute “width” with “height”… You can use the Item’s “height” property, too.

 Signature 

(Z(:^

December 11, 2011

spode spode
Lab Rat
317 posts

i did not explain well. this width (sourceSize.width: parent.width * 2 / 3) is right, but i would double the height obtained from that code snippet. excuse me. thanks sierdzio!

December 11, 2011

favoritas37 favoritas37
Lab Rat
148 posts

According to the documentation, you could just change the width property and that would stretch your image as needed:

  1. Image { ...
  2.        width: parent.width * 2 / 3
  3.  }

December 12, 2011

spode spode
Lab Rat
317 posts

0k0k but i want a non-proportionated image!!
i like this

  1. Image { ...
  2.        width: parent.width * 2 / 3
  3.  }

and i obtain the relative height, that i want to make larger! ;)

December 13, 2011

mbrasser mbrasser
Lab Rat
452 posts

Hi,

If you are using QtQuick 1.1 or higher you could try something like:

  1. height: implicitHeight * 2

Regards,
Michael

December 13, 2011

spode spode
Lab Rat
317 posts

thanks but i am using QtQuick 1.0.

 
  ‹‹ [Solved] QtMobility Bluetooth stringData is empty      QResource, Audio and SoundEffect problems ››

You must log in to post a reply. Not a member yet? Register here!