Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
000f1a9c
Commit
000f1a9c
authored
Jul 19, 2013
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rerouted signal event if marker pressure is active
parent
3c341462
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
16 deletions
+29
-16
UBBoardView.cpp
src/board/UBBoardView.cpp
+29
-15
UBBoardView.h
src/board/UBBoardView.h
+0
-1
No files found.
src/board/UBBoardView.cpp
View file @
000f1a9c
...
...
@@ -349,18 +349,17 @@ void UBBoardView::tabletEvent (QTabletEvent * event)
}
}
// if event are not Pen events, we drop the tablet stuff and route everything through mouse event
if
(
currentTool
!=
UBStylusTool
::
Pen
&&
currentTool
!=
UBStylusTool
::
Line
&&
currentTool
!=
UBStylusTool
::
Marker
&&
!
mMarkerPressureSensitive
){
event
->
setAccepted
(
false
);
return
;
}
QPointF
scenePos
=
viewportTransform
().
inverted
().
map
(
tabletPos
);
qreal
pressure
=
1.0
;
if
(((
currentTool
==
UBStylusTool
::
Pen
||
currentTool
==
UBStylusTool
::
Line
)
&&
mPenPressureSensitive
)
||
(
currentTool
==
UBStylusTool
::
Marker
&&
mMarkerPressureSensitive
))
if
(((
currentTool
==
UBStylusTool
::
Pen
||
currentTool
==
UBStylusTool
::
Line
)
&&
mPenPressureSensitive
)
||
(
currentTool
==
UBStylusTool
::
Marker
&&
mMarkerPressureSensitive
))
pressure
=
event
->
pressure
();
else
{
//Explanation: rerouting to mouse event
event
->
setAccepted
(
false
);
return
;
}
bool
acceptEvent
=
true
;
#ifdef Q_WS_MAC
...
...
@@ -534,18 +533,28 @@ Here we determines cases when items should to get mouse press event at pressing
case
UBGraphicsTriangle
:
:
Type
:
case
UBGraphicsCompass
:
:
Type
:
case
UBGraphicsCache
:
:
Type
:
return
true
;
case
UBGraphicsDelegateFrame
:
:
Type
:
if
(
currentTool
==
UBStylusTool
::
Play
)
return
false
;
return
true
;
case
UBGraphicsPixmapItem
:
:
Type
:
case
UBGraphicsSvgItem
:
:
Type
:
if
(
currentTool
==
UBStylusTool
::
Play
)
return
true
;
if
(
item
->
isSelected
())
return
true
;
else
return
false
;
case
DelegateButton
:
:
Type
:
return
true
;
case
UBGraphicsMediaItem
:
:
Type
:
return
false
;
case
UBGraphicsSvgItem
:
:
Type
:
case
UBGraphicsPixmapItem
:
:
Type
:
case
UBGraphicsTextItem
:
:
Type
:
if
(
currentTool
==
UBStylusTool
::
Play
)
return
fals
e
;
return
tru
e
;
if
((
currentTool
==
UBStylusTool
::
Selector
)
&&
item
->
isSelected
())
return
true
;
if
((
currentTool
==
UBStylusTool
::
Selector
)
&&
item
->
parentItem
()
&&
item
->
parentItem
()
->
isSelected
())
...
...
@@ -553,8 +562,13 @@ Here we determines cases when items should to get mouse press event at pressing
if
(
currentTool
!=
UBStylusTool
::
Selector
)
return
false
;
break
;
case
UBGraphicsGroupContainerItem
:
:
Type
:
case
UBGraphicsItemType
:
:
StrokeItemType
:
if
(
currentTool
==
UBStylusTool
::
Play
)
return
true
;
break
;
// Groups shouldn't reacts on any presses and moves for Play tool.
case
UBGraphicsGroupContainerItem
:
:
Type
:
if
(
currentTool
==
UBStylusTool
::
Play
)
{
movingItem
=
NULL
;
...
...
@@ -594,6 +608,7 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item)
case
QGraphicsWebView
:
:
Type
:
return
false
;
case
UBGraphicsPixmapItem
:
:
Type
:
case
UBGraphicsSvgItem
:
:
Type
:
case
UBGraphicsTextItem
:
:
Type
:
case
UBGraphicsWidgetItem
:
:
Type
:
if
(
currentTool
==
UBStylusTool
::
Selector
&&
!
item
->
isSelected
()
&&
item
->
parentItem
())
...
...
@@ -644,6 +659,8 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item)
case
UBGraphicsSvgItem
:
:
Type
:
case
UBGraphicsPixmapItem
:
:
Type
:
if
(
currentTool
==
UBStylusTool
::
Play
||
!
item
->
isSelected
())
return
true
;
if
(
item
->
isSelected
())
return
false
;
case
UBGraphicsMediaItem
:
:
Type
:
...
...
@@ -943,9 +960,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
mMouseDownPos
=
event
->
pos
();
movingItem
=
scene
()
->
itemAt
(
this
->
mapToScene
(
event
->
posF
().
toPoint
()));
if
(
!
movingItem
)
emit
clickOnBoard
();
if
(
event
->
button
()
==
Qt
::
LeftButton
&&
isInteractive
())
{
int
currentTool
=
(
UBStylusTool
::
Enum
)
UBDrawingController
::
drawingController
()
->
stylusTool
();
...
...
src/board/UBBoardView.h
View file @
000f1a9c
...
...
@@ -63,7 +63,6 @@ public:
signals
:
void
resized
(
QResizeEvent
*
event
);
void
shown
();
void
clickOnBoard
();
void
mouseReleased
();
protected
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment