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. How to handle a scalefactor and Designer together
Forum Updated to NodeBB v4.3 + New Features

How to handle a scalefactor and Designer together

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 411 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.
  • P Offline
    P Offline
    petzold
    wrote on last edited by
    #1

    Hi Guys,

    have a question to QT-Quick 4.8

    Most of my programming i do in the designer, normally i have a background-picture and positoning my objects one by one with drag and drop. So for me it is very easy and fast to position all my objects.

    Now to the problem. If the qml is runnning, it is possible that the size of the picture is changing. The picture is implemented in that way

    Image {
       id: main
       width: root.width
       height: root.height
       anchors.top: root.top
       anchors.left: root.left
       source: "images/background_1024_768.png"
       fillMode: Image.PreserveAspectCrop
    }
    

    now i'm looking for a way that i can change my x and y value of the items with something like a scale factor.
    at the moment i do it manually with:

    property double scaleX: 1135/main.paintedWidth
    

    and than in the element:

    Item {
       x: 507 / main.scaleX
       y: 428
    }
    

    But if i do it in that way i cant move it anymore in the designer because the x-value is not "free" anymore.
    I'm looking for a possiblity to move the item in the designer and have the scale factor at the same time.
    i don't want to use Repeater, Grids, Columns or Rows

    Is there a way to do that?

    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