17 #include <QGraphicsView>
18 #include <QGraphicsSceneHoverEvent>
33 QGraphicsRectItem( 0 ),
34 mComposition( composition ),
36 mBeginHandleWidth( 0 ),
37 mBeginHandleHeight( 0 ),
49 setAcceptHoverEvents(
true );
68 QList<QGraphicsView*> viewList = scene()->views();
69 if ( viewList.size() > 0 )
82 Q_UNUSED( itemStyle );
102 QPen handlePen = QPen( QColor( 55, 140, 195, 255 ) );
103 handlePen.setWidth( 0 );
104 painter->setPen( handlePen );
107 painter->setBrush( Qt::NoBrush );
108 painter->drawRect( QRectF( 0, 0, rect().width(), rect().height() ) );
111 painter->setBrush( QColor( 255, 255, 255, 255 ) );
113 painter->drawRect( QRectF( 0, 0, rectHandlerSize, rectHandlerSize ) );
115 painter->drawRect( QRectF(( rect().width() - rectHandlerSize ) / 2, 0, rectHandlerSize, rectHandlerSize ) );
117 painter->drawRect( QRectF( rect().width() - rectHandlerSize, 0, rectHandlerSize, rectHandlerSize ) );
119 painter->drawRect( QRectF( 0, ( rect().height() - rectHandlerSize ) / 2, rectHandlerSize, rectHandlerSize ) );
121 painter->drawRect( QRectF( rect().width() - rectHandlerSize, ( rect().height() - rectHandlerSize ) / 2, rectHandlerSize, rectHandlerSize ) );
123 painter->drawRect( QRectF( 0, rect().height() - rectHandlerSize, rectHandlerSize, rectHandlerSize ) );
125 painter->drawRect( QRectF(( rect().width() - rectHandlerSize ) / 2, rect().height() - rectHandlerSize, rectHandlerSize, rectHandlerSize ) );
127 painter->drawRect( QRectF( rect().width() - rectHandlerSize, rect().height() - rectHandlerSize, rectHandlerSize, rectHandlerSize ) );
134 if ( selectedItems.size() == 0 )
141 painter->setCompositionMode( QPainter::CompositionMode_Difference );
144 QPen selectedItemPen = QPen( QColor( 144, 144, 144, 255 ) );
145 selectedItemPen.setStyle( Qt::DashLine );
146 selectedItemPen.setWidth( 0 );
147 painter->setPen( selectedItemPen );
148 painter->setBrush( Qt::NoBrush );
150 QList<QgsComposerItem*>::iterator itemIter = selectedItems.begin();
151 for ( ; itemIter != selectedItems.end(); ++itemIter )
154 QPolygonF itemBounds;
155 if (
mIsDragging && !( *itemIter )->positionLock() )
159 QPolygonF itemSceneBounds = ( *itemIter )->mapToScene(( *itemIter )->rectWithFrame() );
162 itemSceneBounds.translate( transform().dx(), transform().dy() );
164 itemBounds = mapFromScene( itemSceneBounds );
166 else if (
mIsResizing && !( *itemIter )->positionLock() )
169 if ( selectedItems.size() > 1 )
172 QRectF itemRect = mapRectFromItem(( *itemIter ), ( *itemIter )->rectWithFrame() );
175 itemBounds = QPolygonF( itemRect );
186 itemBounds = mapRectFromItem(( *itemIter ), ( *itemIter )->rectWithFrame() );
188 painter->drawPolygon( itemBounds );
196 QList<QGraphicsItem *> itemList =
composition()->items();
197 QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
198 for ( ; itemIt != itemList.end(); ++itemIt )
211 QObject::disconnect( item, SIGNAL( sizeChanged() ),
this, 0 );
212 QObject::disconnect( item, SIGNAL( itemRotationChanged(
double ) ),
this, 0 );
213 QObject::disconnect( item, SIGNAL( frameChanged( ) ),
this, 0 );
246 if ( selectedItems.size() > 0 )
255 setRotation( rotation );
267 setRect( 0, 0, newHandleBounds.width(), newHandleBounds.height() );
268 setPos( mapToScene( newHandleBounds.topLeft() ) );
285 QList<QgsComposerItem*>::iterator itemIter = selectedItems.begin();
288 QRectF bounds = mapFromItem(( *itemIter ), ( *itemIter )->rectWithFrame() ).boundingRect();
291 for ( ++itemIter; itemIter != selectedItems.end(); ++itemIter )
293 bounds = bounds.united( mapFromItem(( *itemIter ), ( *itemIter )->rectWithFrame() ).boundingRect() );
303 QList<QgsComposerItem*>::iterator itemIter = selectedItems.begin();
306 double firstItemRotation = ( *itemIter )->itemRotation();
309 for ( ++itemIter; itemIter != selectedItems.end(); ++itemIter )
311 if (( *itemIter )->itemRotation() != firstItemRotation )
319 rotation = firstItemRotation;
327 double viewScaleFactor =
graphicsView()->transform().m11();
330 double rectHandlerSize = 10.0 / viewScaleFactor;
333 if ( rectHandlerSize > ( rect().width() / 3 ) )
335 rectHandlerSize = rect().width() / 3;
337 if ( rectHandlerSize > ( rect().height() / 3 ) )
339 rectHandlerSize = rect().height() / 3;
341 return rectHandlerSize;
347 switch ( mouseAction )
350 return Qt::ForbiddenCursor;
352 return Qt::SizeAllCursor;
356 if (( rotation() <= 22.5 || rotation() >= 337.5 ) || ( rotation() >= 157.5 && rotation() <= 202.5 ) )
358 return Qt::SizeVerCursor;
360 else if (( rotation() >= 22.5 && rotation() <= 67.5 ) || ( rotation() >= 202.5 && rotation() <= 247.5 ) )
362 return Qt::SizeBDiagCursor;
364 else if (( rotation() >= 67.5 && rotation() <= 112.5 ) || ( rotation() >= 247.5 && rotation() <= 292.5 ) )
366 return Qt::SizeHorCursor;
370 return Qt::SizeFDiagCursor;
375 if (( rotation() <= 22.5 || rotation() >= 337.5 ) || ( rotation() >= 157.5 && rotation() <= 202.5 ) )
377 return Qt::SizeHorCursor;
379 else if (( rotation() >= 22.5 && rotation() <= 67.5 ) || ( rotation() >= 202.5 && rotation() <= 247.5 ) )
381 return Qt::SizeFDiagCursor;
383 else if (( rotation() >= 67.5 && rotation() <= 112.5 ) || ( rotation() >= 247.5 && rotation() <= 292.5 ) )
385 return Qt::SizeVerCursor;
389 return Qt::SizeBDiagCursor;
395 if (( rotation() <= 22.5 || rotation() >= 337.5 ) || ( rotation() >= 157.5 && rotation() <= 202.5 ) )
397 return Qt::SizeFDiagCursor;
399 else if (( rotation() >= 22.5 && rotation() <= 67.5 ) || ( rotation() >= 202.5 && rotation() <= 247.5 ) )
401 return Qt::SizeVerCursor;
403 else if (( rotation() >= 67.5 && rotation() <= 112.5 ) || ( rotation() >= 247.5 && rotation() <= 292.5 ) )
405 return Qt::SizeBDiagCursor;
409 return Qt::SizeHorCursor;
414 if (( rotation() <= 22.5 || rotation() >= 337.5 ) || ( rotation() >= 157.5 && rotation() <= 202.5 ) )
416 return Qt::SizeBDiagCursor;
418 else if (( rotation() >= 22.5 && rotation() <= 67.5 ) || ( rotation() >= 202.5 && rotation() <= 247.5 ) )
420 return Qt::SizeHorCursor;
422 else if (( rotation() >= 67.5 && rotation() <= 112.5 ) || ( rotation() >= 247.5 && rotation() <= 292.5 ) )
424 return Qt::SizeFDiagCursor;
428 return Qt::SizeVerCursor;
432 return Qt::ArrowCursor;
438 bool nearLeftBorder =
false;
439 bool nearRightBorder =
false;
440 bool nearLowerBorder =
false;
441 bool nearUpperBorder =
false;
443 bool withinWidth =
false;
444 bool withinHeight =
false;
445 if ( itemCoordPos.x() >= 0 && itemCoordPos.x() <= rect().width() )
449 if ( itemCoordPos.y() >= 0 && itemCoordPos.y() <= rect().height() )
456 if ( itemCoordPos.x() >= 0 && itemCoordPos.x() < borderTolerance )
458 nearLeftBorder =
true;
460 if ( itemCoordPos.y() >= 0 && itemCoordPos.y() < borderTolerance )
462 nearUpperBorder =
true;
464 if ( itemCoordPos.x() <= rect().width() && itemCoordPos.x() > ( rect().width() - borderTolerance ) )
466 nearRightBorder =
true;
468 if ( itemCoordPos.y() <= rect().height() && itemCoordPos.y() > ( rect().height() - borderTolerance ) )
470 nearLowerBorder =
true;
473 if ( nearLeftBorder && nearUpperBorder )
477 else if ( nearLeftBorder && nearLowerBorder )
481 else if ( nearRightBorder && nearUpperBorder )
485 else if ( nearRightBorder && nearLowerBorder )
489 else if ( nearLeftBorder && withinHeight )
493 else if ( nearRightBorder && withinHeight )
497 else if ( nearUpperBorder && withinWidth )
501 else if ( nearLowerBorder && withinWidth )
507 QPointF scenePoint = mapToScene( itemCoordPos );
508 QList<QGraphicsItem *> itemsAtCursorPos =
mComposition->items( scenePoint );
509 if ( itemsAtCursorPos.size() == 0 )
514 QList<QGraphicsItem*>::iterator itemIter = itemsAtCursorPos.begin();
515 for ( ; itemIter != itemsAtCursorPos.end(); ++itemIter )
532 QPointF itemPos = mapFromScene( sceneCoordPos );
560 bool shiftModifier =
false;
561 bool controlModifier =
false;
562 if ( event->modifiers() & Qt::ShiftModifier )
565 shiftModifier =
true;
567 if ( event->modifiers() & Qt::ControlModifier )
570 controlModifier =
true;
576 dragMouseMove( event->lastScenePos(), shiftModifier, controlModifier );
581 resizeMouseMove( event->lastScenePos(), shiftModifier, controlModifier );
589 QPointF mouseMoveStopPoint =
event->lastScenePos();
604 QUndoCommand* parentCommand =
new QUndoCommand(
tr(
"Change item position" ) );
606 QPointF mEndHandleMovePos = scenePos();
610 QList<QgsComposerItem*>::iterator itemIter = selectedItems.begin();
611 for ( ; itemIter != selectedItems.end(); ++itemIter )
613 if (( *itemIter )->positionLock() || (( *itemIter )->flags() & QGraphicsItem::ItemIsSelectable ) == 0 )
629 QUndoCommand* parentCommand =
new QUndoCommand(
tr(
"Change item size" ) );
633 QList<QgsComposerItem*>::iterator itemIter = selectedItems.begin();
634 for ( ; itemIter != selectedItems.end(); ++itemIter )
636 if (( *itemIter )->positionLock() || (( *itemIter )->flags() & QGraphicsItem::ItemIsSelectable ) == 0 )
645 if ( selectedItems.size() == 1 )
653 itemRect = mapRectFromItem(( *itemIter ), ( *itemIter )->rectWithFrame() );
657 itemRect = itemRect.normalized();
658 QPointF newPos = mapToScene( itemRect.topLeft() );
659 ( *itemIter )->setItemPosition( newPos.x(), newPos.y(), itemRect.width(), itemRect.height(),
QgsComposerItem::UpperLeft, true );
691 int selectedCount = selectedItems.size();
692 if ( selectedCount > 1 )
697 else if ( selectedCount == 1 )
751 QPointF sceneMousePos = mapFromScene( cursorPos );
757 return QSizeF( 0, sceneMousePos.y() );
760 return QSizeF( 0, sceneMousePos.y() - rect().height() );
764 return QSizeF( sceneMousePos.x(), 0 );
767 return QSizeF( sceneMousePos.x() - rect().width(), 0 );
771 return QSizeF( sceneMousePos.x(), sceneMousePos.y() );
774 return QSizeF( sceneMousePos.x() - rect().width(), sceneMousePos.y() - rect().height() );
777 return QSizeF( sceneMousePos.x() - rect().width(), sceneMousePos.y() );
780 return QSizeF( sceneMousePos.x(), sceneMousePos.y() - rect().height() );
783 return QSizeF( 0, 0 );
802 QPointF snappedLeftPoint;
804 if ( !preventSnap && rotation() == 0 )
812 snappedLeftPoint = upperLeftPoint;
824 if ( abs( moveRectX ) <= abs( moveRectY ) )
835 QTransform moveTransform;
836 moveTransform.translate( moveRectX, moveRectY );
837 setTransform( moveTransform );
850 double mx = 0.0, my = 0.0, rx = 0.0, ry = 0.0;
852 QPointF beginMousePos;
853 QPointF finalPosition;
854 if ( rotation() == 0 )
862 finalPosition = mapFromScene( snappedPosition );
868 finalPosition = mapFromScene( currentPosition );
871 double diffX = finalPosition.x() - beginMousePos.x();
872 double diffY = finalPosition.y() - beginMousePos.y();
888 mx = -diffX / 2; my = diffY; rx = diffX; ry = -diffY;
892 mx = 0; my = diffY; rx = 0; ry = -diffY;
902 mx = -diffX / 2; my = 0; rx = diffX; ry = diffY;
906 mx = 0; my = 0; rx = 0; ry = diffY;
917 mx = diffX; my = -diffY / 2; rx = -diffX; ry = diffY;
921 mx = diffX, my = 0; rx = -diffX; ry = 0;
931 mx = 0; my = -diffY / 2; rx = diffX; ry = diffY;
935 mx = 0; my = 0; rx = diffX, ry = 0;
955 mx = diffX, my = diffY; rx = -diffX; ry = -diffY;
973 mx = 0; my = 0; rx = diffX, ry = diffY;
991 mx = 0; my = diffY, rx = diffX, ry = -diffY;
1009 mx = diffX, my = 0; rx = -diffX; ry = diffY;
1036 translateLine.setAngle( translateLine.angle() - rotation() );
1037 QPointF sceneTranslate = translateLine.p2();
1040 QTransform itemTransform;
1041 itemTransform.translate( sceneTranslate.x(), sceneTranslate.y() );
1042 setTransform( itemTransform );
1073 if ( snappedPoint != point )
1076 return snappedPoint;
1092 snappedPoint =
alignItem( alignX, alignY, point.x(), point.y() );
1095 snappedPoint =
alignPos( point, alignX, alignY );
1103 double yLineCoord = 300;
1108 item->setLine( QLineF( alignX, 0, alignX, yLineCoord ) );
1125 return snappedPoint;
1180 double left = unalignedX;
1181 double right = left + rect().width();
1182 double midH = ( left + right ) / 2.0;
1183 double top = unalignedY;
1184 double bottom = top + rect().height();
1185 double midV = ( top + bottom ) / 2.0;
1187 QMap<double, const QgsComposerItem* > xAlignCoordinates;
1188 QMap<double, const QgsComposerItem* > yAlignCoordinates;
1192 double xItemLeft = left;
1193 double xAlignCoord = 0;
1194 double smallestDiffX = DBL_MAX;
1196 checkNearestItem( left, xAlignCoordinates, smallestDiffX, 0, xItemLeft, xAlignCoord );
1197 checkNearestItem( midH, xAlignCoordinates, smallestDiffX, ( left - right ) / 2.0, xItemLeft, xAlignCoord );
1198 checkNearestItem( right, xAlignCoordinates, smallestDiffX, left - right, xItemLeft, xAlignCoord );
1201 double yItemTop = top;
1202 double yAlignCoord = 0;
1203 double smallestDiffY = DBL_MAX;
1205 checkNearestItem( top, yAlignCoordinates, smallestDiffY, 0, yItemTop, yAlignCoord );
1206 checkNearestItem( midV, yAlignCoordinates, smallestDiffY, ( top - bottom ) / 2.0, yItemTop, yAlignCoord );
1207 checkNearestItem( bottom, yAlignCoordinates, smallestDiffY, top - bottom, yItemTop, yAlignCoord );
1209 double xCoord = ( smallestDiffX < 5 ) ? xItemLeft : unalignedX;
1210 alignX = ( smallestDiffX < 5 ) ? xAlignCoord : -1;
1211 double yCoord = ( smallestDiffY < 5 ) ? yItemTop : unalignedY;
1212 alignY = ( smallestDiffY < 5 ) ? yAlignCoord : -1;
1213 return QPointF( xCoord, yCoord );
1218 QMap<double, const QgsComposerItem* > xAlignCoordinates;
1219 QMap<double, const QgsComposerItem* > yAlignCoordinates;
1222 double nearestX = pos.x();
1223 double nearestY = pos.y();
1224 if ( !
nearestItem( xAlignCoordinates, pos.x(), nearestX )
1225 || !
nearestItem( yAlignCoordinates, pos.y(), nearestY ) )
1232 QPointF result( pos.x(), pos.y() );
1235 result.setX( nearestX );
1245 result.setY( nearestY );
1257 alignCoordsX.clear();
1258 alignCoordsY.clear();
1262 QList<QGraphicsItem *> itemList =
mComposition->items();
1263 QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
1264 for ( ; itemIt != itemList.end(); ++itemIt )
1268 if ( !currentItem || currentItem->
selected() )
1273 if ( dynamic_cast<const QgsPaperItem *>( *itemIt ) )
1277 itemRect = currentItem->rect();
1281 itemRect = currentItem->mapRectToScene( currentItem->
rectWithFrame() );
1283 alignCoordsX.insert( itemRect.left(), currentItem );
1284 alignCoordsX.insert( itemRect.right(), currentItem );
1285 alignCoordsX.insert( itemRect.center().x(), currentItem );
1286 alignCoordsY.insert( itemRect.top(), currentItem );
1287 alignCoordsY.insert( itemRect.center().y(), currentItem );
1288 alignCoordsY.insert( itemRect.bottom(), currentItem );
1298 double x = ( *sIt )->line().x1();
1299 double y = ( *sIt )->line().y1();
1302 alignCoordsX.insert( x, 0 );
1306 alignCoordsY.insert( y, 0 );
1314 double currentCoord = 0;
1315 if ( !
nearestItem( alignCoords, checkCoord, currentCoord ) )
1320 double currentDiff = abs( checkCoord - currentCoord );
1321 if ( currentDiff < mComposition->alignmentSnapTolerance() && currentDiff < smallestDiff )
1323 itemCoord = currentCoord + itemCoordOffset;
1324 alignCoord = currentCoord;
1325 smallestDiff = currentDiff;
1331 if ( coords.size() < 1 )
1336 QMap< double, const QgsComposerItem* >::const_iterator it = coords.lowerBound( value );
1337 if ( it == coords.constBegin() )
1339 nearestValue = it.key();
1342 else if ( it == coords.constEnd() )
1345 nearestValue = it.key();
1351 double upperVal = it.key();
1353 double lowerVal = it.key();
1355 double lowerDiff = value - lowerVal;
1356 double upperDiff = upperVal - value;
1357 if ( lowerDiff < upperDiff )
1359 nearestValue = lowerVal;
1364 nearestValue = upperVal;
QGraphicsLineItem * hAlignSnapItem()
Return horizontal align snap item.
QUndoStack * undoStack()
Returns pointer to undo/redo command storage.
double alignmentSnapTolerance() const
QgsComposition * mComposition
double paperWidth() const
Returns width of paper item.
bool mIsDragging
True if user is currently dragging items.
void drawHandles(QPainter *painter, double rectHandlerSize)
Draws the handles.
QPointF mLastMouseEventPos
Position of the last mouse move event (in scene coordinates)
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
QPointF alignPos(const QPointF &pos, double &alignX, double &alignY)
Snaps a point to to the grid or align rulers.
void updateHandles()
Redraws or hides the handles based on the current selection.
Qt::CursorShape cursorForPosition(const QPointF &itemCoordPos)
Finds out the appropriate cursor for the current mouse position in the widget (e.g.
void selectedItemRotationChanged()
Redraws handles when selected item rotation changes.
virtual bool selected() const
Is selected.
QGraphicsView * graphicsView()
bool smartGuidesEnabled() const
A item that forms part of a map composition.
bool preventCursorChange()
QGraphicsLineItem * mVAlignSnapItem
QPointF snapPointToGrid(const QPointF &scenePoint) const
Snaps a scene coordinate point to grid.
void savePreviousState()
Saves current item state as previous state.
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.
void selectedItemSizeChanged()
Redraws handles when selected item size changes.
virtual ~QgsComposerMouseHandles()
double spaceBetweenPages() const
bool alignmentSnap() const
void setStatusMessage(const QString &message)
Sets the status bar message for the composer window.
int numPages() const
Note: added in version 1.9.
QPointF mMouseMoveStartPos
Start point of the last mouse move action (in scene coordinates)
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
void setViewportCursor(Qt::CursorShape cursor)
double rectHandlerBorderTolerance()
Returns the current (zoom level dependent) tolerance to decide if mouse position is close enough to t...
void mousePressEvent(QGraphicsSceneMouseEvent *event)
QgsComposerMouseHandles::MouseAction mouseActionForPosition(const QPointF &itemCoordPos)
Finds out which mouse move action to choose depending on the cursor position inside the widget...
QRectF selectionBounds() const
Returns the mouse handle bounds of current selection.
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void resizeMouseMove(const QPointF ¤tPosition, bool lockAspect, bool fromCenter)
Handles resizing of items during mouse move.
bool nearestItem(const QMap< double, const QgsComposerItem * > &coords, double value, double &nearestValue) const
void drawSelectedItemBounds(QPainter *painter)
Draw outlines for selected items.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget)
void selectionChanged()
Sets up listeners to sizeChanged signal for all selected items.
Graphics scene for map printing.
double mBeginHandleHeight
void collectAlignCoordinates(QMap< double, const QgsComposerItem * > &alignCoordsX, QMap< double, const QgsComposerItem * > &alignCoordsY)
QGraphicsLineItem * vAlignSnapItem()
Return vertical align snap item.
virtual QRectF rectWithFrame() const
Returns the item's rectangular bounds, including any bleed caused by the item's frame.
void saveAfterState()
Saves current item state as after state.
void hoverMoveEvent(QGraphicsSceneHoverEvent *event)
QGraphicsLineItem * mHAlignSnapItem
Align snap lines.
void deleteVAlignSnapItem()
QPointF snapPoint(const QPointF &originalPoint, QgsComposerMouseHandles::SnapGuideMode mode)
Snaps an item or point (depending on mode) originating at originalPoint to the grid or align rulers...
QgsComposition * composition()
Undo command to undo/redo all composer item related changes.
QPointF mBeginMouseEventPos
Position of the mouse at beginning of move/resize (in scene coordinates)
QgsComposerMouseHandles::MouseAction mCurrentMouseMoveAction
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void dragMouseMove(const QPointF ¤tPosition, bool lockMovement, bool preventSnap)
Handles dragging of items during mouse move.
static QgsProject * instance()
access to canonical QgsProject instance
QPointF mBeginHandlePos
Position of composer handles at beginning of move/resize (in scene coordinates)
double paperHeight() const
Returns height of paper item.
QSizeF calcCursorEdgeOffset(const QPointF &cursorPos)
Calculates the distance of the mouse cursor from thed edge of the mouse handles.
static void relativeResizeRect(QRectF &rectToResize, const QRectF &boundsBefore, const QRectF &boundsAfter)
Resizes a QRectF relative to the change from boundsBefore to boundsAfter.
void deleteHAlignSnapItem()
double ANALYSIS_EXPORT min(double x, double y)
returns the minimum of two doubles or the first argument if both are equal
QGraphicsView * mGraphicsView
QgsComposerMouseHandles(QgsComposition *composition)
QgsComposition::PlotStyle plotStyle() const
QList< QgsComposerItem * > selectedComposerItems()
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
QgsComposerMouseHandles::MouseAction mouseActionForScenePos(const QPointF &sceneCoordPos)
Finds out which mouse move action to choose depending on the scene cursor position.
QPointF alignItem(double &alignX, double &alignY, double unalignedX, double unalignedY)
Snaps an item originating at unalignedX, unalignedY to the grid or align rulers.
bool selectionRotation(double &rotation) const
Returns true if all selected items have same rotation, and if so, updates passed rotation variable...
void checkNearestItem(double checkCoord, const QMap< double, const QgsComposerItem * > &alignCoords, double &smallestDiff, double itemCoordOffset, double &itemCoord, double &alignCoord) const
bool mIsResizing
True is user is currently resizing items.
QList< QGraphicsLineItem * > * snapLines()
Returns pointer to snap lines collection.