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 mouseDoubleClickEvent( QGraphicsSceneMouseEvent* event );
94 void hoverMoveEvent( QGraphicsSceneHoverEvent * event );
95 void hoverLeaveEvent( QGraphicsSceneHoverEvent * event );
100 void selectionChanged();
103 void selectedItemSizeChanged();
106 void selectedItemRotationChanged();
142 QRectF selectionBounds()
const;
145 bool selectionRotation(
double & rotation )
const;
148 void updateHandles();
150 void drawHandles( QPainter* painter,
double rectHandlerSize );
152 void drawSelectedItemBounds( QPainter* painter );
156 double rectHandlerBorderTolerance();
159 Qt::CursorShape cursorForPosition(
const QPointF& itemCoordPos );
165 void dragMouseMove(
const QPointF& currentPosition,
bool lockMovement,
bool preventSnap );
168 QSizeF calcCursorEdgeOffset(
const QPointF &cursorPos );
171 void resizeMouseMove(
const QPointF& currentPosition,
bool lockAspect,
bool fromCenter );
174 QGraphicsLineItem* hAlignSnapItem();
175 void deleteHAlignSnapItem();
177 QGraphicsLineItem* vAlignSnapItem();
178 void deleteVAlignSnapItem();
179 void deleteAlignItems();
184 QPointF alignItem(
double& alignX,
double& alignY,
double unalignedX,
double unalignedY );
186 QPointF alignPos(
const QPointF& pos,
double& alignX,
double& alignY );
189 void collectAlignCoordinates( QMap< double, const QgsComposerItem* >& alignCoordsX, QMap< double, const QgsComposerItem* >& alignCoordsY );
190 bool nearestItem(
const QMap< double, const QgsComposerItem* >& coords,
double value,
double& nearestValue )
const;
191 void checkNearestItem(
double checkCoord,
const QMap< double, const QgsComposerItem* >& alignCoords,
double& smallestDiff,
double itemCoordOffset,
double& itemCoord,
double& alignCoord )
const;
194 QGraphicsView* graphicsView();
197 void setViewportCursor( Qt::CursorShape cursor );
200 void resetStatusBar();
203 #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.