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
2c701581
Commit
2c701581
authored
Jul 10, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SANKORE-97 Delete an object with keyboard
SANKORE-477 Erasing an object with the keyboard
parent
278fa7da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
17 deletions
+33
-17
UBBoardView.cpp
src/board/UBBoardView.cpp
+30
-17
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+3
-0
No files found.
src/board/UBBoardView.cpp
View file @
2c701581
...
...
@@ -481,9 +481,9 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item)
case
UBGraphicsPixmapItem
:
:
Type
:
case
UBGraphicsTextItem
:
:
Type
:
case
UBGraphicsW3CWidgetItem
:
:
Type
:
if
(
currentTool
!=
UBStylusTool
::
Play
&&
!
item
->
isSelected
()
&&
item
->
parentItem
())
if
(
currentTool
==
UBStylusTool
::
Selector
&&
!
item
->
isSelected
()
&&
item
->
parentItem
())
return
true
;
if
(
currentTool
!=
UBStylusTool
::
Play
&&
!
item
->
isSelected
())
if
(
currentTool
==
UBStylusTool
::
Selector
&&
item
->
isSelected
())
return
true
;
break
;
...
...
@@ -580,11 +580,20 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
if
(
itemShouldReceiveMousePressEvent
(
movingItem
))
QGraphicsView
::
mousePressEvent
(
event
);
else
if
(
itemShouldReceiveSuspendedMousePressEvent
(
movingItem
))
{
if
(
movingItem
)
movingItem
->
clearFocus
();
if
(
suspendedMousePressEvent
)
{
delete
suspendedMousePressEvent
;
suspendedMousePressEvent
=
new
QMouseEvent
(
event
->
type
(),
event
->
pos
(),
event
->
button
(),
event
->
buttons
(),
event
->
modifiers
());
suspendedMousePressEvent
=
NULL
;
}
if
(
itemShouldReceiveSuspendedMousePressEvent
(
movingItem
))
{
suspendedMousePressEvent
=
new
QMouseEvent
(
event
->
type
(),
event
->
pos
(),
event
->
button
(),
event
->
buttons
(),
event
->
modifiers
());
}
}
}
...
...
@@ -917,30 +926,34 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
scene
()
->
inputDeviceRelease
();
if
(
currentTool
==
UBStylusTool
::
Selector
)
{
{
if
(
mWidgetMoved
)
{
mWidgetMoved
=
false
;
movingItem
=
NULL
;
}
else
if
(
movingItem
)
{
if
(
suspendedMousePressEvent
&&
!
movingItem
->
data
(
UBGraphicsItemData
::
ItemLocked
).
toBool
())
{
QGraphicsView
::
mousePressEvent
(
suspendedMousePressEvent
);
// suspendedMousePressEvent is deleted by old Qt event loop
movingItem
=
NULL
;
delete
suspendedMousePressEvent
;
suspendedMousePressEvent
=
NULL
;
}
if
(
movingItem
)
{
if
(
suspendedMousePressEvent
&&
!
movingItem
->
data
(
UBGraphicsItemData
::
ItemLocked
).
toBool
())
{
QGraphicsView
::
mousePressEvent
(
suspendedMousePressEvent
);
// suspendedMousePressEvent is deleted by old Qt event loop
movingItem
=
NULL
;
delete
suspendedMousePressEvent
;
suspendedMousePressEvent
=
NULL
;
}
else
{
movingItem
->
setSelected
(
true
);
}
}
if
(
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
mUBRubberBand
->
hide
();
if
(
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
mUBRubberBand
->
hide
();
}
QGraphicsView
::
mouseReleaseEvent
(
event
);
}
}
else
if
(
currentTool
==
UBStylusTool
::
Play
)
{
if
(
mWidgetMoved
)
...
...
src/domain/UBGraphicsScene.cpp
View file @
2c701581
...
...
@@ -43,6 +43,7 @@
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "board/UBBoardView.h"
#include "UBGraphicsItemUndoCommand.h"
#include "UBGraphicsTextItemUndoCommand.h"
...
...
@@ -1453,6 +1454,8 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
{
UBApplication
::
boardController
->
moveGraphicsWidgetToControlView
(
graphicsWidget
);
}
UBApplication
::
boardController
->
controlView
()
->
setFocus
();
}
UBGraphicsW3CWidgetItem
*
UBGraphicsScene
::
addOEmbed
(
const
QUrl
&
pContentUrl
,
const
QPointF
&
pPos
)
...
...
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