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
b36627ae
Commit
b36627ae
authored
Mar 30, 2012
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Zvalue controller is now finished
parent
4d196a03
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
65 additions
and
232 deletions
+65
-232
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+3
-41
UBBoardController.cpp
src/board/UBBoardController.cpp
+0
-2
UB.h
src/core/UB.h
+1
-0
UBGraphicsAudioItem.cpp
src/domain/UBGraphicsAudioItem.cpp
+0
-2
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+1
-13
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+1
-1
UBGraphicsPDFItem.cpp
src/domain/UBGraphicsPDFItem.cpp
+0
-4
UBGraphicsPixmapItem.cpp
src/domain/UBGraphicsPixmapItem.cpp
+0
-2
UBGraphicsPolygonItem.cpp
src/domain/UBGraphicsPolygonItem.cpp
+0
-3
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+51
-113
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+4
-23
UBGraphicsSvgItem.cpp
src/domain/UBGraphicsSvgItem.cpp
+2
-6
UBGraphicsTextItem.cpp
src/domain/UBGraphicsTextItem.cpp
+0
-2
UBGraphicsVideoItem.cpp
src/domain/UBGraphicsVideoItem.cpp
+0
-2
UBGraphicsVideoItemDelegate.cpp
src/domain/UBGraphicsVideoItemDelegate.cpp
+2
-2
UBGraphicsWidgetItem.cpp
src/domain/UBGraphicsWidgetItem.cpp
+0
-1
UBGraphicsCache.cpp
src/tools/UBGraphicsCache.cpp
+0
-2
UBGraphicsCompass.cpp
src/tools/UBGraphicsCompass.cpp
+0
-2
UBGraphicsCurtainItem.cpp
src/tools/UBGraphicsCurtainItem.cpp
+0
-4
UBGraphicsCurtainItemDelegate.cpp
src/tools/UBGraphicsCurtainItemDelegate.cpp
+0
-1
UBGraphicsProtractor.cpp
src/tools/UBGraphicsProtractor.cpp
+0
-2
UBGraphicsRuler.cpp
src/tools/UBGraphicsRuler.cpp
+0
-2
UBGraphicsTriangle.cpp
src/tools/UBGraphicsTriangle.cpp
+0
-2
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
b36627ae
...
...
@@ -306,9 +306,6 @@ UBSvgSubsetAdaptor::UBSvgSubsetReader::UBSvgSubsetReader(UBDocumentProxy* pProxy
UBGraphicsScene
*
UBSvgSubsetAdaptor
::
UBSvgSubsetReader
::
loadScene
()
{
UBGraphicsScene
*
scene
=
0
;
qreal
maxDrawingZIndex
=
0
;
qreal
maxObjectZIndex
=
0
;
UBGraphicsWidgetItem
*
currentWidget
=
0
;
mFileVersion
=
40100
;
// default to 4.1.0
...
...
@@ -481,7 +478,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
scene
->
addItem
(
polygonItem
);
polygonItem
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Graphic
));
maxDrawingZIndex
=
qMax
(
polygonItem
->
zValue
(),
maxDrawingZIndex
);
polygonItem
->
show
();
}
...
...
@@ -501,8 +497,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
scene
->
addItem
(
polygonItem
);
polygonItem
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Graphic
));
maxDrawingZIndex
=
qMax
(
polygonItem
->
zValue
(),
maxDrawingZIndex
);
polygonItem
->
show
();
}
}
...
...
@@ -527,8 +521,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
maxObjectZIndex
=
qMax
(
pixmapItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
pixmapItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -549,8 +541,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
maxObjectZIndex
=
qMax
(
svgItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
svgItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -577,8 +567,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
audioItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
audioItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
maxObjectZIndex
=
qMax
(
audioItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
audioItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -600,8 +588,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
videoItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
videoItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
maxObjectZIndex
=
qMax
(
videoItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
videoItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -623,8 +609,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
textItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
textItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
maxObjectZIndex
=
qMax
(
textItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
textItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -733,8 +717,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
pdfItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pdfItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
maxObjectZIndex
=
qMax
(
pdfItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
pdfItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -758,8 +740,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
appleWidgetItem
->
resize
(
foreignObjectWidth
,
foreignObjectHeight
);
maxObjectZIndex
=
qMax
(
appleWidgetItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
appleWidgetItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -781,8 +761,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
w3cWidgetItem
->
resize
(
foreignObjectWidth
,
foreignObjectHeight
);
maxObjectZIndex
=
qMax
(
w3cWidgetItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
w3cWidgetItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -802,7 +780,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
textItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
textItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
maxObjectZIndex
=
qMax
(
textItem
->
zValue
(),
maxObjectZIndex
);
scene
->
addItem
(
textItem
);
if
(
zFromSvg
!=
UBZLayerController
::
errorNum
())
...
...
@@ -856,17 +833,14 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
qWarning
()
<<
"error parsing Sankore file "
<<
mXmlReader
.
errorString
();
}
if
(
scene
)
{
scene
->
setObjectZIndex
(
maxObjectZIndex
);
scene
->
setDrawingZIndex
(
maxDrawingZIndex
);
if
(
scene
)
{
scene
->
setModified
(
false
);
}
if
(
annotationGroup
)
{
if
(
annotationGroup
->
polygons
().
empty
())
delete
annotationGroup
;
if
(
annotationGroup
->
polygons
().
empty
())
delete
annotationGroup
;
}
return
scene
;
...
...
@@ -1400,12 +1374,10 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
if
(
!
ubZValue
.
isNull
())
{
// polygonItem->setZValue (ubZValue.toString().toFloat());
UBGraphicsItem
::
assignZValue
(
polygonItem
,
ubZValue
.
toString
().
toFloat
());
}
else
{
// polygonItem->setZValue(mGroupZIndex);
UBGraphicsItem
::
assignZValue
(
polygonItem
,
mGroupZIndex
);
}
...
...
@@ -1509,12 +1481,10 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromLin
if
(
!
ubZValue
.
isNull
())
{
// polygonItem->setZValue(ubZValue.toString().toFloat());
UBGraphicsItem
::
assignZValue
(
polygonItem
,
ubZValue
.
toString
().
toFloat
());
}
else
{
// polygonItem->setZValue(mGroupZIndex);
UBGraphicsItem
::
assignZValue
(
polygonItem
,
mGroupZIndex
);
}
...
...
@@ -1663,7 +1633,6 @@ QList<UBGraphicsPolygonItem*> UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItem
{
UBGraphicsPolygonItem
*
polygonItem
=
new
UBGraphicsPolygonItem
(
QLineF
(
points
.
at
(
i
),
points
.
at
(
i
+
1
)),
lineWidth
);
polygonItem
->
setColor
(
brushColor
);
// polygonItem->setZValue(zValue);
UBGraphicsItem
::
assignZValue
(
polygonItem
,
zValue
);
polygonItem
->
setColorOnDarkBackground
(
colorOnDarkBackground
);
polygonItem
->
setColorOnLightBackground
(
colorOnLightBackground
);
...
...
@@ -2008,7 +1977,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
if
(
!
ubZValue
.
isNull
())
{
// gItem->setZValue(ubZValue.toString().toFloat());
UBGraphicsItem
::
assignZValue
(
gItem
,
ubZValue
.
toString
().
toFloat
());
}
...
...
@@ -2591,7 +2559,6 @@ UBGraphicsRuler* UBSvgSubsetAdaptor::UBSvgSubsetReader::rulerFromSvg()
graphicsItemFromSvg
(
ruler
);
// ruler->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetRuler);
UBGraphicsItem
::
assignZValue
(
ruler
,
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetRuler
);
ruler
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
...
...
@@ -2650,7 +2617,6 @@ UBGraphicsCompass* UBSvgSubsetAdaptor::UBSvgSubsetReader::compassFromSvg()
graphicsItemFromSvg
(
compass
);
//compass->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCompass);
UBGraphicsItem
::
assignZValue
(
compass
,
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetCompass
);
compass
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
...
...
@@ -2715,7 +2681,6 @@ UBGraphicsProtractor* UBSvgSubsetAdaptor::UBSvgSubsetReader::protractorFromSvg()
{
UBGraphicsProtractor
*
protractor
=
new
UBGraphicsProtractor
();
// protractor->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetProtractor);
UBGraphicsItem
::
assignZValue
(
protractor
,
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetProtractor
);
protractor
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
...
...
@@ -2786,7 +2751,6 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
{
UBGraphicsTriangle
*
triangle
=
new
UBGraphicsTriangle
();
// triangle->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetTriangle);
UBGraphicsItem
::
assignZValue
(
triangle
,
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetTriangle
);
triangle
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
...
...
@@ -2813,8 +2777,6 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
UBGraphicsCache
*
UBSvgSubsetAdaptor
::
UBSvgSubsetReader
::
cacheFromSvg
()
{
UBGraphicsCache
*
pCache
=
new
UBGraphicsCache
();
pCache
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetCache
);
// UBGraphicsItem::assignZValue(pCache, UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCache);
pCache
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
graphicsItemFromSvg
(
pCache
);
...
...
src/board/UBBoardController.cpp
View file @
b36627ae
...
...
@@ -1943,8 +1943,6 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
if
(
gi
)
{
// gi->setZValue(mActiveScene->getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
gi
,
mActiveScene
->
getNextObjectZIndex
());
mActiveScene
->
addItem
(
gi
);
gi
->
setPos
(
gi
->
pos
()
+
QPointF
(
50
,
50
));
}
...
...
src/core/UB.h
View file @
b36627ae
...
...
@@ -84,6 +84,7 @@ struct itemLayerType
,
Curtain
,
Pointer
,
Cache
,
SelectedItem
};
};
...
...
src/domain/UBGraphicsAudioItem.cpp
View file @
b36627ae
...
...
@@ -97,8 +97,6 @@ UBItem* UBGraphicsAudioItem::deepCopy() const
UBGraphicsAudioItem
*
copy
=
new
UBGraphicsAudioItem
(
audioUrl
,
parentItem
());
copy
->
setPos
(
this
->
pos
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
b36627ae
...
...
@@ -73,8 +73,6 @@ void UBGraphicsItemDelegate::init()
{
mFrame
=
new
UBGraphicsDelegateFrame
(
this
,
QRectF
(
0
,
0
,
0
,
0
),
mFrameWidth
,
mRespectRatio
);
mFrame
->
hide
();
// mFrame->setZValue(UBGraphicsScene::toolLayerStart + 1);
UBGraphicsItem
::
assignZValue
(
mFrame
,
UBGraphicsScene
::
toolLayerStart
+
1
);
mFrame
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
mDeleteButton
=
new
DelegateButton
(
":/images/close.svg"
,
mDelegated
,
mFrame
,
Qt
::
TopLeftSection
);
...
...
@@ -102,8 +100,6 @@ void UBGraphicsItemDelegate::init()
foreach
(
DelegateButton
*
button
,
mButtons
)
{
button
->
hide
();
// button->setZValue(UBGraphicsScene::toolLayerStart + 2);
UBGraphicsItem
::
assignZValue
(
button
,
UBGraphicsScene
::
toolLayerStart
+
2
);
button
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
}
}
...
...
@@ -168,18 +164,9 @@ bool UBGraphicsItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *event)
if
(
!
mDelegated
->
isSelected
())
{
mDelegated
->
setSelected
(
true
);
UBGraphicsScene
*
scene
=
static_cast
<
UBGraphicsScene
*>
(
mDelegated
->
scene
());
qDebug
()
<<
mDelegated
->
zValue
();
qDebug
()
<<
scene
->
currentObjectZIndex
();
// To investigate. Z value behavior
// if (mDelegated->zValue() < scene->currentObjectZIndex() && !isLocked())
// mDelegated->setZValue(scene->getNextObjectZIndex());
positionHandles
();
return
true
;
}
else
...
...
@@ -288,6 +275,7 @@ void UBGraphicsItemDelegate::positionHandles()
mDelegated
->
scene
()
->
addItem
(
button
);
}
button
->
show
();
button
->
setZValue
(
delegated
()
->
zValue
());
}
}
else
{
foreach
(
DelegateButton
*
button
,
mButtons
)
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
b36627ae
...
...
@@ -33,7 +33,7 @@ class DelegateButton: public QGraphicsSvgItem
Q_OBJECT
public
:
DelegateButton
(
const
QString
&
fileName
,
QGraphicsItem
*
pDelegated
,
QGraphicsItem
*
parent
=
0
,
Qt
::
WindowFrameSection
section
=
Qt
::
No
Section
)
DelegateButton
(
const
QString
&
fileName
,
QGraphicsItem
*
pDelegated
,
QGraphicsItem
*
parent
=
0
,
Qt
::
WindowFrameSection
section
=
Qt
::
TopLeft
Section
)
:
QGraphicsSvgItem
(
fileName
,
parent
)
,
mDelegated
(
pDelegated
)
,
mIsTransparentToMouseEvent
(
false
)
...
...
src/domain/UBGraphicsPDFItem.cpp
View file @
b36627ae
...
...
@@ -85,8 +85,6 @@ UBItem* UBGraphicsPDFItem::deepCopy() const
UBGraphicsPDFItem
*
copy
=
new
UBGraphicsPDFItem
(
mRenderer
,
mPageNumber
,
parentItem
());
copy
->
setPos
(
this
->
pos
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
@@ -136,8 +134,6 @@ UBGraphicsPixmapItem* UBGraphicsPDFItem::toPixmapItem() const
pixmapItem
->
setPixmap
(
pixmap
);
pixmapItem
->
setPos
(
this
->
pos
());
// pixmapItem->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
pixmapItem
,
this
->
zValue
());
pixmapItem
->
setTransform
(
this
->
transform
());
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsPixmapItem.cpp
View file @
b36627ae
...
...
@@ -103,8 +103,6 @@ UBItem* UBGraphicsPixmapItem::deepCopy() const
copy
->
setPixmap
(
this
->
pixmap
());
copy
->
setPos
(
this
->
pos
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsPolygonItem.cpp
View file @
b36627ae
...
...
@@ -161,9 +161,6 @@ UBGraphicsPolygonItem* UBGraphicsPolygonItem::deepCopy(const QPolygonF& pol) con
copy
->
setPen
(
this
->
pen
());
copy
->
mHasAlpha
=
this
->
mHasAlpha
;
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setColorOnDarkBackground
(
this
->
colorOnDarkBackground
());
copy
->
setColorOnLightBackground
(
this
->
colorOnLightBackground
());
...
...
src/domain/UBGraphicsScene.cpp
View file @
b36627ae
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsScene.h
View file @
b36627ae
...
...
@@ -181,23 +181,11 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
return
mCrossedBackground
;
}
void
setDrawingZIndex
(
qreal
pDrawingZIndex
)
{
mDrawingZIndex
=
pDrawingZIndex
;
}
void
setObjectZIndex
(
qreal
pObjectZIndex
)
{
mObjectZIndex
=
pObjectZIndex
;
}
bool
hasBackground
()
{
return
(
mBackgroundObject
!=
0
);
}
qreal
getNextObjectZIndex
();
void
addRuler
(
QPointF
center
);
void
addProtractor
(
QPointF
center
);
void
addCompass
(
QPointF
center
);
...
...
@@ -254,11 +242,6 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void
setNominalSize
(
int
pWidth
,
int
pHeight
);
qreal
currentObjectZIndex
()
{
return
mObjectZIndex
;
}
enum
RenderingContext
{
Screen
=
0
,
NonScreen
,
PdfExport
,
Podcast
...
...
@@ -343,19 +326,17 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void
recolorAllItems
();
qreal
getNextDrawingZIndex
();
virtual
void
drawItems
(
QPainter
*
painter
,
int
numItems
,
virtual
void
drawItems
(
QPainter
*
painter
,
int
numItems
,
QGraphicsItem
*
items
[],
const
QStyleOptionGraphicsItem
options
[],
QWidget
*
widget
=
0
);
QGraphicsItem
*
rootItem
(
QGraphicsItem
*
item
)
const
;
private
:
void
setDocumentUpdated
();
qreal
generateZLevel
(
QGraphicsItem
*
item
);
void
createEraiser
();
void
createPointer
();
qreal
mDrawingZIndex
;
qreal
mObjectZIndex
;
qreal
generateZLevel
(
QGraphicsItem
*
item
);
QGraphicsEllipseItem
*
mEraser
;
QGraphicsEllipseItem
*
mPointer
;
...
...
src/domain/UBGraphicsSvgItem.cpp
View file @
b36627ae
...
...
@@ -46,8 +46,6 @@ UBGraphicsSvgItem::UBGraphicsSvgItem(const QByteArray& pFileData, QGraphicsItem*
setSharedRenderer
(
renderer
);
mFileData
=
pFileData
;
setData
(
UBGraphicsItemData
::
itemLayerType
,
QVariant
(
itemLayerType
::
ObjectItem
));
//Necessary to set if we want z value to be assigned correctly
}
...
...
@@ -62,6 +60,8 @@ void UBGraphicsSvgItem::init()
setCacheMode
(
QGraphicsItem
::
DeviceCoordinateCache
);
setMaximumCacheSize
(
boundingRect
().
size
().
toSize
()
*
UB_MAX_ZOOM
);
setData
(
UBGraphicsItemData
::
itemLayerType
,
QVariant
(
itemLayerType
::
ObjectItem
));
//Necessary to set if we want z value to be assigned correctly
}
...
...
@@ -133,8 +133,6 @@ UBItem* UBGraphicsSvgItem::deepCopy() const
UBGraphicsSvgItem
*
copy
=
new
UBGraphicsSvgItem
(
this
->
fileData
());
copy
->
setPos
(
this
->
pos
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
@@ -188,8 +186,6 @@ UBGraphicsPixmapItem* UBGraphicsSvgItem::toPixmapItem() const
pixmapItem
->
setPixmap
(
QPixmap
::
fromImage
(
image
));
pixmapItem
->
setPos
(
this
->
pos
());
// pixmapItem->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
pixmapItem
,
this
->
zValue
());
pixmapItem
->
setTransform
(
this
->
transform
());
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsTextItem.cpp
View file @
b36627ae
...
...
@@ -193,8 +193,6 @@ UBItem* UBGraphicsTextItem::deepCopy() const
copy
->
setHtml
(
toHtml
());
copy
->
setPos
(
this
->
pos
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsVideoItem.cpp
View file @
b36627ae
...
...
@@ -70,8 +70,6 @@ UBItem* UBGraphicsVideoItem::deepCopy() const
UBGraphicsVideoItem
*
copy
=
new
UBGraphicsVideoItem
(
videoUrl
,
parentItem
());
copy
->
setPos
(
this
->
pos
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsVideoItemDelegate.cpp
View file @
b36627ae
...
...
@@ -52,8 +52,7 @@ void UBGraphicsVideoItemDelegate::buildButtons()
mMuteButton
->
hide
();
mVideoControl
=
new
DelegateVideoControl
(
delegated
(),
mFrame
);
// mVideoControl->setZValue(UBGraphicsScene::toolLayerStart + 2);
UBGraphicsItem
::
assignZValue
(
mVideoControl
,
UBGraphicsScene
::
toolLayerStart
+
2
);
UBGraphicsItem
::
assignZValue
(
mVideoControl
,
delegated
()
->
zValue
());
mVideoControl
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
connect
(
mPlayPauseButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
togglePlayPause
()));
...
...
@@ -106,6 +105,7 @@ void UBGraphicsVideoItemDelegate::positionHandles()
}
mVideoControl
->
setAntiScale
(
mAntiScaleRatio
);
mVideoControl
->
setZValue
(
delegated
()
->
zValue
());
mVideoControl
->
show
();
}
else
...
...
src/domain/UBGraphicsWidgetItem.cpp
View file @
b36627ae
...
...
@@ -411,7 +411,6 @@ UBItem* UBGraphicsW3CWidgetItem::deepCopy() const
UBGraphicsW3CWidgetItem
*
copy
=
new
UBGraphicsW3CWidgetItem
(
mWebKitWidget
->
widgetUrl
(),
parentItem
());
copy
->
setPos
(
this
->
pos
());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/tools/UBGraphicsCache.cpp
View file @
b36627ae
...
...
@@ -47,8 +47,6 @@ UBItem* UBGraphicsCache::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setRect
(
this
->
rect
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
...
...
src/tools/UBGraphicsCompass.cpp
View file @
b36627ae
...
...
@@ -87,8 +87,6 @@ UBItem* UBGraphicsCompass::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setRect
(
this
->
rect
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
...
...
src/tools/UBGraphicsCurtainItem.cpp
View file @
b36627ae
...
...
@@ -60,8 +60,6 @@ UBGraphicsCurtainItem::~UBGraphicsCurtainItem()
QVariant
UBGraphicsCurtainItem
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
{
// if (change == QGraphicsItem::ItemSelectedHasChanged && QGraphicsRectItem::scene() && isSelected())
// setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCurtain);
QVariant
newValue
=
value
;
...
...
@@ -133,8 +131,6 @@ UBItem* UBGraphicsCurtainItem::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setBrush
(
this
->
brush
());
copy
->
setPen
(
this
->
pen
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/tools/UBGraphicsCurtainItemDelegate.cpp
View file @
b36627ae
...
...
@@ -52,7 +52,6 @@ bool UBGraphicsCurtainItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *ev
if
(
!
mDelegated
->
isSelected
())
{
mDelegated
->
setSelected
(
true
);
// mDelegated->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCurtain);
positionHandles
();
return
true
;
...
...
src/tools/UBGraphicsProtractor.cpp
View file @
b36627ae
...
...
@@ -581,8 +581,6 @@ UBItem* UBGraphicsProtractor::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setRect
(
this
->
rect
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
mCurrentAngle
=
this
->
mCurrentAngle
;
...
...
src/tools/UBGraphicsRuler.cpp
View file @
b36627ae
...
...
@@ -76,8 +76,6 @@ UBItem* UBGraphicsRuler::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setRect
(
this
->
rect
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
...
...
src/tools/UBGraphicsTriangle.cpp
View file @
b36627ae
...
...
@@ -95,8 +95,6 @@ UBItem* UBGraphicsTriangle::deepCopy(void) const
copy
->
setPos
(
this
->
pos
());
copy
->
setPolygon
(
this
->
polygon
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
...
...
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