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. QGraphicsPixmapItem quality degraded when rotated
Forum Updated to NodeBB v4.3 + New Features

QGraphicsPixmapItem quality degraded when rotated

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 158 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.
  • dporobicD Offline
    dporobicD Offline
    dporobic
    wrote on last edited by dporobic
    #1

    Does anyone know why a quality of a QGraphicsPixmapItem degrades after rotating it?

    This is the original image:
    95fcfb8c-8724-4ea8-8e74-5e416a32a58d-image.png

    This one is rotated by just 1°:
    1276291e-018b-495f-90d1-d8c509802158-image.png

    So far I have tried setting the TransformationMode:

    setTransformationMode(Qt::SmoothTransformation);
    

    And painting it manually:

    painter->setRenderHints( QPainter::Antialiasing | QPainter::SmoothPixmapTransform );
    painter->drawPixmap( boundingRect().topLeft(), myOriginalPixmap );
    

    Without any noticeably change there.

    This is how the rotation is done:

    auto center = boundingRect().center();
    auto transform = this->transform();
    transform.translate(center.x(), center.y());
    transform.rotate(angel);
    transform.translate(-center.x(), -center.y());
    setTransform(transform);
    

    I have also tried rotating with this, but the effect was the same:

    setRotation(angel);
    

    What I have noticed is that rotating by 90°, 180°, 270° and 360° looks ok.
    Any Ideas how to fix this?

    https://github.com/ksnip/ksnip

    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