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. Implement proper zooming
Qt 6.11 is out! See what's new in the release blog

Implement proper zooming

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 673 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    For a special use case, I would like to simply zoom the whole QML scene by a factor (just like I can do in GraphicsView, for example).

    Is there a clean way to do this? My initial trials to set a scale transform to the root item of my QML scene, and set the root item's size from the C++ side did not really work, and also seem overly complicated to me. It should be a simple thing for a rendering engine to render everything with a scaling factor, but I don't seem to be able to find the right calls.

    A 1 Reply Last reply
    0
    • A Asperamanca

      For a special use case, I would like to simply zoom the whole QML scene by a factor (just like I can do in GraphicsView, for example).

      Is there a clean way to do this? My initial trials to set a scale transform to the root item of my QML scene, and set the root item's size from the C++ side did not really work, and also seem overly complicated to me. It should be a simple thing for a rendering engine to render everything with a scaling factor, but I don't seem to be able to find the right calls.

      A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      @Asperamanca
      Answering my own question: Using setScale() and setTransformOrigin() on the root item from the C++ side seems to work well. I just have to remember not to use scale and transformOrigin on root items in my QML files.

      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