#include <rectangle.h>
Public Types | |
| enum | { Type = UserType + 1 } |
| enum | ResizeHandleIdx { RH_NONE, RH_TOP_LEFT, RH_TOP_RIGHT, RH_BOTTOM_RIGHT, RH_BOTTOM_LEFT } |
Public Member Functions | |
| Rectangle (qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent=0) | |
| int | type () const |
| ResizeHandleIdx | handleAt (QPointF pos) |
| void | startResize () |
| void | resize (ResizeHandleIdx hidx, QPointF pos) |
| void | rotate (bool clockwise) |
| int | handleWidth () |
| double | actualWidth () |
| double | actualHeight () |
| QRectF | boundingRect () const |
| void | resizeDone () |
| void | buttonDown (QPointF scenePos) |
| Inform this item that the mouse was clicked at the given position. | |
| QPointF | buttonDownPos () |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
| If selected, overlay the resize handle images. | |
Protected Member Functions | |
| virtual QRectF | innerBoundingRect () const |
Protected Attributes | |
| QPointF | m_buttonDownPos |
| Last position given to buttonDown(), mapped to item coord system. | |
Static Protected Attributes | |
| static QPixmap * | resizeHandle |
It can be dragged to size, moved around, selected, and later resized by dragging the corner handles.
Definition at line 13 of file rectangle.h.
| anonymous enum |
Definition at line 22 of file rectangle.h.
| Rectangle::Rectangle | ( | qreal | x, | |
| qreal | y, | |||
| qreal | width, | |||
| qreal | height, | |||
| QGraphicsItem * | parent = 0 | |||
| ) |
Definition at line 10 of file rectangle.cpp.
| double Rectangle::actualHeight | ( | ) |
| double Rectangle::actualWidth | ( | ) |
| QRectF Rectangle::boundingRect | ( | ) | const |
Definition at line 16 of file rectangle.cpp.
References HANDLE_MARGIN.
Referenced by innerBoundingRect(), paint(), and resize().

| void Rectangle::buttonDown | ( | QPointF | scenePos | ) |
Inform this item that the mouse was clicked at the given position.
Will remember buttonDownPos in its own coord system for later use while dragging.
Definition at line 108 of file rectangle.cpp.
References m_buttonDownPos.
| QPointF Rectangle::buttonDownPos | ( | ) | [inline] |
Definition at line 52 of file rectangle.h.
References m_buttonDownPos.
Referenced by SelectTool::mouseMoveEvent().

| Rectangle::ResizeHandleIdx Rectangle::handleAt | ( | QPointF | pos | ) |
Definition at line 60 of file rectangle.cpp.
References HANDLE_VIRTUAL_SIZE, innerBoundingRect(), RH_BOTTOM_LEFT, RH_BOTTOM_RIGHT, RH_NONE, RH_TOP_LEFT, and RH_TOP_RIGHT.
Referenced by SelectTool::mousePressEvent().


| int Rectangle::handleWidth | ( | ) |
Definition at line 81 of file rectangle.cpp.
References resizeHandle.
Referenced by paint().

| QRectF Rectangle::innerBoundingRect | ( | ) | const [protected, virtual] |
Definition at line 26 of file rectangle.cpp.
References boundingRect().
Referenced by handleAt().


| void Rectangle::paint | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option, | |||
| QWidget * | widget = 0 | |||
| ) |
If selected, overlay the resize handle images.
Definition at line 88 of file rectangle.cpp.
References boundingRect(), handleWidth(), and resizeHandle.

| void Rectangle::resize | ( | ResizeHandleIdx | hidx, | |
| QPointF | pos | |||
| ) |
Definition at line 31 of file rectangle.cpp.
References boundingRect(), RH_BOTTOM_LEFT, RH_BOTTOM_RIGHT, RH_TOP_LEFT, and RH_TOP_RIGHT.
Referenced by SelectTool::mouseMoveEvent().


| void Rectangle::resizeDone | ( | ) |
Definition at line 55 of file rectangle.cpp.
Referenced by SelectTool::mouseReleaseEvent().

| void Rectangle::rotate | ( | bool | clockwise | ) |
| void Rectangle::startResize | ( | ) |
| int Rectangle::type | ( | ) | const [inline] |
QPointF Rectangle::m_buttonDownPos [protected] |
Last position given to buttonDown(), mapped to item coord system.
Definition at line 68 of file rectangle.h.
Referenced by buttonDown(), and buttonDownPos().
QPixmap * Rectangle::resizeHandle [static, protected] |
1.5.8