@ -545,7 +545,6 @@ Here we determines cases when items should to get mouse press event at pressing
break ;
// Groups shouldn't reacts on any presses and moves for Play tool.
case UBGraphicsStrokesGroup : : Type :
case UBGraphicsGroupContainerItem : : Type :
if ( currentTool = = UBStylusTool : : Play )
{
@ -631,7 +630,7 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item)
case UBGraphicsGroupContainerItem : : Type :
return true ;
case UBGraphicsW3CW idgetItem : : Type :
case UBGraphicsWidgetItem : : Type :
if ( currentTool = = UBStylusTool : : Selector & & item - > isSelected ( ) )
return false ;
if ( currentTool = = UBStylusTool : : Play )
@ -657,10 +656,6 @@ QGraphicsItem* UBBoardView::determineItemToPress(QGraphicsItem *item)
if ( item )
{
UBStylusTool : : Enum currentTool = ( UBStylusTool : : Enum ) UBDrawingController : : drawingController ( ) - > stylusTool ( ) ;
// groups should should be moved instead of strokes groups
if ( item - > parentItem ( ) & & UBGraphicsStrokesGroup : : Type = = item - > type ( ) )
return item - > parentItem ( ) ;
// if item is on group and group is not selected - group should take press.
if ( UBStylusTool : : Selector = = currentTool
@ -685,7 +680,7 @@ QGraphicsItem* UBBoardView::determineItemToMove(QGraphicsItem *item)
UBStylusTool : : Enum currentTool = ( UBStylusTool : : Enum ) UBDrawingController : : drawingController ( ) - > stylusTool ( ) ;
//W3C widgets should take mouse move events from play tool.
if ( ( UBStylusTool : : Play = = currentTool ) & & ( UBGraphicsW3CW idgetItem : : Type = = item - > type ( ) ) )
if ( ( UBStylusTool : : Play = = currentTool ) & & ( UBGraphicsWidgetItem : : Type = = item - > type ( ) ) )
return item ;
// if item is in group
@ -754,6 +749,9 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
void UBBoardView : : handleItemMouseMove ( QMouseEvent * event )
{
if ( ! movingItem )
return ;
// determine item to move (maybee we need to move group of item or his parent.
movingItem = determineItemToMove ( movingItem ) ;