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
a748e8a2
Commit
a748e8a2
authored
Aug 22, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SANKORE-852
Draw lines and move
parent
370e5b37
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
1 deletion
+41
-1
UBBoardView.cpp
src/board/UBBoardView.cpp
+11
-1
UBBoardView.h
src/board/UBBoardView.h
+2
-0
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+25
-0
UBGraphicsStrokesGroup.h
src/domain/UBGraphicsStrokesGroup.h
+3
-0
No files found.
src/board/UBBoardView.cpp
View file @
a748e8a2
...
...
@@ -596,7 +596,7 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
mLastPressedMousePos
=
mapToScene
(
event
->
pos
());
if
(
movingItem
&&
QGraphicsSvgItem
::
Type
!=
movingItem
->
type
()
if
(
movingItem
&&
!
hasSelectedParents
(
movingItem
)
&&
QGraphicsSvgItem
::
Type
!=
movingItem
->
type
()
&&
UBGraphicsDelegateFrame
::
Type
!=
movingItem
->
type
()
&&
!
mMultipleSelectionIsEnabled
)
{
...
...
@@ -1405,3 +1405,13 @@ UBBoardView::setToolCursor (int tool)
controlViewport
->
setCursor
(
UBResources
::
resources
()
->
penCursor
);
}
}
bool
UBBoardView
::
hasSelectedParents
(
QGraphicsItem
*
item
)
{
if
(
item
->
isSelected
())
return
true
;
if
(
item
->
parentItem
()
==
NULL
)
return
false
;
return
hasSelectedParents
(
item
->
parentItem
());
}
src/board/UBBoardView.h
View file @
a748e8a2
...
...
@@ -148,6 +148,8 @@ class UBBoardView : public QGraphicsView
bool
mIsDragInProgress
;
bool
mMultipleSelectionIsEnabled
;
static
bool
hasSelectedParents
(
QGraphicsItem
*
item
);
private
slots
:
void
settingChanged
(
QVariant
newValue
);
...
...
src/domain/UBGraphicsStrokesGroup.cpp
View file @
a748e8a2
...
...
@@ -112,6 +112,31 @@ void UBGraphicsStrokesGroup::paint(QPainter *painter, const QStyleOptionGraphics
QVariant
UBGraphicsStrokesGroup
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
{
if
(
change
==
QGraphicsItem
::
ItemSelectedChange
)
{
int
a
=
13
;
}
QVariant
newValue
=
mDelegate
->
itemChange
(
change
,
value
);
return
QGraphicsItemGroup
::
itemChange
(
change
,
newValue
);
}
QPainterPath
UBGraphicsStrokesGroup
::
shape
()
const
{
QPainterPath
path
;
if
(
isSelected
())
{
path
.
addRect
(
boundingRect
());
}
else
{
foreach
(
QGraphicsItem
*
item
,
childItems
())
{
path
.
addPath
(
item
->
shape
());
}
}
return
path
;
}
src/domain/UBGraphicsStrokesGroup.h
View file @
a748e8a2
...
...
@@ -25,6 +25,9 @@ public:
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
protected
:
virtual
QPainterPath
shape
()
const
;
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
...
...
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