Skip to content
Browse files

[FEATURE] Allow multi item drag and resize in composer (fix #7918)

[FEATURE] Always draw selection handles on top of composition, add dashed border for selected items (fix #7793)
Move responsibility for drawing selection mouse handles and mouse interaction with selection to new class
  • Loading branch information
nyalldawson authored and mhugent committed Sep 17, 2013
1 parent 7bc72d4 commit 24d110606c9fa58e57feed337dd2ded0af4eaa8f
@@ -332,10 +332,6 @@ class QgsComposerItem: QObject, QGraphicsRectItem
@note this method was added in version 1.2*/
bool positionLock() const;

/**Update mouse cursor at (item) position
@note this method was added in version 1.2*/
void updateCursor( const QPointF& itemPos );

double rotation() const;

/**Updates item, with the possibility to do custom update for subclasses*/
@@ -367,22 +363,6 @@ class QgsComposerItem: QObject, QGraphicsRectItem

virtual void hoverMoveEvent( QGraphicsSceneHoverEvent * event );

/**Finds out the appropriate cursor for the current mouse position in the widget (e.g. move in the middle, resize at border)*/
Qt::CursorShape cursorForPosition( const QPointF& itemCoordPos );

/**Finds out which mouse move action to choose depending on the cursor position inside the widget*/
QgsComposerItem::MouseMoveAction mouseMoveActionForPosition( const QPointF& itemCoordPos );

/**Changes the rectangle of an item depending on current mouse action (resize or move)
@param currentPosition current position of mouse cursor
@param mouseMoveStartPos cursor position at the start of the current mouse action
@param originalItem Item position at the start of the mouse action
@param dx x-Change of mouse cursor
@param dy y-Change of mouse cursor
@param changeItem Item to change size (can be the same as originalItem or a differen one)
void changeItemRectangle( const QPointF& currentPosition, const QPointF& mouseMoveStartPos, const QGraphicsRectItem* originalItem, double dx, double dy, QGraphicsRectItem* changeItem );

/**Draw selection boxes around item*/
virtual void drawSelectionBoxes( QPainter* p );

@@ -213,23 +213,6 @@ class QgsComposition : QGraphicsScene
/**Snaps a scene coordinate point to grid*/
QPointF snapPointToGrid( const QPointF& scenePoint ) const;

/**Snaps item position to align with other items (left / middle / right or top / middle / bottom
@param item current item
@param alignX x-coordinate of align or -1 if not aligned to x
@param alignY y-coordinate of align or -1 if not aligned to y
@param dx item shift in x direction
@param dy item shift in y direction
@return new upper left point after the align*/
QPointF alignItem( const QgsComposerItem* item, double& alignX, double& alignY, double dx = 0, double dy = 0 );

/**Snaps position to align with the boundaries of other items
@param pos position to snap
@param excludeItem item to exclude
@param alignX snapped x coordinate or -1 if not snapped
@param alignY snapped y coordinate or -1 if not snapped
@return snapped position or original position if no snap*/
QPointF alignPos( const QPointF& pos, const QgsComposerItem* excludeItem, double& alignX, double& alignY );

/**Add a custom snap line (can be horizontal or vertical)*/
QGraphicsLineItem* addSnapLine();
/**Remove custom snap line (and delete the object)*/
@@ -133,6 +133,7 @@ SET(QGIS_CORE_SRCS
@@ -324,6 +325,7 @@ SET(QGIS_CORE_MOC_HDRS

0 comments on commit 24d1106

Please sign in to comment.
You can’t perform that action at this time.