17 #ifndef QGSCOMPOSERMOUSEHANDLES_H
18 #define QGSCOMPOSERMOUSEHANDLES_H
20 #include <QGraphicsRectItem>
77 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
90 void mouseMoveEvent( QGraphicsSceneMouseEvent* event );
91 void mouseReleaseEvent( QGraphicsSceneMouseEvent* event );
92 void mousePressEvent( QGraphicsSceneMouseEvent* event );
93 void hoverMoveEvent( QGraphicsSceneHoverEvent * event );
94 void hoverLeaveEvent( QGraphicsSceneHoverEvent * event );
99 void selectionChanged();
102 void selectedItemSizeChanged();
105 void selectedItemRotationChanged();
141 QRectF selectionBounds()
const;
144 bool selectionRotation(
double & rotation )
const;
147 void updateHandles();
149 void drawHandles( QPainter* painter,
double rectHandlerSize );
151 void drawSelectedItemBounds( QPainter* painter );
155 double rectHandlerBorderTolerance();
158 Qt::CursorShape cursorForPosition(
const QPointF& itemCoordPos );
164 void dragMouseMove(
const QPointF& currentPosition,
bool lockMovement,
bool preventSnap );
167 QSizeF calcCursorEdgeOffset(
const QPointF &cursorPos );
170 void resizeMouseMove(
const QPointF& currentPosition,
bool lockAspect,
bool fromCenter );
173 QGraphicsLineItem* hAlignSnapItem();
174 void deleteHAlignSnapItem();
176 QGraphicsLineItem* vAlignSnapItem();
177 void deleteVAlignSnapItem();
178 void deleteAlignItems();
183 QPointF alignItem(
double& alignX,
double& alignY,
double unalignedX,
double unalignedY );
185 QPointF alignPos(
const QPointF& pos,
double& alignX,
double& alignY );
188 void collectAlignCoordinates( QMap< double, const QgsComposerItem* >& alignCoordsX, QMap< double, const QgsComposerItem* >& alignCoordsY );
189 bool nearestItem(
const QMap< double, const QgsComposerItem* >& coords,
double value,
double& nearestValue )
const;
190 void checkNearestItem(
double checkCoord,
const QMap< double, const QgsComposerItem* >& alignCoords,
double& smallestDiff,
double itemCoordOffset,
double& itemCoord,
double& alignCoord )
const;
193 QGraphicsView* graphicsView();
196 void setViewportCursor( Qt::CursorShape cursor );
199 void resetStatusBar();
202 #endif // QGSCOMPOSERMOUSEHANDLES_H
QgsComposition * mComposition
bool mIsDragging
True if user is currently dragging items.
QPointF mLastMouseEventPos
Position of the last mouse move event (in scene coordinates)
A item that forms part of a map composition.
QGraphicsLineItem * mVAlignSnapItem
bool isDragging()
Returns true is user is currently dragging the handles.
MouseAction
Describes the action (move or resize in different directon) to be done during mouse move...
double mBeginHandleWidth
Width and height of composer handles at beginning of resize.
QPointF mMouseMoveStartPos
Start point of the last mouse move action (in scene coordinates)
bool isResizing()
Returns true is user is currently resizing with the handles.
Graphics scene for map printing.
double mBeginHandleHeight
void setComposition(QgsComposition *c)
QGraphicsLineItem * mHAlignSnapItem
Align snap lines.
QgsComposition * composition()
QPointF mBeginMouseEventPos
Position of the mouse at beginning of move/resize (in scene coordinates)
QgsComposerMouseHandles::MouseAction mCurrentMouseMoveAction
QPointF mBeginHandlePos
Position of composer handles at beginning of move/resize (in scene coordinates)
Handles drawing of selection outlines and mouse handles.
QGraphicsView * mGraphicsView
bool mIsResizing
True is user is currently resizing items.