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