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 = new QHBoxLayout(mControlContainer);
mControlLayout->setContentsMargins(0, 0, 0, 0); mControlLayout->setContentsMargins(0, 0, 0, 0);
mControlView = new UBBoardView(this, mControlContainer); mControlView = new UBBoardView(this, mControlContainer, true);
mControlView->setInteractive(true); mControlView->setInteractive(true);
mControlView->setMouseTracking(true); mControlView->setMouseTracking(true);

@ -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 ()))

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

Loading…
Cancel
Save