dreamer
5th May 2008, 18:02
I write the code for resizing a QRectItem and it works very well.
For example, to resize my custom QrectItem from the top-right corner, i calculate the new rect in this manner:
QRectF new_rect(QPointF(rect().bottomLeft().x(),event->pos().y()),
QPointF(event->pos().x(),boundingRect().bottomLeft().y()));
When I use the "same" approach for resizing my custom QPixmapItem, it give me problem and resize doesn't work!!
QRect new_rect(QPoint(pixmap().rect().bottomLeft().x(),
event->pos().toPoint().y()),
QPoint(event->pos().toPoint().x(),
pixmap().rect().bottomLeft().y()));
What's wrong???
For example, to resize my custom QrectItem from the top-right corner, i calculate the new rect in this manner:
QRectF new_rect(QPointF(rect().bottomLeft().x(),event->pos().y()),
QPointF(event->pos().x(),boundingRect().bottomLeft().y()));
When I use the "same" approach for resizing my custom QPixmapItem, it give me problem and resize doesn't work!!
QRect new_rect(QPoint(pixmap().rect().bottomLeft().x(),
event->pos().toPoint().y()),
QPoint(event->pos().toPoint().x(),
pixmap().rect().bottomLeft().y()));
What's wrong???