@ -65,7 +65,7 @@
# include "core/memcheck.h"
# include "core/memcheck.h"
UBBoardView : : UBBoardView ( UBBoardController * pController , QWidget * pParent , bool pIsControl )
UBBoardView : : UBBoardView ( UBBoardController * pController , QWidget * pParent , bool isControl , bool isDesktop )
: QGraphicsView ( pParent )
: QGraphicsView ( pParent )
, mController ( pController )
, mController ( pController )
, mIsCreatingTextZone ( false )
, mIsCreatingTextZone ( false )
@ -75,7 +75,8 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool
, mLongPressInterval ( 1000 )
, mLongPressInterval ( 1000 )
, mIsDragInProgress ( false )
, mIsDragInProgress ( false )
, mMultipleSelectionIsEnabled ( false )
, mMultipleSelectionIsEnabled ( false )
, isControl ( pIsControl )
, bIsControl ( isControl )
, bIsDesktop ( isDesktop )
, mRubberBandInPlayMode ( false ) //enables rubberband with play tool
, mRubberBandInPlayMode ( false ) //enables rubberband with play tool
{
{
init ( ) ;
init ( ) ;
@ -86,14 +87,15 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool
mLongPressTimer . setSingleShot ( true ) ;
mLongPressTimer . setSingleShot ( true ) ;
}
}
UBBoardView : : UBBoardView ( UBBoardController * pController , int pStartLayer , int pEndLayer , QWidget * pParent , bool pIscontrol )
UBBoardView : : UBBoardView ( UBBoardController * pController , int pStartLayer , int pEndLayer , QWidget * pParent , bool isControl , bool isDesktop )
: QGraphicsView ( pParent )
: QGraphicsView ( pParent )
, mController ( pController )
, mController ( pController )
, suspendedMousePressEvent ( NULL )
, suspendedMousePressEvent ( NULL )
, mLongPressInterval ( 1000 )
, mLongPressInterval ( 1000 )
, mIsDragInProgress ( false )
, mIsDragInProgress ( false )
, mMultipleSelectionIsEnabled ( false )
, mMultipleSelectionIsEnabled ( false )
, isControl ( pIscontrol )
, bIsControl ( isControl )
, bIsDesktop ( isDesktop )
{
{
init ( ) ;
init ( ) ;
@ -850,7 +852,7 @@ void UBBoardView::longPressEvent()
void UBBoardView : : mousePressEvent ( QMouseEvent * event )
void UBBoardView : : mousePressEvent ( QMouseEvent * event )
{
{
if ( ! isControl ) {
if ( ! bIsControl & & ! bIsDesktop ) {
event - > ignore ( ) ;
event - > ignore ( ) ;
return ;
return ;
}
}
@ -896,6 +898,10 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
}
}
else if ( currentTool = = UBStylusTool : : Selector | | currentTool = = UBStylusTool : : Play )
else if ( currentTool = = UBStylusTool : : Selector | | currentTool = = UBStylusTool : : Play )
{
{
if ( bIsDesktop ) {
event - > ignore ( ) ;
return ;
}
connect ( & mLongPressTimer , SIGNAL ( timeout ( ) ) , this , SLOT ( longPressEvent ( ) ) ) ;
connect ( & mLongPressTimer , SIGNAL ( timeout ( ) ) , this , SLOT ( longPressEvent ( ) ) ) ;
if ( ! movingItem & & ! mController - > cacheIsVisible ( ) )
if ( ! movingItem & & ! mController - > cacheIsVisible ( ) )
mLongPressTimer . start ( ) ;
mLongPressTimer . start ( ) ;
@ -1017,6 +1023,11 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
return ;
return ;
}
}
if ( bIsDesktop ) {
event - > ignore ( ) ;
return ;
}
if ( currentTool ! = UBStylusTool : : Play | | mRubberBandInPlayMode ) {
if ( currentTool ! = UBStylusTool : : Play | | mRubberBandInPlayMode ) {
if ( ! movingItem & & ( mMouseButtonIsPressed | | mTabletStylusIsPressed ) & & mUBRubberBand & & mUBRubberBand - > isVisible ( ) ) {
if ( ! movingItem & & ( mMouseButtonIsPressed | | mTabletStylusIsPressed ) & & mUBRubberBand & & mUBRubberBand - > isVisible ( ) ) {
@ -1099,6 +1110,11 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
if ( currentTool = = UBStylusTool : : Selector )
if ( currentTool = = UBStylusTool : : Selector )
{
{
if ( bIsDesktop ) {
event - > ignore ( ) ;
return ;
}
bool bReleaseIsNeed = true ;
bool bReleaseIsNeed = true ;
if ( movingItem ! = determineItemToPress ( scene ( ) - > itemAt ( this - > mapToScene ( event - > posF ( ) . toPoint ( ) ) ) ) )
if ( movingItem ! = determineItemToPress ( scene ( ) - > itemAt ( this - > mapToScene ( event - > posF ( ) . toPoint ( ) ) ) ) )
{
{
@ -1161,6 +1177,11 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
}
}
else if ( currentTool = = UBStylusTool : : Play )
else if ( currentTool = = UBStylusTool : : Play )
{
{
if ( bIsDesktop ) {
event - > ignore ( ) ;
return ;
}
if ( mWidgetMoved )
if ( mWidgetMoved )
{
{
movingItem = NULL ;
movingItem = NULL ;