Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Aleksei Kanash 12 years ago
commit af428a3e98
  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;
@ -749,6 +753,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;
static bool hasSelectedParents(QGraphicsItem * item);

Loading…
Cancel
Save