Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. SetScale(qreal) vs scale(qreal, qreal)
Forum Updated to NodeBB v4.3 + New Features

SetScale(qreal) vs scale(qreal, qreal)

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.8k 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.
  • X Offline
    X Offline
    xtingray
    wrote on last edited by
    #1

    Hi,
    Looking around the Internet, I found this link:
    http://kunalmaemo.blogspot.com/2010/07/rotation-and-mirroring-qgraphicsitem-in.html

    Something interesting about it was to find this instruction:
    @
    graphicsItem->scale(-1,1)
    @

    I was looking for the method scale(qreal, qreal) in the QGraphicsItem documentation:
    http://doc.qt.nokia.com/latest/qgraphicsitem-members.html

    And there's no trace about it. The funny thing is that I tested that method from my
    source code using Qt 4.7 and it really works. Is this a ghost method or I'm missing
    something?

    Anyway, unfortunately for me it is not exactly what I am looking for.
    My question is this:

    I need the same result of the method setScale(qreal) but with the option of scaling
    X and Y axes with different values.
    Is there a way to implement something like setScale(qreal, qreal) ?

    Thanks for any clue!


    Qt Developer

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      You might want to check out QGraphicsItem::setTransform(). That method allows you to set a QTransform, which allows you to setup basically any 2D transformation you might need.

      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