|
|
@ -62,7 +62,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "core/memcheck.h" |
|
|
|
#include "core/memcheck.h" |
|
|
|
|
|
|
|
|
|
|
|
UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent) |
|
|
|
UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool pIsControl) |
|
|
|
: QGraphicsView (pParent) |
|
|
|
: QGraphicsView (pParent) |
|
|
|
, mController (pController) |
|
|
|
, mController (pController) |
|
|
|
, mIsCreatingTextZone (false) |
|
|
|
, mIsCreatingTextZone (false) |
|
|
@ -72,6 +72,7 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent) |
|
|
|
, mLongPressInterval(1000) |
|
|
|
, mLongPressInterval(1000) |
|
|
|
, mIsDragInProgress(false) |
|
|
|
, mIsDragInProgress(false) |
|
|
|
, mMultipleSelectionIsEnabled(false) |
|
|
|
, mMultipleSelectionIsEnabled(false) |
|
|
|
|
|
|
|
, isControl(pIsControl) |
|
|
|
{ |
|
|
|
{ |
|
|
|
init (); |
|
|
|
init (); |
|
|
|
|
|
|
|
|
|
|
@ -81,13 +82,14 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent) |
|
|
|
mLongPressTimer.setSingleShot(true); |
|
|
|
mLongPressTimer.setSingleShot(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBBoardView::UBBoardView (UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent) |
|
|
|
UBBoardView::UBBoardView (UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent, bool pIscontrol) |
|
|
|
: 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) |
|
|
|
{ |
|
|
|
{ |
|
|
|
init (); |
|
|
|
init (); |
|
|
|
|
|
|
|
|
|
|
@ -124,6 +126,8 @@ void UBBoardView::init () |
|
|
|
setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff); |
|
|
|
setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff); |
|
|
|
setAcceptDrops (true); |
|
|
|
setAcceptDrops (true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setOptimizationFlag (QGraphicsView::IndirectPainting); // enable UBBoardView::drawItems filter
|
|
|
|
|
|
|
|
|
|
|
|
mTabletStylusIsPressed = false; |
|
|
|
mTabletStylusIsPressed = false; |
|
|
|
mMouseButtonIsPressed = false; |
|
|
|
mMouseButtonIsPressed = false; |
|
|
|
mPendingStylusReleaseEvent = false; |
|
|
|
mPendingStylusReleaseEvent = false; |
|
|
@ -749,6 +753,11 @@ void UBBoardView::longPressEvent() |
|
|
|
|
|
|
|
|
|
|
|
void UBBoardView::mousePressEvent (QMouseEvent *event) |
|
|
|
void UBBoardView::mousePressEvent (QMouseEvent *event) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (!isControl) { |
|
|
|
|
|
|
|
event->ignore(); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mIsDragInProgress = false; |
|
|
|
mIsDragInProgress = false; |
|
|
|
|
|
|
|
|
|
|
|
if (isAbsurdPoint (event->pos ())) |
|
|
|
if (isAbsurdPoint (event->pos ())) |
|
|
|