Sankore-1027 fixed extended view behaviour

preferencesAboutTextFull
Ilia Ryabokon 13 years ago
parent 370e5b37d0
commit 68a1b88a79
  1. 2
      src/board/UBBoardController.cpp
  2. 13
      src/board/UBBoardView.cpp
  3. 5
      src/board/UBBoardView.h

@ -158,7 +158,7 @@ void UBBoardController::setupViews()
mControlLayout = new QHBoxLayout(mControlContainer);
mControlLayout->setContentsMargins(0, 0, 0, 0);
mControlView = new UBBoardView(this, mControlContainer);
mControlView = new UBBoardView(this, mControlContainer, true);
mControlView->setInteractive(true);
mControlView->setMouseTracking(true);

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

@ -31,8 +31,8 @@ class UBBoardView : public QGraphicsView
public:
UBBoardView(UBBoardController* pController, QWidget* pParent = 0);
UBBoardView(UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent = 0);
UBBoardView(UBBoardController* pController, QWidget* pParent = 0, bool pIsControl = false);
UBBoardView(UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent = 0, bool pIscontrol = false);
virtual ~UBBoardView();
UBGraphicsScene* scene();
@ -147,6 +147,7 @@ class UBBoardView : public QGraphicsView
bool mIsDragInProgress;
bool mMultipleSelectionIsEnabled;
bool isControl;
private slots:

Loading…
Cancel
Save