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
88921fbb
Commit
88921fbb
authored
Dec 11, 2013
by
-f
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue 111
parent
f135d9f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
2 deletions
+46
-2
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+17
-0
UBGraphicsGroupContainerItem.cpp
src/domain/UBGraphicsGroupContainerItem.cpp
+13
-2
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+9
-0
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+1
-0
UBItem.cpp
src/domain/UBItem.cpp
+5
-0
UBItem.h
src/domain/UBItem.h
+1
-0
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
88921fbb
...
...
@@ -42,6 +42,7 @@
#include "domain/UBGraphicsStroke.h"
#include "domain/UBGraphicsStrokesGroup.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "domain/UBGraphicsGroupContainerItemDelegate.h"
#include "domain/UBItem.h"
#include "tools/UBGraphicsRuler.h"
...
...
@@ -924,7 +925,13 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroupRoot()
}
else
if
(
mXmlReader
.
isStartElement
())
{
if
(
mXmlReader
.
name
()
==
tGroup
)
{
QString
ubLocked
=
mXmlReader
.
attributes
().
value
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"locked"
).
toString
();
UBGraphicsGroupContainerItem
*
curGroup
=
readGroup
();
if
(
!
ubLocked
.
isEmpty
())
{
bool
isLocked
=
ubLocked
.
contains
(
xmlTrue
);
curGroup
->
Delegate
()
->
setLocked
(
isLocked
);
}
if
(
curGroup
)
{
mScene
->
addGroup
(
curGroup
);
}
...
...
@@ -1276,6 +1283,9 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
if
(
curElement
.
hasAttribute
(
aId
))
{
mXmlWriter
.
writeStartElement
(
curElement
.
tagName
());
mXmlWriter
.
writeAttribute
(
aId
,
curElement
.
attribute
(
aId
));
if
(
curElement
.
hasAttribute
(
"locked"
)){
mXmlWriter
.
writeAttribute
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"locked"
,
curElement
.
attribute
(
"locked"
));
}
QDomElement
curSubElement
=
curElement
.
firstChildElement
();
while
(
!
curSubElement
.
isNull
())
{
if
(
curSubElement
.
hasAttribute
(
aId
))
{
...
...
@@ -1320,6 +1330,13 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
if
(
!
uuid
.
isNull
())
{
QDomElement
curGroupElement
=
groupDomDocument
->
createElement
(
tGroup
);
curGroupElement
.
setAttribute
(
aId
,
uuid
);
UBGraphicsGroupContainerItem
*
group
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
groupItem
);
if
(
group
&&
group
->
Delegate
()){
if
(
group
->
Delegate
()
->
isLocked
())
curGroupElement
.
setAttribute
(
"locked"
,
xmlTrue
);
else
curGroupElement
.
setAttribute
(
"locked"
,
xmlFalse
);
}
curParent
->
appendChild
(
curGroupElement
);
foreach
(
QGraphicsItem
*
item
,
groupItem
->
childItems
())
{
QUuid
tmpUuid
=
UBGraphicsScene
::
getPersonalUuid
(
item
);
...
...
src/domain/UBGraphicsGroupContainerItem.cpp
View file @
88921fbb
...
...
@@ -79,9 +79,14 @@ void UBGraphicsGroupContainerItem::addToGroup(QGraphicsItem *item)
if
(
UBGraphicsItem
::
isRotatable
(
this
)
&&
!
UBGraphicsItem
::
isRotatable
(
item
))
{
Delegate
()
->
setUBFlag
(
GF_REVOLVABLE
,
false
);
}
}
else
{
if
(
!
UBGraphicsItem
::
isLocked
(
this
)
&&
UBGraphicsItem
::
isLocked
(
item
))
{
Delegate
()
->
setLocked
(
true
);
}
}
else
{
Delegate
()
->
setUBFlag
(
GF_FLIPPABLE_ALL_AXIS
,
UBGraphicsItem
::
isFlippable
(
item
));
Delegate
()
->
setUBFlag
(
GF_REVOLVABLE
,
UBGraphicsItem
::
isRotatable
(
item
));
Delegate
()
->
setLocked
(
UBGraphicsItem
::
isLocked
(
item
));
}
// COMBINE
...
...
@@ -322,6 +327,7 @@ void UBGraphicsGroupContainerItem::pRemoveFromGroup(QGraphicsItem *item)
if
(
!
UBGraphicsItem
::
isFlippable
(
item
)
||
!
UBGraphicsItem
::
isRotatable
(
item
))
{
bool
flippableNow
=
true
;
bool
rotatableNow
=
true
;
bool
lockedNow
=
false
;
foreach
(
QGraphicsItem
*
item
,
childItems
())
{
if
(
!
UBGraphicsItem
::
isFlippable
(
item
))
{
...
...
@@ -330,12 +336,17 @@ void UBGraphicsGroupContainerItem::pRemoveFromGroup(QGraphicsItem *item)
if
(
!
UBGraphicsItem
::
isRotatable
(
item
))
{
rotatableNow
=
false
;
}
if
(
!
rotatableNow
&&
!
flippableNow
)
{
if
(
UBGraphicsItem
::
isLocked
(
item
))
lockedNow
=
true
;
if
(
!
rotatableNow
&&
!
flippableNow
&&
lockedNow
)
{
break
;
}
}
Delegate
()
->
setUBFlag
(
GF_FLIPPABLE_ALL_AXIS
,
flippableNow
);
Delegate
()
->
setUBFlag
(
GF_REVOLVABLE
,
rotatableNow
);
Delegate
()
->
setLocked
(
lockedNow
);
}
}
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
88921fbb
...
...
@@ -715,6 +715,15 @@ void UBGraphicsItemDelegate::showMenu()
mMenu
->
exec
(
cv
->
mapToGlobal
(
pinPos
.
bottomRight
()));
}
void
UBGraphicsItemDelegate
::
setLocked
(
bool
pLocked
)
{
Q_ASSERT
(
mDelegated
);
if
(
mDelegated
)
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
pLocked
));
}
}
void
UBGraphicsItemDelegate
::
updateFrame
()
{
if
(
mFrame
&&
!
mFrame
->
scene
()
&&
mDelegated
->
scene
())
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
88921fbb
...
...
@@ -279,6 +279,7 @@ class UBGraphicsItemDelegate : public QObject
void
setMimeData
(
QMimeData
*
mimeData
);
void
setDragPixmap
(
const
QPixmap
&
pix
)
{
mDragPixmap
=
pix
;}
void
setLocked
(
bool
pLocked
);
void
setButtonsVisible
(
bool
visible
);
UBGraphicsToolBarItem
*
getToolBarItem
()
const
{
return
mToolBarItem
;
}
...
...
src/domain/UBItem.cpp
View file @
88921fbb
...
...
@@ -85,6 +85,11 @@ bool UBGraphicsItem::isRotatable(QGraphicsItem *item)
return
item
->
data
(
UBGraphicsItemData
::
ItemRotatable
).
toBool
();
}
bool
UBGraphicsItem
::
isLocked
(
QGraphicsItem
*
item
)
{
return
item
->
data
(
UBGraphicsItemData
::
ItemLocked
).
toBool
();
}
QUuid
UBGraphicsItem
::
getOwnUuid
(
QGraphicsItem
*
item
)
{
QString
idCandidate
=
item
->
data
(
UBGraphicsItemData
::
ItemUuid
).
toString
();
...
...
src/domain/UBItem.h
View file @
88921fbb
...
...
@@ -116,6 +116,7 @@ public:
static
void
assignZValue
(
QGraphicsItem
*
,
qreal
value
);
static
bool
isRotatable
(
QGraphicsItem
*
item
);
static
bool
isFlippable
(
QGraphicsItem
*
item
);
static
bool
isLocked
(
QGraphicsItem
*
item
);
static
QUuid
getOwnUuid
(
QGraphicsItem
*
item
);
static
UBGraphicsItemDelegate
*
Delegate
(
QGraphicsItem
*
pItem
);
...
...
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