Skip to content
  • 0 Votes
    3 Posts
    692 Views
    T

    Hey, not sure if you found the solution yet. But you can try this:

    QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem; pixmapItem->setPixmap(QPixmap(":/images/pixmap.png")); _scene->addItem(pixmapItem); pixmapItem->setRotation(pixmapItem->rotation() + 45.0); QGraphicsRectItem *boundingRect = new QGraphicsRectItem(pixmapItem->sceneBoundingRect()); QPen outlinePen; outlinePen.setWidth(2); outlinePen.setColor(Qt::red); boundingRect->setPen(outlinePen); _scene->addItem(boundingRect);

    I believe what you want is the sceneBoundingRect() and not the boundingRect().

  • 0 Votes
    35 Posts
    5k Views
    JonBJ

    @hobbyProgrammer said in window closes after completing certain actions.:

    @JonB Hi, just a quick update. I think it does get there, but it prints this part before going executing the slot.

    It's really important for those who try to help you to give accurate description of what does/does not happen. Everyone was trying to figure how your connect() could not complete and get to the next line....

  • 0 Votes
    5 Posts
    1k Views
    H

    @JonB oh that was really stupid. I was meant to check another QVector of QPolygons...