BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
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.
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=nullptr) | |
QRectF | boundingRect () const override |
EHandleLocation | getHandleLocation () const |
EHandleType | getHandleType () const |
EHandleLocation | getOppositeHandleLocation () const |
int | type () const override |
void | updateHandleElementPosition (const QRectF &rect) |
set position from location type using coordinates of external rectangle More... | |
Protected Member Functions | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override |
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() |
Enumerator | |
---|---|
NONE | |
TOPLEFT | |
TOPMIDDLE | |
TOPRIGHT | |
MIDDLELEFT | |
MIDDLERIGHT | |
BOTTOMLEFT | |
BOTTOMMIDLE | |
BOTTOMRIGHT |
Definition at line 32 of file SizeHandleElement.h.
SizeHandleElement::SizeHandleElement | ( | EHandleLocation | pointType, |
QGraphicsObject * | parent = nullptr |
||
) |
Definition at line 80 of file SizeHandleElement.cpp.
References m_cursors, and m_handleLocation.
|
override |
Definition at line 89 of file SizeHandleElement.cpp.
Referenced by paint().
SizeHandleElement::EHandleLocation SizeHandleElement::getHandleLocation | ( | ) | const |
Definition at line 152 of file SizeHandleElement.cpp.
References m_handleLocation.
SizeHandleElement::EHandleType SizeHandleElement::getHandleType | ( | ) | const |
Definition at line 162 of file SizeHandleElement.cpp.
References m_handleType.
Referenced by EllipseView::mouseMoveEvent(), RectangleView::mouseMoveEvent(), and paint().
SizeHandleElement::EHandleLocation SizeHandleElement::getOppositeHandleLocation | ( | ) | const |
Definition at line 157 of file SizeHandleElement.cpp.
References m_handleLocation, and m_opposite_handle_location.
Referenced by RectangleBaseView::onSizeHandleElementRequest().
|
overrideprotected |
Definition at line 106 of file SizeHandleElement.cpp.
References resize_request().
|
overrideprotected |
Definition at line 112 of file SizeHandleElement.cpp.
References resize_request().
|
overrideprotected |
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().
|
inlineoverride |
|
virtualslot |
Definition at line 167 of file SizeHandleElement.cpp.
void SizeHandleElement::updateHandleElementPosition | ( | const QRectF & | rect | ) |
set position from location type using coordinates of external rectangle
Definition at line 119 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().