Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] Image sourcesizes
Forum Updated to NodeBB v4.3 + New Features

[Solved] Image sourcesizes

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 4 Posters 3.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    spode
    wrote on last edited by
    #1

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

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

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Well, use the same line as above, but substitute "width" with "height"... You can use the Item's "height" property, too.

      (Z(:^

      1 Reply Last reply
      0
      • S Offline
        S Offline
        spode
        wrote on last edited by
        #3

        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!

        1 Reply Last reply
        0
        • F Offline
          F Offline
          favoritas37
          wrote on last edited by
          #4

          According to the documentation, you could just change the width property and that would stretch your image as needed:
          @
          Image { ...
          width: parent.width * 2 / 3
          }
          @

          1 Reply Last reply
          0
          • S Offline
            S Offline
            spode
            wrote on last edited by
            #5

            0k0k but i want a non-proportionated image!!
            i like this
            @
            Image { ...
            width: parent.width * 2 / 3
            }
            @
            and i obtain the relative height, that i want to make larger! ;)

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mbrasser
              wrote on last edited by
              #6

              Hi,

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

              @height: implicitHeight * 2@

              Regards,
              Michael

              1 Reply Last reply
              0
              • S Offline
                S Offline
                spode
                wrote on last edited by
                #7

                thanks but i am using QtQuick 1.0.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved