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
4772233b
Commit
4772233b
authored
Aug 27, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed multiple selection for stokes and for groups (if click on w3c).
parent
d5a20e6d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
UBBoardView.cpp
src/board/UBBoardView.cpp
+14
-12
No files found.
src/board/UBBoardView.cpp
View file @
4772233b
...
@@ -524,14 +524,13 @@ Here we determines cases when items should to get mouse press event at pressing
...
@@ -524,14 +524,13 @@ Here we determines cases when items should to get mouse press event at pressing
break
;
break
;
// Groups shouldn't reacts on any presses and moves for Play tool.
// Groups shouldn't reacts on any presses and moves for Play tool.
case
UBGraphicsStrokesGroup
:
:
Type
:
case
UBGraphicsGroupContainerItem
:
:
Type
:
case
UBGraphicsGroupContainerItem
:
:
Type
:
if
(
currentTool
==
UBStylusTool
::
Play
)
if
(
currentTool
==
UBStylusTool
::
Play
)
{
{
movingItem
=
NULL
;
movingItem
=
NULL
;
return
false
;
}
}
else
return
false
;
return
true
;
break
;
break
;
case
QGraphicsWebView
:
:
Type
:
case
QGraphicsWebView
:
:
Type
:
...
@@ -574,10 +573,8 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item)
...
@@ -574,10 +573,8 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item)
return
true
;
return
true
;
}
}
if
(
!
dynamic_cast
<
UBGraphicsItem
*>
(
item
))
return
true
;
else
return
false
;
return
false
;
}
}
bool
UBBoardView
::
itemShouldBeMoved
(
QGraphicsItem
*
item
)
bool
UBBoardView
::
itemShouldBeMoved
(
QGraphicsItem
*
item
)
...
@@ -635,8 +632,11 @@ QGraphicsItem* UBBoardView::determineItemToPress(QGraphicsItem *item)
...
@@ -635,8 +632,11 @@ QGraphicsItem* UBBoardView::determineItemToPress(QGraphicsItem *item)
if
(
item
->
parentItem
()
&&
UBGraphicsStrokesGroup
::
Type
==
item
->
type
())
if
(
item
->
parentItem
()
&&
UBGraphicsStrokesGroup
::
Type
==
item
->
type
())
return
item
->
parentItem
();
return
item
->
parentItem
();
// if item is on group and froup is not selected - group should take press.
// if item is on group and group is not selected - group should take press.
if
(
UBStylusTool
::
Selector
==
currentTool
&&
item
->
parentItem
()
&&
UBGraphicsGroupContainerItem
::
Type
==
item
->
parentItem
()
->
type
()
&&
!
item
->
parentItem
()
->
isSelected
())
if
(
UBStylusTool
::
Selector
==
currentTool
&&
item
->
parentItem
()
&&
UBGraphicsGroupContainerItem
::
Type
==
item
->
parentItem
()
->
type
()
&&
!
item
->
parentItem
()
->
isSelected
())
return
item
->
parentItem
();
return
item
->
parentItem
();
// items like polygons placed in two groups nested, so we need to recursive call.
// items like polygons placed in two groups nested, so we need to recursive call.
...
@@ -694,8 +694,7 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
...
@@ -694,8 +694,7 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
// Determining item who will take mouse press event
// Determining item who will take mouse press event
//all other items will be deselected and if all item will be deselected, then
//all other items will be deselected and if all item will be deselected, then
// wrong item can catch mouse press. because selected items placed on the top
// wrong item can catch mouse press. because selected items placed on the top
QGraphicsItem
*
pressedItem
=
determineItemToPress
(
movingItem
);
movingItem
=
determineItemToPress
(
movingItem
);
handleItemsSelection
(
movingItem
);
handleItemsSelection
(
movingItem
);
if
(
isMultipleSelectionEnabled
())
if
(
isMultipleSelectionEnabled
())
...
@@ -1096,12 +1095,15 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
...
@@ -1096,12 +1095,15 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
UBGraphicsDelegateFrame
::
Type
!=
movingItem
->
type
()
&&
UBGraphicsDelegateFrame
::
Type
!=
movingItem
->
type
()
&&
UBToolWidget
::
Type
!=
movingItem
->
type
()
&&
UBToolWidget
::
Type
!=
movingItem
->
type
()
&&
QGraphicsWebView
::
Type
!=
movingItem
->
type
()
&&
// for W3C widgets as Tools.
QGraphicsWebView
::
Type
!=
movingItem
->
type
()
&&
// for W3C widgets as Tools.
!
(
movingItem
->
parentItem
()
&&
UBGraphicsW3C
WidgetItem
::
Type
==
movingItem
->
type
()
&&
UBGraphicsGroupContainerItem
::
Type
==
movingItem
->
parentItem
()
->
type
()))
!
(
!
isMultipleSelectionEnabled
()
&&
movingItem
->
parentItem
()
&&
UBGraphics
WidgetItem
::
Type
==
movingItem
->
type
()
&&
UBGraphicsGroupContainerItem
::
Type
==
movingItem
->
parentItem
()
->
type
()))
{
{
bReleaseIsNeed
=
false
;
bReleaseIsNeed
=
false
;
if
(
movingItem
->
isSelected
()
&&
isMultipleSelectionEnabled
())
if
(
movingItem
->
isSelected
()
&&
isMultipleSelectionEnabled
())
movingItem
->
setSelected
(
false
);
movingItem
->
setSelected
(
false
);
else
else
if
(
movingItem
->
parentItem
()
&&
movingItem
->
parentItem
()
->
isSelected
()
&&
isMultipleSelectionEnabled
())
movingItem
->
parentItem
()
->
setSelected
(
false
);
else
{
{
if
(
movingItem
->
isSelected
())
if
(
movingItem
->
isSelected
())
bReleaseIsNeed
=
true
;
bReleaseIsNeed
=
true
;
...
...
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