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
967d54d1
Commit
967d54d1
authored
Nov 21, 2017
by
Clément Fauconnier
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bugfixes' of
https://github.com/OpenBoard-org/OpenBoard
into bugfixes
parents
ca8949f8
80a7b898
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
20 deletions
+55
-20
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+26
-6
UBGraphicsGroupContainerItem.cpp
src/domain/UBGraphicsGroupContainerItem.cpp
+12
-1
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+16
-13
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+1
-0
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
967d54d1
...
...
@@ -975,6 +975,24 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup()
if
(
mStrokesList
.
contains
(
id
))
shouldSkipSubElements
=
true
;
QString
ubLocked
=
mXmlReader
.
attributes
().
value
(
mNamespaceUri
,
"locked"
).
toString
();
if
(
!
ubLocked
.
isEmpty
())
{
bool
isLocked
=
ubLocked
.
contains
(
xmlTrue
);
group
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
isLocked
));
}
QStringRef
ubLayer
=
mXmlReader
.
attributes
().
value
(
mNamespaceUri
,
"layer"
);
if
(
!
ubLayer
.
isNull
())
{
bool
ok
;
int
layerAsInt
=
ubLayer
.
toString
().
toInt
(
&
ok
);
if
(
ok
)
group
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
layerAsInt
));
}
mXmlReader
.
readNext
();
while
(
!
mXmlReader
.
atEnd
())
{
...
...
@@ -1031,13 +1049,9 @@ 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
);
}
...
...
@@ -1400,6 +1414,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(UBDocumentProxy* proxy,
if
(
curElement
.
hasAttribute
(
"locked"
)){
mXmlWriter
.
writeAttribute
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"locked"
,
curElement
.
attribute
(
"locked"
));
}
if
(
curElement
.
hasAttribute
(
"layer"
)){
mXmlWriter
.
writeAttribute
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"layer"
,
curElement
.
attribute
(
"layer"
));
}
QDomElement
curSubElement
=
curElement
.
firstChildElement
();
while
(
!
curSubElement
.
isNull
())
{
if
(
curSubElement
.
hasAttribute
(
aId
))
{
...
...
@@ -1444,6 +1462,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
curGroupElement
.
setAttribute
(
"locked"
,
xmlTrue
);
else
curGroupElement
.
setAttribute
(
"locked"
,
xmlFalse
);
curGroupElement
.
setAttribute
(
"layer"
,
group
->
data
(
UBGraphicsItemData
::
ItemLayerType
).
toString
());
}
curParent
->
appendChild
(
curGroupElement
);
foreach
(
QGraphicsItem
*
item
,
groupItem
->
childItems
())
{
...
...
src/domain/UBGraphicsGroupContainerItem.cpp
View file @
967d54d1
...
...
@@ -84,12 +84,23 @@ void UBGraphicsGroupContainerItem::addToGroup(QGraphicsItem *item)
if
(
!
UBGraphicsItem
::
isLocked
(
this
)
&&
UBGraphicsItem
::
isLocked
(
item
))
{
Delegate
()
->
setLocked
(
true
);
}
/*
if (data(UBGraphicsItemData::itemLayerType).toInt() != UBItemLayerType::Control
&& item->data(UBGraphicsItemData::itemLayerType).toInt() == UBItemLayerType::Control)
setData(UBGraphicsItemData::itemLayerType, UBItemLayerType::Control);
*/
//setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
}
else
{
Delegate
()
->
setUBFlag
(
GF_FLIPPABLE_ALL_AXIS
,
UBGraphicsItem
::
isFlippable
(
item
));
Delegate
()
->
setUBFlag
(
GF_REVOLVABLE
,
UBGraphicsItem
::
isRotatable
(
item
));
Delegate
()
->
setLocked
(
UBGraphicsItem
::
isLocked
(
item
));
}
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
//setData(UBGraphicsItemData::itemLayerType, item->data(UBGraphicsItemData::itemLayerType));
}
qDebug
()
<<
item
->
data
(
UBGraphicsItemData
::
itemLayerType
);
// COMBINE
bool
ok
;
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
967d54d1
...
...
@@ -565,25 +565,20 @@ void UBGraphicsItemDelegate::increaseZlevelBottom()
void
UBGraphicsItemDelegate
::
lock
(
bool
locked
)
{
if
(
locked
)
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
true
));
}
else
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
false
));
}
setLockedRecurs
(
locked
,
mDelegated
);
mDelegated
->
update
();
positionHandles
();
mFrame
->
positionHandles
();
}
void
UBGraphicsItemDelegate
::
showHideRecurs
(
const
QVariant
&
pShow
,
QGraphicsItem
*
pItem
)
void
UBGraphicsItemDelegate
::
setLockedRecurs
(
const
QVariant
&
pLock
,
QGraphicsItem
*
pItem
)
{
pItem
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
pShow
);
foreach
(
QGraphicsItem
*
insideItem
,
pItem
->
childItems
())
{
showHideRecurs
(
pShow
,
insideItem
);
pItem
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
pLock
);
foreach
(
QGraphicsItem
*
insideItem
,
pItem
->
childItems
())
{
setLockedRecurs
(
pLock
,
insideItem
);
}
}
...
...
@@ -596,6 +591,14 @@ void UBGraphicsItemDelegate::showHide(bool show)
emit
showOnDisplayChanged
(
show
);
}
void
UBGraphicsItemDelegate
::
showHideRecurs
(
const
QVariant
&
pShow
,
QGraphicsItem
*
pItem
)
{
pItem
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
pShow
);
foreach
(
QGraphicsItem
*
insideItem
,
pItem
->
childItems
())
{
showHideRecurs
(
pShow
,
insideItem
);
}
}
/**
* @brief Set delegate as background for the scene, replacing any existing background.
*/
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
967d54d1
...
...
@@ -326,6 +326,7 @@ class UBGraphicsItemDelegate : public QObject
virtual
void
updateMenuActionState
();
void
showHideRecurs
(
const
QVariant
&
pShow
,
QGraphicsItem
*
pItem
);
void
setLockedRecurs
(
const
QVariant
&
pLock
,
QGraphicsItem
*
pItem
);
QList
<
DelegateButton
*>
buttons
()
{
return
mButtons
;}
QGraphicsItem
*
mDelegated
;
...
...
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