BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Size handle on top of RectangleView represented as small circle or small rectangle. More...
Public Types | |
enum | EHandleLocation { NONE , TOPLEFT , TOPMIDDLE , TOPRIGHT , MIDDLELEFT , MIDDLERIGHT , BOTTOMLEFT , BOTTOMMIDLE , BOTTOMRIGHT } |
enum | EHandleType { RESIZE , RESIZE_WIDTH , RESIZE_HEIGHT } |
Public Slots | |
virtual void | update_view () |
Signals | |
void | resize_request (bool going_to_resize) |
Public Member Functions | |
SizeHandleElement (EHandleLocation pointType, QGraphicsObject *parent=0) | |
QRectF | boundingRect () const |
EHandleLocation | getHandleLocation () const |
EHandleType | getHandleType () const |
EHandleLocation | getOppositeHandleLocation () const |
int | type () const |
void | updateHandleElementPosition (const QRectF &rect) |
set position from location type using coordinates of external rectangle More... | |
Protected Member Functions | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) |
Private Attributes | |
EHandleLocation | m_handleLocation |
EHandleType | m_handleType |
Static Private Attributes | |
static QMap< EHandleLocation, Qt::CursorShape > | m_cursors |
static QMap< EHandleLocation, EHandleType > | m_location_to_type = create_location_to_type_map() |
static QMap< EHandleLocation, EHandleLocation > | m_opposite_handle_location = getMapOfOppositeCorners() |
Size handle on top of RectangleView represented as small circle or small rectangle.
Placed either in corners on in the middle of the edge.
Definition at line 26 of file SizeHandleElement.h.
Enumerator | |
---|---|
NONE | |
TOPLEFT | |
TOPMIDDLE | |
TOPRIGHT | |
MIDDLELEFT | |
MIDDLERIGHT | |
BOTTOMLEFT | |
BOTTOMMIDLE | |
BOTTOMRIGHT |
Definition at line 32 of file SizeHandleElement.h.
SizeHandleElement::SizeHandleElement | ( | EHandleLocation | pointType, |
QGraphicsObject * | parent = 0 |
||
) |
Definition at line 80 of file SizeHandleElement.cpp.
References m_cursors, and m_handleLocation.
QRectF SizeHandleElement::boundingRect | ( | ) | const |
Definition at line 89 of file SizeHandleElement.cpp.
Referenced by paint().
SizeHandleElement::EHandleLocation SizeHandleElement::getHandleLocation | ( | ) | const |
Definition at line 155 of file SizeHandleElement.cpp.
References m_handleLocation.
SizeHandleElement::EHandleType SizeHandleElement::getHandleType | ( | ) | const |
Definition at line 165 of file SizeHandleElement.cpp.
References m_handleType.
Referenced by EllipseView::mouseMoveEvent(), RectangleView::mouseMoveEvent(), and paint().
SizeHandleElement::EHandleLocation SizeHandleElement::getOppositeHandleLocation | ( | ) | const |
Definition at line 160 of file SizeHandleElement.cpp.
References m_handleLocation, and m_opposite_handle_location.
Referenced by RectangleBaseView::onSizeHandleElementRequest().
|
protected |
Definition at line 107 of file SizeHandleElement.cpp.
References resize_request().
|
protected |
Definition at line 113 of file SizeHandleElement.cpp.
References resize_request().
|
protected |
Definition at line 94 of file SizeHandleElement.cpp.
References boundingRect(), getHandleType(), MaskEditorHelper::getSelectionMarkerBrush(), MaskEditorHelper::getSelectionMarkerPen(), and RESIZE.
|
signal |
Referenced by RectangleBaseView::create_size_handle_elements(), mousePressEvent(), and mouseReleaseEvent().
|
inline |
|
virtualslot |
Definition at line 170 of file SizeHandleElement.cpp.
void SizeHandleElement::updateHandleElementPosition | ( | const QRectF & | rect | ) |
set position from location type using coordinates of external rectangle
Definition at line 120 of file SizeHandleElement.cpp.
References BOTTOMLEFT, BOTTOMMIDLE, BOTTOMRIGHT, m_handleLocation, MIDDLELEFT, MIDDLERIGHT, TOPLEFT, TOPMIDDLE, and TOPRIGHT.
|
staticprivate |
Definition at line 70 of file SizeHandleElement.h.
Referenced by SizeHandleElement().
|
private |
Definition at line 68 of file SizeHandleElement.h.
Referenced by SizeHandleElement(), getHandleLocation(), getOppositeHandleLocation(), and updateHandleElementPosition().
|
private |
Definition at line 69 of file SizeHandleElement.h.
Referenced by getHandleType().
|
staticprivate |
Definition at line 71 of file SizeHandleElement.h.
|
staticprivate |
Definition at line 72 of file SizeHandleElement.h.
Referenced by getOppositeHandleLocation().