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. QtPixmapItem tears after rotation
Forum Updated to NodeBB v4.3 + New Features

QtPixmapItem tears after rotation

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 330 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.
  • N Offline
    N Offline
    noastick
    wrote on last edited by
    #1

    Hi.
    I created a QGraphicsPixmapItem subclass called "Lshape". Now in the constructor I set a pixmap from a resource file. Now I want to rotate it:
    @ if (event->key() == Qt::Key_Left)
    {
    setTransform(QTransform().translate(TransfPoint().x(),TransfPoint().y()).rotate(-90).translate(-TransfPoint().x(),-TransfPoint().y()));
    DecreaseType();
    }@

    TransfPoint returns the center of the shape:
    @ if (type%2==0) return QPointF((x()+300)/2,(y()+200)/2);
    else return QPointF((x()+200)/2,(y()+300)/2);@

    The thing is, after rotating, if you drag the image it tears and I don't know why.
    !http://i57.tinypic.com/2hqw0n9.png()!

    Hope you can help me. Thanks.

    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