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
7c02a524
Commit
7c02a524
authored
Dec 14, 2011
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ZValueIssue'
parents
c4cefa67
e943854c
Changes
28
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
167 additions
and
78 deletions
+167
-78
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+25
-13
UBBoardController.cpp
src/board/UBBoardController.cpp
+2
-1
UB.h
src/core/UB.h
+1
-0
UBGraphicsAudioItem.cpp
src/domain/UBGraphicsAudioItem.cpp
+2
-1
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+3
-0
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+4
-4
UBGraphicsItemTransformUndoCommand.cpp
src/domain/UBGraphicsItemTransformUndoCommand.cpp
+4
-0
UBGraphicsPDFItem.cpp
src/domain/UBGraphicsPDFItem.cpp
+4
-2
UBGraphicsPixmapItem.cpp
src/domain/UBGraphicsPixmapItem.cpp
+2
-1
UBGraphicsPolygonItem.cpp
src/domain/UBGraphicsPolygonItem.cpp
+3
-1
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+69
-30
UBGraphicsSvgItem.cpp
src/domain/UBGraphicsSvgItem.cpp
+4
-2
UBGraphicsTextItem.cpp
src/domain/UBGraphicsTextItem.cpp
+2
-1
UBGraphicsVideoItem.cpp
src/domain/UBGraphicsVideoItem.cpp
+2
-1
UBGraphicsVideoItemDelegate.cpp
src/domain/UBGraphicsVideoItemDelegate.cpp
+2
-1
UBGraphicsWidgetItem.cpp
src/domain/UBGraphicsWidgetItem.cpp
+2
-1
UBItem.cpp
src/domain/UBItem.cpp
+6
-0
UBItem.h
src/domain/UBItem.h
+1
-0
UBLibraryWidget.cpp
src/gui/UBLibraryWidget.cpp
+1
-1
UBThumbnailWidget.h
src/gui/UBThumbnailWidget.h
+2
-0
Object.h
src/pdf-merger/Object.h
+1
-1
UBGraphicsCache.cpp
src/tools/UBGraphicsCache.cpp
+6
-3
UBGraphicsCompass.cpp
src/tools/UBGraphicsCompass.cpp
+2
-1
UBGraphicsCurtainItem.cpp
src/tools/UBGraphicsCurtainItem.cpp
+4
-3
UBGraphicsCurtainItemDelegate.cpp
src/tools/UBGraphicsCurtainItemDelegate.cpp
+7
-7
UBGraphicsProtractor.cpp
src/tools/UBGraphicsProtractor.cpp
+2
-1
UBGraphicsRuler.cpp
src/tools/UBGraphicsRuler.cpp
+2
-1
UBGraphicsTriangle.cpp
src/tools/UBGraphicsTriangle.cpp
+2
-1
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
7c02a524
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBAbstractWidget.h"
#include "domain/UBAbstractWidget.h"
#include "domain/UBGraphicsStroke.h"
#include "domain/UBGraphicsStroke.h"
#include "domain/UBItem.h"
#include "tools/UBGraphicsRuler.h"
#include "tools/UBGraphicsRuler.h"
#include "tools/UBGraphicsCompass.h"
#include "tools/UBGraphicsCompass.h"
...
@@ -106,7 +107,8 @@ QMatrix UBSvgSubsetAdaptor::fromSvgTransform(const QString& transform)
...
@@ -106,7 +107,8 @@ QMatrix UBSvgSubsetAdaptor::fromSvgTransform(const QString& transform)
static
bool
itemZIndexComp
(
const
QGraphicsItem
*
item1
,
static
bool
itemZIndexComp
(
const
QGraphicsItem
*
item1
,
const
QGraphicsItem
*
item2
)
const
QGraphicsItem
*
item2
)
{
{
return
item1
->
zValue
()
<
item2
->
zValue
();
// return item1->zValue() < item2->zValue();
return
item1
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
()
<
item2
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
();
}
}
...
@@ -1337,11 +1339,13 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
...
@@ -1337,11 +1339,13 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
if
(
!
ubZValue
.
isNull
())
if
(
!
ubZValue
.
isNull
())
{
{
polygonItem
->
setZValue
(
ubZValue
.
toString
().
toFloat
());
// polygonItem->setZValue (ubZValue.toString().toFloat());
UBGraphicsItem
::
assignZValue
(
polygonItem
,
ubZValue
.
toString
().
toFloat
());
}
}
else
else
{
{
polygonItem
->
setZValue
(
mGroupZIndex
);
// polygonItem->setZValue(mGroupZIndex);
UBGraphicsItem
::
assignZValue
(
polygonItem
,
mGroupZIndex
);
}
}
QStringRef
ubFillOnDarkBackground
=
mXmlReader
.
attributes
().
value
(
mNamespaceUri
,
"fill-on-dark-background"
);
QStringRef
ubFillOnDarkBackground
=
mXmlReader
.
attributes
().
value
(
mNamespaceUri
,
"fill-on-dark-background"
);
...
@@ -1444,11 +1448,13 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromLin
...
@@ -1444,11 +1448,13 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromLin
if
(
!
ubZValue
.
isNull
())
if
(
!
ubZValue
.
isNull
())
{
{
polygonItem
->
setZValue
(
ubZValue
.
toString
().
toFloat
());
// polygonItem->setZValue(ubZValue.toString().toFloat());
UBGraphicsItem
::
assignZValue
(
polygonItem
,
ubZValue
.
toString
().
toFloat
());
}
}
else
else
{
{
polygonItem
->
setZValue
(
mGroupZIndex
);
// polygonItem->setZValue(mGroupZIndex);
UBGraphicsItem
::
assignZValue
(
polygonItem
,
mGroupZIndex
);
}
}
...
@@ -1587,7 +1593,8 @@ QList<UBGraphicsPolygonItem*> UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItem
...
@@ -1587,7 +1593,8 @@ QList<UBGraphicsPolygonItem*> UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItem
{
{
UBGraphicsPolygonItem
*
polygonItem
=
new
UBGraphicsPolygonItem
(
QLineF
(
points
.
at
(
i
),
points
.
at
(
i
+
1
)),
lineWidth
);
UBGraphicsPolygonItem
*
polygonItem
=
new
UBGraphicsPolygonItem
(
QLineF
(
points
.
at
(
i
),
points
.
at
(
i
+
1
)),
lineWidth
);
polygonItem
->
setColor
(
brushColor
);
polygonItem
->
setColor
(
brushColor
);
polygonItem
->
setZValue
(
zValue
);
// polygonItem->setZValue(zValue);
UBGraphicsItem
::
assignZValue
(
polygonItem
,
zValue
);
polygonItem
->
setColorOnDarkBackground
(
colorOnDarkBackground
);
polygonItem
->
setColorOnDarkBackground
(
colorOnDarkBackground
);
polygonItem
->
setColorOnLightBackground
(
colorOnLightBackground
);
polygonItem
->
setColorOnLightBackground
(
colorOnLightBackground
);
...
@@ -1931,7 +1938,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
...
@@ -1931,7 +1938,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
if
(
!
ubZValue
.
isNull
())
if
(
!
ubZValue
.
isNull
())
{
{
gItem
->
setZValue
(
ubZValue
.
toString
().
toFloat
());
// gItem->setZValue(ubZValue.toString().toFloat());
UBGraphicsItem
::
assignZValue
(
gItem
,
ubZValue
.
toString
().
toFloat
());
}
}
UBItem
*
ubItem
=
dynamic_cast
<
UBItem
*>
(
gItem
);
UBItem
*
ubItem
=
dynamic_cast
<
UBItem
*>
(
gItem
);
...
@@ -2484,7 +2492,8 @@ UBGraphicsRuler* UBSvgSubsetAdaptor::UBSvgSubsetReader::rulerFromSvg()
...
@@ -2484,7 +2492,8 @@ UBGraphicsRuler* UBSvgSubsetAdaptor::UBSvgSubsetReader::rulerFromSvg()
graphicsItemFromSvg
(
ruler
);
graphicsItemFromSvg
(
ruler
);
ruler
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetRuler
);
// ruler->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetRuler);
UBGraphicsItem
::
assignZValue
(
ruler
,
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetRuler
);
ruler
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
ruler
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
QStringRef
svgWidth
=
mXmlReader
.
attributes
().
value
(
"width"
);
QStringRef
svgWidth
=
mXmlReader
.
attributes
().
value
(
"width"
);
...
@@ -2542,7 +2551,8 @@ UBGraphicsCompass* UBSvgSubsetAdaptor::UBSvgSubsetReader::compassFromSvg()
...
@@ -2542,7 +2551,8 @@ UBGraphicsCompass* UBSvgSubsetAdaptor::UBSvgSubsetReader::compassFromSvg()
graphicsItemFromSvg
(
compass
);
graphicsItemFromSvg
(
compass
);
compass
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetCompass
);
//compass->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCompass);
UBGraphicsItem
::
assignZValue
(
compass
,
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetCompass
);
compass
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
compass
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
QStringRef
svgX
=
mXmlReader
.
attributes
().
value
(
"x"
);
QStringRef
svgX
=
mXmlReader
.
attributes
().
value
(
"x"
);
...
@@ -2606,7 +2616,8 @@ UBGraphicsProtractor* UBSvgSubsetAdaptor::UBSvgSubsetReader::protractorFromSvg()
...
@@ -2606,7 +2616,8 @@ UBGraphicsProtractor* UBSvgSubsetAdaptor::UBSvgSubsetReader::protractorFromSvg()
{
{
UBGraphicsProtractor
*
protractor
=
new
UBGraphicsProtractor
();
UBGraphicsProtractor
*
protractor
=
new
UBGraphicsProtractor
();
protractor
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetProtractor
);
// protractor->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetProtractor);
UBGraphicsItem
::
assignZValue
(
protractor
,
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetProtractor
);
protractor
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
protractor
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
graphicsItemFromSvg
(
protractor
);
graphicsItemFromSvg
(
protractor
);
...
@@ -2676,7 +2687,8 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
...
@@ -2676,7 +2687,8 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
{
{
UBGraphicsTriangle
*
triangle
=
new
UBGraphicsTriangle
();
UBGraphicsTriangle
*
triangle
=
new
UBGraphicsTriangle
();
triangle
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetTriangle
);
// triangle->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetTriangle);
UBGraphicsItem
::
assignZValue
(
triangle
,
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetTriangle
);
triangle
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
triangle
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
graphicsItemFromSvg
(
triangle
);
graphicsItemFromSvg
(
triangle
);
...
@@ -2695,7 +2707,6 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
...
@@ -2695,7 +2707,6 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
triangle
->
setRect
(
svgX
.
toString
().
toFloat
(),
svgY
.
toString
().
toFloat
(),
svgWidth
.
toString
().
toFloat
(),
svgHeight
.
toString
().
toFloat
(),
orientation
);
triangle
->
setRect
(
svgX
.
toString
().
toFloat
(),
svgY
.
toString
().
toFloat
(),
svgWidth
.
toString
().
toFloat
(),
svgHeight
.
toString
().
toFloat
(),
orientation
);
}
}
triangle
->
setVisible
(
true
);
triangle
->
setVisible
(
true
);
return
triangle
;
return
triangle
;
}
}
...
@@ -2703,7 +2714,8 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
...
@@ -2703,7 +2714,8 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
UBGraphicsCache
*
UBSvgSubsetAdaptor
::
UBSvgSubsetReader
::
cacheFromSvg
()
UBGraphicsCache
*
UBSvgSubsetAdaptor
::
UBSvgSubsetReader
::
cacheFromSvg
()
{
{
UBGraphicsCache
*
pCache
=
new
UBGraphicsCache
();
UBGraphicsCache
*
pCache
=
new
UBGraphicsCache
();
//pCache->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCache);
pCache
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetCache
);
// UBGraphicsItem::assignZValue(pCache, UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCache);
pCache
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
pCache
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
graphicsItemFromSvg
(
pCache
);
graphicsItemFromSvg
(
pCache
);
...
...
src/board/UBBoardController.cpp
View file @
7c02a524
...
@@ -1885,7 +1885,8 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
...
@@ -1885,7 +1885,8 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
if
(
gi
)
if
(
gi
)
{
{
gi
->
setZValue
(
mActiveScene
->
getNextObjectZIndex
());
// gi->setZValue(mActiveScene->getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
gi
,
mActiveScene
->
getNextObjectZIndex
());
mActiveScene
->
addItem
(
gi
);
mActiveScene
->
addItem
(
gi
);
gi
->
setPos
(
gi
->
pos
()
+
QPointF
(
50
,
50
));
gi
->
setPos
(
gi
->
pos
()
+
QPointF
(
50
,
50
));
}
}
...
...
src/core/UB.h
View file @
7c02a524
...
@@ -78,6 +78,7 @@ struct UBGraphicsItemData
...
@@ -78,6 +78,7 @@ struct UBGraphicsItemData
ItemLayerType
ItemLayerType
,
ItemLocked
,
ItemLocked
,
ItemEditable
//for text only
,
ItemEditable
//for text only
,
ItemOwnZValue
};
};
};
};
...
...
src/domain/UBGraphicsAudioItem.cpp
View file @
7c02a524
...
@@ -95,7 +95,8 @@ UBItem* UBGraphicsAudioItem::deepCopy() const
...
@@ -95,7 +95,8 @@ UBItem* UBGraphicsAudioItem::deepCopy() const
UBGraphicsAudioItem
*
copy
=
new
UBGraphicsAudioItem
(
audioUrl
,
parentItem
());
UBGraphicsAudioItem
*
copy
=
new
UBGraphicsAudioItem
(
audioUrl
,
parentItem
());
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsDelegateFrame.cpp
View file @
7c02a524
...
@@ -531,6 +531,9 @@ void UBGraphicsDelegateFrame::positionHandles()
...
@@ -531,6 +531,9 @@ void UBGraphicsDelegateFrame::positionHandles()
{
{
setBrush
(
QBrush
(
UBSettings
::
paletteColor
));
setBrush
(
QBrush
(
UBSettings
::
paletteColor
));
}
}
//make frame interact like delegated item when selected. Maybe should be deleted if selection logic will change
setZValue
(
delegated
()
->
zValue
());
}
}
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
7c02a524
...
@@ -72,7 +72,8 @@ void UBGraphicsItemDelegate::init()
...
@@ -72,7 +72,8 @@ void UBGraphicsItemDelegate::init()
{
{
mFrame
=
new
UBGraphicsDelegateFrame
(
this
,
QRectF
(
0
,
0
,
0
,
0
),
mFrameWidth
,
mRespectRatio
);
mFrame
=
new
UBGraphicsDelegateFrame
(
this
,
QRectF
(
0
,
0
,
0
,
0
),
mFrameWidth
,
mRespectRatio
);
mFrame
->
hide
();
mFrame
->
hide
();
mFrame
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
1
);
// mFrame->setZValue(UBGraphicsScene::toolLayerStart + 1);
UBGraphicsItem
::
assignZValue
(
mFrame
,
UBGraphicsScene
::
toolLayerStart
+
1
);
mFrame
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
mFrame
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
mDeleteButton
=
new
DelegateButton
(
":/images/close.svg"
,
mDelegated
,
mFrame
);
mDeleteButton
=
new
DelegateButton
(
":/images/close.svg"
,
mDelegated
,
mFrame
);
...
@@ -92,7 +93,8 @@ void UBGraphicsItemDelegate::init()
...
@@ -92,7 +93,8 @@ void UBGraphicsItemDelegate::init()
foreach
(
DelegateButton
*
button
,
mButtons
)
foreach
(
DelegateButton
*
button
,
mButtons
)
{
{
button
->
hide
();
button
->
hide
();
button
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
2
);
// button->setZValue(UBGraphicsScene::toolLayerStart + 2);
UBGraphicsItem
::
assignZValue
(
button
,
UBGraphicsScene
::
toolLayerStart
+
2
);
button
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
button
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
}
}
}
}
...
@@ -321,12 +323,10 @@ void UBGraphicsItemDelegate::lock(bool locked)
...
@@ -321,12 +323,10 @@ void UBGraphicsItemDelegate::lock(bool locked)
if
(
locked
)
if
(
locked
)
{
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
true
));
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
true
));
qDebug
()
<<
"item's data is called for locked"
<<
mDelegated
->
data
(
UBGraphicsItemData
::
ItemLocked
);
}
}
else
else
{
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
false
));
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
false
));
qDebug
()
<<
"item's data is called for unlocked"
<<
mDelegated
->
data
(
UBGraphicsItemData
::
ItemLocked
);
}
}
mDelegated
->
update
();
mDelegated
->
update
();
...
...
src/domain/UBGraphicsItemTransformUndoCommand.cpp
View file @
7c02a524
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include "UBGraphicsItemTransformUndoCommand.h"
#include "UBGraphicsItemTransformUndoCommand.h"
#include "UBResizableGraphicsItem.h"
#include "UBResizableGraphicsItem.h"
#include "domain/UBItem.h"
#include "core/memcheck.h"
#include "core/memcheck.h"
...
@@ -49,6 +50,7 @@ void UBGraphicsItemTransformUndoCommand::undo()
...
@@ -49,6 +50,7 @@ void UBGraphicsItemTransformUndoCommand::undo()
mItem
->
setPos
(
mPreviousPosition
);
mItem
->
setPos
(
mPreviousPosition
);
mItem
->
setTransform
(
mPreviousTransform
);
mItem
->
setTransform
(
mPreviousTransform
);
mItem
->
setZValue
(
mPreviousZValue
);
mItem
->
setZValue
(
mPreviousZValue
);
// UBGraphicsItem::assignZValue(mItem, mPreviousZValue);
UBResizableGraphicsItem
*
resizableItem
=
dynamic_cast
<
UBResizableGraphicsItem
*>
(
mItem
);
UBResizableGraphicsItem
*
resizableItem
=
dynamic_cast
<
UBResizableGraphicsItem
*>
(
mItem
);
...
@@ -62,6 +64,8 @@ void UBGraphicsItemTransformUndoCommand::redo()
...
@@ -62,6 +64,8 @@ void UBGraphicsItemTransformUndoCommand::redo()
mItem
->
setTransform
(
mCurrentTransform
);
mItem
->
setTransform
(
mCurrentTransform
);
mItem
->
setZValue
(
mCurrentZValue
);
mItem
->
setZValue
(
mCurrentZValue
);
// UBGraphicsItem::assignZValue(mItem, /*mCurrentZValue*/mItem->data(UBGraphicsItemData::ItemOwnZValue).toReal());
UBResizableGraphicsItem
*
resizableItem
=
dynamic_cast
<
UBResizableGraphicsItem
*>
(
mItem
);
UBResizableGraphicsItem
*
resizableItem
=
dynamic_cast
<
UBResizableGraphicsItem
*>
(
mItem
);
if
(
resizableItem
)
if
(
resizableItem
)
...
...
src/domain/UBGraphicsPDFItem.cpp
View file @
7c02a524
...
@@ -84,7 +84,8 @@ UBItem* UBGraphicsPDFItem::deepCopy() const
...
@@ -84,7 +84,8 @@ UBItem* UBGraphicsPDFItem::deepCopy() const
UBGraphicsPDFItem
*
copy
=
new
UBGraphicsPDFItem
(
mRenderer
,
mPageNumber
,
parentItem
());
UBGraphicsPDFItem
*
copy
=
new
UBGraphicsPDFItem
(
mRenderer
,
mPageNumber
,
parentItem
());
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
@@ -134,7 +135,8 @@ UBGraphicsPixmapItem* UBGraphicsPDFItem::toPixmapItem() const
...
@@ -134,7 +135,8 @@ UBGraphicsPixmapItem* UBGraphicsPDFItem::toPixmapItem() const
pixmapItem
->
setPixmap
(
pixmap
);
pixmapItem
->
setPixmap
(
pixmap
);
pixmapItem
->
setPos
(
this
->
pos
());
pixmapItem
->
setPos
(
this
->
pos
());
pixmapItem
->
setZValue
(
this
->
zValue
());
// pixmapItem->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
pixmapItem
,
this
->
zValue
());
pixmapItem
->
setTransform
(
this
->
transform
());
pixmapItem
->
setTransform
(
this
->
transform
());
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsPixmapItem.cpp
View file @
7c02a524
...
@@ -98,7 +98,8 @@ UBItem* UBGraphicsPixmapItem::deepCopy() const
...
@@ -98,7 +98,8 @@ UBItem* UBGraphicsPixmapItem::deepCopy() const
copy
->
setPixmap
(
this
->
pixmap
());
copy
->
setPixmap
(
this
->
pixmap
());
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsPolygonItem.cpp
View file @
7c02a524
...
@@ -153,7 +153,9 @@ UBGraphicsPolygonItem* UBGraphicsPolygonItem::deepCopy(const QPolygonF& pol) con
...
@@ -153,7 +153,9 @@ UBGraphicsPolygonItem* UBGraphicsPolygonItem::deepCopy(const QPolygonF& pol) con
copy
->
setPen
(
this
->
pen
());
copy
->
setPen
(
this
->
pen
());
copy
->
mHasAlpha
=
this
->
mHasAlpha
;
copy
->
mHasAlpha
=
this
->
mHasAlpha
;
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setColorOnDarkBackground
(
this
->
colorOnDarkBackground
());
copy
->
setColorOnDarkBackground
(
this
->
colorOnDarkBackground
());
copy
->
setColorOnLightBackground
(
this
->
colorOnLightBackground
());
copy
->
setColorOnLightBackground
(
this
->
colorOnLightBackground
());
...
...
src/domain/UBGraphicsScene.cpp
View file @
7c02a524
...
@@ -60,6 +60,7 @@
...
@@ -60,6 +60,7 @@
#include "UBGraphicsStroke.h"
#include "UBGraphicsStroke.h"
#include "core/memcheck.h"
#include "core/memcheck.h"
#include "qtlogger.h"
qreal
UBGraphicsScene
::
backgroundLayerStart
=
-
20000000.0
;
qreal
UBGraphicsScene
::
backgroundLayerStart
=
-
20000000.0
;
qreal
UBGraphicsScene
::
objectLayerStart
=
-
10000000.0
;
qreal
UBGraphicsScene
::
objectLayerStart
=
-
10000000.0
;
...
@@ -75,6 +76,8 @@ qreal UBGraphicsScene::toolOffsetEraser = 200;
...
@@ -75,6 +76,8 @@ qreal UBGraphicsScene::toolOffsetEraser = 200;
qreal
UBGraphicsScene
::
toolOffsetCurtain
=
1000
;
qreal
UBGraphicsScene
::
toolOffsetCurtain
=
1000
;
qreal
UBGraphicsScene
::
toolOffsetPointer
=
1100
;
qreal
UBGraphicsScene
::
toolOffsetPointer
=
1100
;
qreal
UBGraphicsScene
::
toolOffsetCache
=
1000
;
//Didier please define offset you want
UBGraphicsScene
::
UBGraphicsScene
(
UBDocumentProxy
*
parent
)
UBGraphicsScene
::
UBGraphicsScene
(
UBDocumentProxy
*
parent
)
:
UBCoreGraphicsScene
(
parent
)
:
UBCoreGraphicsScene
(
parent
)
,
mEraser
(
0
)
,
mEraser
(
0
)
...
@@ -137,6 +140,8 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
...
@@ -137,6 +140,8 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
}
}
connect
(
this
,
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
selectionChangedProcessing
()));
connect
(
this
,
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
selectionChangedProcessing
()));
QtLogger
::
logger
().
start
(
"/home/ilia/Documents/tmp/2/log.txt"
);
QtLogger
::
logger
().
finish
();
}
}
UBGraphicsScene
::~
UBGraphicsScene
()
UBGraphicsScene
::~
UBGraphicsScene
()
...
@@ -150,12 +155,16 @@ UBGraphicsScene::~UBGraphicsScene()
...
@@ -150,12 +155,16 @@ UBGraphicsScene::~UBGraphicsScene()
void
UBGraphicsScene
::
selectionChangedProcessing
()
void
UBGraphicsScene
::
selectionChangedProcessing
()
{
{
QtLogger
::
logger
().
start
(
"/home/ilia/Documents/tmp/2/log.txt"
);
QtLogger
::
logger
()
<<
"selection processing started
\n
"
<<
endl
;
//
if (selectedItems().count())
if
(
selectedItems
().
count
())
//
UBApplication::showMessage("ZValue is " + QString::number(selectedItems().first()->zValue(), 'f'));
UBApplication
::
showMessage
(
"ZValue is "
+
QString
::
number
(
selectedItems
().
first
()
->
zValue
(),
'f'
));
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
QtLogger
::
logger
()
<<
"=====all items searching...======"
<<
endl
;
qreal
maxZ
=
0.
;
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
...
@@ -165,18 +174,29 @@ void UBGraphicsScene::selectionChangedProcessing()
...
@@ -165,18 +174,29 @@ void UBGraphicsScene::selectionChangedProcessing()
continue
;
continue
;
//Temporary stub end (sankore 360)
//Temporary stub end (sankore 360)
// qreal zValue = nextItem->zValue();
// qreal zValue = nextItem->zValue();
nextItem
->
setZValue
(
qreal
(
1
));
if
(
nextItem
->
zValue
()
>
maxZ
)
maxZ
=
nextItem
->
zValue
();
nextItem
->
setZValue
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
// nextItem->setZValue(qreal(1));
QtLogger
::
logger
()
<<
"own Z "
<<
QString
::
number
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
(),
'f'
)
<<
" next Z "
<<
QString
::
number
(
nextItem
->
zValue
(),
'f'
)
<<
endl
;
// qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue);
// qDebug() << QString(" %1 ").arg(i) << QString(" %1 ").arg(zValue);
}
}
QList
<
QGraphicsItem
*>
selItemsList
=
selectedItems
();
QList
<
QGraphicsItem
*>
selItemsList
=
selectedItems
();
QtLogger
::
logger
()
<<
"=====selected items searching...======"
<<
endl
;
// QGraphicsItem *nextItem;
for
(
int
i
=
0
;
i
<
selItemsList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
selItemsList
.
size
();
i
++
)
{
{
QGraphicsItem
*
nextItem
=
selItemsList
.
at
(
i
);
QGraphicsItem
*
nextItem
=
selItemsList
.
at
(
i
);
QtLogger
::
logger
()
<<
"own Z "
<<
QString
::
number
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
(),
'f'
)
<<
" next Z "
<<
QString
::
number
(
nextItem
->
zValue
(),
'f'
)
<<
endl
;
// qreal zValue = nextItem->zValue();
// qreal zValue = nextItem->zValue();
nextItem
->
setZValue
(
2
);
nextItem
->
setZValue
(
maxZ
+
0.0001
);
// qDebug() << QString(" >>> %1 <<< ").arg(i) << QString(" >>> %1 <<< ").arg(zValue);
// qDebug() << QString(" >>> %1 <<< ").arg(i) << QString(" >>> %1 <<< ").arg(zValue);
}
}
QtLogger
::
logger
()
<<
"
\n
selection processing finished"
<<
endl
;
QtLogger
::
logger
().
finish
();
}
}
// MARK: -
// MARK: -
...
@@ -407,23 +427,23 @@ void UBGraphicsScene::drawEraser(const QPointF &pPoint, bool isFirstDraw)
...
@@ -407,23 +427,23 @@ void UBGraphicsScene::drawEraser(const QPointF &pPoint, bool isFirstDraw)
if
(
isFirstDraw
)
if
(
isFirstDraw
)
{
{
qreal
maxZ
=
0.
;
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
qreal
zValue
=
nextItem
->
zValue
();
qreal
zValue
=
nextItem
->
zValue
();
nextItem
->
setZValue
(
qreal
(
1
));
if
(
zValue
>
maxZ
)
qDebug
()
<<
QString
(
" %1 "
).
arg
(
i
)
<<
QString
(
" %1 "
).
arg
(
zValue
);
maxZ
=
zValue
;
nextItem
->
setZValue
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
}
}
mEraser
->
setZValue
(
2
);
mEraser
->
setZValue
(
maxZ
+
0.0001
);
mEraser
->
show
();
mEraser
->
show
();
}
}
}
}
}
}
void
UBGraphicsScene
::
drawPointer
(
const
QPointF
&
pPoint
,
bool
isFirstDraw
)
void
UBGraphicsScene
::
drawPointer
(
const
QPointF
&
pPoint
,
bool
isFirstDraw
)
{
{
qreal
pointerDiameter
=
UBSettings
::
pointerDiameter
/
UBApplication
::
boardController
->
currentZoom
();
qreal
pointerDiameter
=
UBSettings
::
pointerDiameter
/
UBApplication
::
boardController
->
currentZoom
();
...
@@ -439,19 +459,20 @@ void UBGraphicsScene::drawPointer(const QPointF &pPoint, bool isFirstDraw)
...
@@ -439,19 +459,20 @@ void UBGraphicsScene::drawPointer(const QPointF &pPoint, bool isFirstDraw)
if
(
isFirstDraw
)
if
(
isFirstDraw
)
{
{
qreal
maxZ
=
0.
;
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
qreal
zValue
=
nextItem
->
zValue
();
qreal
zValue
=
nextItem
->
zValue
();
nextItem
->
setZValue
(
qreal
(
1
));
if
(
zValue
>
maxZ
)
qDebug
()
<<
QString
(
" %1 "
).
arg
(
i
)
<<
QString
(
" %1 "
).
arg
(
zValue
);
maxZ
=
zValue
;
nextItem
->
setZValue
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
}
}
mPointer
->
setZValue
(
2
);
mPointer
->
setZValue
(
maxZ
+
0.0001
);
mPointer
->
show
();
mPointer
->
show
();
}
}
}
}
}
}
...
@@ -824,8 +845,8 @@ void UBGraphicsScene::initPolygonItem(UBGraphicsPolygonItem* polygonItem)
...
@@ -824,8 +845,8 @@ void UBGraphicsScene::initPolygonItem(UBGraphicsPolygonItem* polygonItem)
polygonItem
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Graphic
));
polygonItem
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Graphic
));
polygonItem
->
setZValue
(
getNextDrawingZIndex
());
//
polygonItem->setZValue(getNextDrawingZIndex());
UBGraphicsItem
::
assignZValue
(
polygonItem
,
getNextDrawingZIndex
());
}
}
...
@@ -1035,7 +1056,8 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const Q
...
@@ -1035,7 +1056,8 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const Q
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
pixmapItem
->
setZValue
(
getNextObjectZIndex
());
// pixmapItem->setZValue(getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
pixmapItem
,
getNextObjectZIndex
());
pixmapItem
->
setPixmap
(
pPixmap
);
pixmapItem
->
setPixmap
(
pPixmap
);
...
@@ -1083,7 +1105,8 @@ UBGraphicsVideoItem* UBGraphicsScene::addVideo(const QUrl& pVideoFileUrl, bool s
...
@@ -1083,7 +1105,8 @@ UBGraphicsVideoItem* UBGraphicsScene::addVideo(const QUrl& pVideoFileUrl, bool s
videoItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
videoItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
videoItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
videoItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
videoItem
->
setZValue
(
getNextObjectZIndex
());
// videoItem->setZValue(getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
videoItem
,
getNextObjectZIndex
());
addItem
(
videoItem
);
addItem
(
videoItem
);
...
@@ -1113,7 +1136,8 @@ UBGraphicsAudioItem* UBGraphicsScene::addAudio(const QUrl& pAudioFileUrl, bool s
...
@@ -1113,7 +1136,8 @@ UBGraphicsAudioItem* UBGraphicsScene::addAudio(const QUrl& pAudioFileUrl, bool s
audioItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
audioItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
audioItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
audioItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
audioItem
->
setZValue
(
getNextObjectZIndex
());
// audioItem->setZValue(getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
audioItem
,
getNextObjectZIndex
());
addItem
(
audioItem
);
addItem
(
audioItem
);
...
@@ -1178,7 +1202,8 @@ UBGraphicsW3CWidgetItem* UBGraphicsScene::addW3CWidget(const QUrl& pWidgetUrl, c
...
@@ -1178,7 +1202,8 @@ UBGraphicsW3CWidgetItem* UBGraphicsScene::addW3CWidget(const QUrl& pWidgetUrl, c
void
UBGraphicsScene
::
addGraphicsWidget
(
UBGraphicsWidgetItem
*
graphicsWidget
,
const
QPointF
&
pPos
)
void
UBGraphicsScene
::
addGraphicsWidget
(
UBGraphicsWidgetItem
*
graphicsWidget
,
const
QPointF
&
pPos
)
{
{
graphicsWidget
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
graphicsWidget
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
graphicsWidget
->
setZValue
(
getNextObjectZIndex
());
// graphicsWidget->setZValue(getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
graphicsWidget
,
getNextObjectZIndex
());
addItem
(
graphicsWidget
);
addItem
(
graphicsWidget
);
...
@@ -1238,7 +1263,8 @@ UBGraphicsSvgItem* UBGraphicsScene::addSvg(const QUrl& pSvgFileUrl, const QPoint
...
@@ -1238,7 +1263,8 @@ UBGraphicsSvgItem* UBGraphicsScene::addSvg(const QUrl& pSvgFileUrl, const QPoint
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
svgItem
->
setZValue
(
getNextObjectZIndex
());
// svgItem->setZValue(getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
svgItem
,
getNextObjectZIndex
());
qreal
sscale
=
1
/
UBApplication
::
boardController
->
systemScaleFactor
();
qreal
sscale
=
1
/
UBApplication
::
boardController
->
systemScaleFactor
();
svgItem
->
scale
(
sscale
,
sscale
);
svgItem
->
scale
(
sscale
,
sscale
);
...
@@ -1271,7 +1297,8 @@ UBGraphicsTextItem* UBGraphicsScene::addTextWithFont(const QString& pString, con
...
@@ -1271,7 +1297,8 @@ UBGraphicsTextItem* UBGraphicsScene::addTextWithFont(const QString& pString, con
{
{
UBGraphicsTextItem
*
textItem
=
new
UBGraphicsTextItem
();
UBGraphicsTextItem
*
textItem
=
new
UBGraphicsTextItem
();
textItem
->
setPlainText
(
pString
);
textItem
->
setPlainText
(
pString
);
textItem
->
setZValue
(
getNextObjectZIndex
());
// textItem->setZValue(getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
textItem
,
getNextObjectZIndex
());
QFont
font
=
textItem
->
font
();
QFont
font
=
textItem
->
font
();
...
@@ -1326,7 +1353,8 @@ UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString, const Q
...
@@ -1326,7 +1353,8 @@ UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString, const Q
UBGraphicsTextItem
*
textItem
=
new
UBGraphicsTextItem
();
UBGraphicsTextItem
*
textItem
=
new
UBGraphicsTextItem
();
textItem
->
setPlainText
(
""
);
textItem
->
setPlainText
(
""
);
textItem
->
setHtml
(
pString
);
textItem
->
setHtml
(
pString
);
textItem
->
setZValue
(
getNextObjectZIndex
());
// textItem->setZValue(getNextObjectZIndex());
UBGraphicsItem
::
assignZValue
(
textItem
,
getNextObjectZIndex
());
addItem
(
textItem
);
addItem
(
textItem
);
textItem
->
show
();
textItem
->
show
();
...
@@ -1337,7 +1365,6 @@ UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString, const Q
...
@@ -1337,7 +1365,6 @@ UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString, const Q
connect
(
textItem
,
SIGNAL
(
textUndoCommandAdded
(
UBGraphicsTextItem
*
)),
connect
(
textItem
,
SIGNAL
(
textUndoCommandAdded
(
UBGraphicsTextItem
*
)),
this
,
SLOT
(
textUndoCommandAdded
(
UBGraphicsTextItem
*
)));
this
,
SLOT
(
textUndoCommandAdded
(
UBGraphicsTextItem
*
)));
// textItem->setSelected(true);
textItem
->
setFocus
();
textItem
->
setFocus
();
setDocumentUpdated
();
setDocumentUpdated
();
...
@@ -1425,7 +1452,8 @@ QGraphicsItem* UBGraphicsScene::setAsBackgroundObject(QGraphicsItem* item, bool
...
@@ -1425,7 +1452,8 @@ QGraphicsItem* UBGraphicsScene::setAsBackgroundObject(QGraphicsItem* item, bool
item
->
setAcceptedMouseButtons
(
Qt
::
NoButton
);
item
->
setAcceptedMouseButtons
(
Qt
::
NoButton
);
item
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
UBItemLayerType
::
FixedBackground
);
item
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
UBItemLayerType
::
FixedBackground
);
item
->
setZValue
(
backgroundLayerStart
);
// item->setZValue(backgroundLayerStart);
UBGraphicsItem
::
assignZValue
(
item
,
backgroundLayerStart
);
if
(
pAdaptTransformation
)
if
(
pAdaptTransformation
)
{
{
...
@@ -1529,7 +1557,9 @@ void UBGraphicsScene::addRuler(QPointF center)
...
@@ -1529,7 +1557,9 @@ void UBGraphicsScene::addRuler(QPointF center)
QRectF
rect
=
ruler
->
rect
();
QRectF
rect
=
ruler
->
rect
();
ruler
->
setRect
(
center
.
x
()
-
rect
.
width
()
/
2
,
center
.
y
()
-
rect
.
height
()
/
2
,
rect
.
width
(),
rect
.
height
());
ruler
->
setRect
(
center
.
x
()
-
rect
.
width
()
/
2
,
center
.
y
()
-
rect
.
height
()
/
2
,
rect
.
width
(),
rect
.
height
());
ruler
->
setZValue
(
toolLayerStart
+
toolOffsetRuler
);
// ruler->setZValue(toolLayerStart + toolOffsetRuler);
UBGraphicsItem
::
assignZValue
(
ruler
,
toolLayerStart
+
toolOffsetRuler
);
ruler
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
ruler
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
addItem
(
ruler
);
addItem
(
ruler
);
...
@@ -1546,7 +1576,9 @@ void UBGraphicsScene::addProtractor(QPointF center)
...
@@ -1546,7 +1576,9 @@ void UBGraphicsScene::addProtractor(QPointF center)
UBGraphicsProtractor
*
protractor
=
new
UBGraphicsProtractor
();
// mem : owned and destroyed by the scene
UBGraphicsProtractor
*
protractor
=
new
UBGraphicsProtractor
();
// mem : owned and destroyed by the scene
mTools
<<
protractor
;
mTools
<<
protractor
;
protractor
->
setZValue
(
toolLayerStart
+
toolOffsetProtractor
);
// protractor->setZValue(toolLayerStart + toolOffsetProtractor);
UBGraphicsItem
::
assignZValue
(
protractor
,
toolLayerStart
+
toolOffsetProtractor
);
protractor
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
protractor
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
addItem
(
protractor
);
addItem
(
protractor
);
...
@@ -1565,7 +1597,9 @@ void UBGraphicsScene::addTriangle(QPointF center)
...
@@ -1565,7 +1597,9 @@ void UBGraphicsScene::addTriangle(QPointF center)
UBGraphicsTriangle
*
triangle
=
new
UBGraphicsTriangle
();
// mem : owned and destroyed by the scene
UBGraphicsTriangle
*
triangle
=
new
UBGraphicsTriangle
();
// mem : owned and destroyed by the scene
mTools
<<
triangle
;
mTools
<<
triangle
;
triangle
->
setZValue
(
toolLayerStart
+
toolOffsetProtractor
);
// triangle->setZValue(toolLayerStart + toolOffsetProtractor);
UBGraphicsItem
::
assignZValue
(
triangle
,
toolLayerStart
+
toolOffsetTriangle
);
triangle
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
triangle
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
addItem
(
triangle
);
addItem
(
triangle
);
...
@@ -1700,7 +1734,9 @@ void UBGraphicsScene::addCompass(QPointF center)
...
@@ -1700,7 +1734,9 @@ void UBGraphicsScene::addCompass(QPointF center)
QRectF
rect
=
compass
->
rect
();
QRectF
rect
=
compass
->
rect
();
compass
->
setRect
(
center
.
x
()
-
rect
.
width
()
/
2
,
center
.
y
()
-
rect
.
height
()
/
2
,
rect
.
width
(),
rect
.
height
());
compass
->
setRect
(
center
.
x
()
-
rect
.
width
()
/
2
,
center
.
y
()
-
rect
.
height
()
/
2
,
rect
.
width
(),
rect
.
height
());
compass
->
setZValue
(
toolLayerStart
+
toolOffsetCompass
);
// compass->setZValue(toolLayerStart + toolOffsetCompass);
UBGraphicsItem
::
assignZValue
(
compass
,
toolLayerStart
+
toolOffsetCompass
);
compass
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
compass
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
compass
->
setVisible
(
true
);
compass
->
setVisible
(
true
);
...
@@ -1740,7 +1776,10 @@ void UBGraphicsScene::addMask()
...
@@ -1740,7 +1776,10 @@ void UBGraphicsScene::addMask()
view
=
(
QGraphicsView
*
)
UBApplication
::
boardController
->
controlView
();
view
=
(
QGraphicsView
*
)
UBApplication
::
boardController
->
controlView
();
QPolygonF
polygon
=
view
->
mapToScene
(
view
->
rect
());
QPolygonF
polygon
=
view
->
mapToScene
(
view
->
rect
());
curtain
->
setZValue
(
toolLayerStart
+
toolOffsetCurtain
);
// curtain->setZValue(toolLayerStart + toolOffsetCurtain);
UBGraphicsItem
::
assignZValue
(
curtain
,
toolLayerStart
+
toolOffsetCurtain
);
QRectF
rect
=
polygon
.
boundingRect
();
QRectF
rect
=
polygon
.
boundingRect
();
qreal
xScale
=
view
->
matrix
().
m11
();
qreal
xScale
=
view
->
matrix
().
m11
();
qreal
yScale
=
view
->
matrix
().
m22
();
qreal
yScale
=
view
->
matrix
().
m22
();
...
...
src/domain/UBGraphicsSvgItem.cpp
View file @
7c02a524
...
@@ -132,7 +132,8 @@ UBItem* UBGraphicsSvgItem::deepCopy() const
...
@@ -132,7 +132,8 @@ UBItem* UBGraphicsSvgItem::deepCopy() const
UBGraphicsSvgItem
*
copy
=
new
UBGraphicsSvgItem
(
this
->
fileData
());
UBGraphicsSvgItem
*
copy
=
new
UBGraphicsSvgItem
(
this
->
fileData
());
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
@@ -186,7 +187,8 @@ UBGraphicsPixmapItem* UBGraphicsSvgItem::toPixmapItem() const
...
@@ -186,7 +187,8 @@ UBGraphicsPixmapItem* UBGraphicsSvgItem::toPixmapItem() const
pixmapItem
->
setPixmap
(
QPixmap
::
fromImage
(
image
));
pixmapItem
->
setPixmap
(
QPixmap
::
fromImage
(
image
));
pixmapItem
->
setPos
(
this
->
pos
());
pixmapItem
->
setPos
(
this
->
pos
());
pixmapItem
->
setZValue
(
this
->
zValue
());
// pixmapItem->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
pixmapItem
,
this
->
zValue
());
pixmapItem
->
setTransform
(
this
->
transform
());
pixmapItem
->
setTransform
(
this
->
transform
());
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
pixmapItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsTextItem.cpp
View file @
7c02a524
...
@@ -205,7 +205,8 @@ UBItem* UBGraphicsTextItem::deepCopy() const
...
@@ -205,7 +205,8 @@ UBItem* UBGraphicsTextItem::deepCopy() const
copy
->
setHtml
(
toHtml
());
copy
->
setHtml
(
toHtml
());
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsVideoItem.cpp
View file @
7c02a524
...
@@ -68,7 +68,8 @@ UBItem* UBGraphicsVideoItem::deepCopy() const
...
@@ -68,7 +68,8 @@ UBItem* UBGraphicsVideoItem::deepCopy() const
UBGraphicsVideoItem
*
copy
=
new
UBGraphicsVideoItem
(
videoUrl
,
parentItem
());
UBGraphicsVideoItem
*
copy
=
new
UBGraphicsVideoItem
(
videoUrl
,
parentItem
());
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsVideoItemDelegate.cpp
View file @
7c02a524
...
@@ -52,7 +52,8 @@ void UBGraphicsVideoItemDelegate::buildButtons()
...
@@ -52,7 +52,8 @@ void UBGraphicsVideoItemDelegate::buildButtons()
mMuteButton
->
hide
();
mMuteButton
->
hide
();
mVideoControl
=
new
DelegateVideoControl
(
delegated
(),
mFrame
);
mVideoControl
=
new
DelegateVideoControl
(
delegated
(),
mFrame
);
mVideoControl
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
2
);
// mVideoControl->setZValue(UBGraphicsScene::toolLayerStart + 2);
UBGraphicsItem
::
assignZValue
(
mVideoControl
,
UBGraphicsScene
::
toolLayerStart
+
2
);
mVideoControl
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
mVideoControl
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
connect
(
mPlayPauseButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
togglePlayPause
()));
connect
(
mPlayPauseButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
togglePlayPause
()));
...
...
src/domain/UBGraphicsWidgetItem.cpp
View file @
7c02a524
...
@@ -366,7 +366,8 @@ UBItem* UBGraphicsW3CWidgetItem::deepCopy() const
...
@@ -366,7 +366,8 @@ UBItem* UBGraphicsW3CWidgetItem::deepCopy() const
UBGraphicsW3CWidgetItem
*
copy
=
new
UBGraphicsW3CWidgetItem
(
mWebKitWidget
->
widgetUrl
(),
parentItem
());
UBGraphicsW3CWidgetItem
*
copy
=
new
UBGraphicsW3CWidgetItem
(
mWebKitWidget
->
widgetUrl
(),
parentItem
());
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBItem.cpp
View file @
7c02a524
...
@@ -28,3 +28,9 @@ UBItem::~UBItem()
...
@@ -28,3 +28,9 @@ UBItem::~UBItem()
{
{
// NOOP
// NOOP
}
}
void
UBGraphicsItem
::
assignZValue
(
QGraphicsItem
*
item
,
int
value
)
{
item
->
setZValue
(
value
);
item
->
setData
(
UBGraphicsItemData
::
ItemOwnZValue
,
value
);
}
src/domain/UBItem.h
View file @
7c02a524
...
@@ -100,6 +100,7 @@ protected:
...
@@ -100,6 +100,7 @@ protected:
public
:
public
:
static
void
assignZValue
(
QGraphicsItem
*
,
int
value
);
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
=
0
;
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
=
0
;
virtual
void
remove
()
=
0
;
virtual
void
remove
()
=
0
;
...
...
src/gui/UBLibraryWidget.cpp
View file @
7c02a524
...
@@ -39,9 +39,9 @@
...
@@ -39,9 +39,9 @@
*/
*/
UBLibraryWidget
::
UBLibraryWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBThumbnailWidget
(
parent
)
UBLibraryWidget
::
UBLibraryWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBThumbnailWidget
(
parent
)
,
chainedElements
(
NULL
)
,
chainedElements
(
NULL
)
,
mLibraryController
(
NULL
)
,
mpCrntDir
(
NULL
)
,
mpCrntDir
(
NULL
)
,
mpCrntElem
(
NULL
)
,
mpCrntElem
(
NULL
)
,
mLibraryController
(
NULL
)
,
mpTmpElem
(
NULL
)
,
mpTmpElem
(
NULL
)
{
{
setObjectName
(
name
);
setObjectName
(
name
);
...
...
src/gui/UBThumbnailWidget.h
View file @
7c02a524
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "frameworks/UBCoreGraphicsScene.h"
#include "frameworks/UBCoreGraphicsScene.h"
#include "core/UBSettings.h"
#include "core/UBSettings.h"
#include "domain/UBItem.h"
#define STARTDRAGTIME 1000000
#define STARTDRAGTIME 1000000
#define BUTTONSIZE 48
#define BUTTONSIZE 48
...
@@ -148,6 +149,7 @@ class UBThumbnail
...
@@ -148,6 +149,7 @@ class UBThumbnail
{
{
item
->
scene
()
->
addItem
(
mSelectionItem
);
item
->
scene
()
->
addItem
(
mSelectionItem
);
mSelectionItem
->
setZValue
(
item
->
zValue
()
-
1
);
mSelectionItem
->
setZValue
(
item
->
zValue
()
-
1
);
// UBGraphicsItem::assignZValue(mSelectionItem, item->zValue() - 1);
mAddedToScene
=
true
;
mAddedToScene
=
true
;
}
}
...
...
src/pdf-merger/Object.h
View file @
7c02a524
...
@@ -48,7 +48,7 @@ namespace merge_lib
...
@@ -48,7 +48,7 @@ namespace merge_lib
std
::
string
fileName
=
""
,
std
::
pair
<
unsigned
int
,
unsigned
int
>
streamBounds
=
std
::
make_pair
((
unsigned
int
)
0
,(
unsigned
int
)
0
),
bool
hasStream
=
false
std
::
string
fileName
=
""
,
std
::
pair
<
unsigned
int
,
unsigned
int
>
streamBounds
=
std
::
make_pair
((
unsigned
int
)
0
,(
unsigned
int
)
0
),
bool
hasStream
=
false
)
:
)
:
_number
(
objectNumber
),
_generationNumber
(
generationNumber
),
_oldNumber
(
objectNumber
),
_content
(
objectContent
),
_parents
(),
_children
(),
_isPassed
(
false
),
_number
(
objectNumber
),
_generationNumber
(
generationNumber
),
_oldNumber
(
objectNumber
),
_content
(
objectContent
),
_parents
(),
_children
(),
_isPassed
(
false
),
_fileName
(
fileName
),
_streamBounds
(
streamBounds
),
_hasStream
(
hasStream
),
_hasStreamInContent
(
false
)
_streamBounds
(
streamBounds
),
_fileName
(
fileName
),
_hasStream
(
hasStream
),
_hasStreamInContent
(
false
)
{
{
}
}
virtual
~
Object
();
virtual
~
Object
();
...
...
src/tools/UBGraphicsCache.cpp
View file @
7c02a524
...
@@ -33,7 +33,8 @@ UBGraphicsCache::UBGraphicsCache():QGraphicsRectItem()
...
@@ -33,7 +33,8 @@ UBGraphicsCache::UBGraphicsCache():QGraphicsRectItem()
// Get the board size and pass it to the shape
// Get the board size and pass it to the shape
QRect
boardRect
=
UBApplication
::
boardController
->
displayView
()
->
rect
();
QRect
boardRect
=
UBApplication
::
boardController
->
displayView
()
->
rect
();
setRect
(
-
15
*
boardRect
.
width
(),
-
15
*
boardRect
.
height
(),
30
*
boardRect
.
width
(),
30
*
boardRect
.
height
());
setRect
(
-
15
*
boardRect
.
width
(),
-
15
*
boardRect
.
height
(),
30
*
boardRect
.
width
(),
30
*
boardRect
.
height
());
setZValue
(
CACHE_ZVALUE
);
// setZValue(CACHE_ZVALUE);
UBGraphicsItem
::
assignZValue
(
this
,
CACHE_ZVALUE
);
setData
(
Qt
::
UserRole
,
QVariant
(
"Cache"
));
setData
(
Qt
::
UserRole
,
QVariant
(
"Cache"
));
}
}
...
@@ -48,7 +49,8 @@ UBItem* UBGraphicsCache::deepCopy() const
...
@@ -48,7 +49,8 @@ UBItem* UBGraphicsCache::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setRect
(
this
->
rect
());
copy
->
setRect
(
this
->
rect
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
...
@@ -90,7 +92,8 @@ void UBGraphicsCache::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
...
@@ -90,7 +92,8 @@ void UBGraphicsCache::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
//Q_UNUSED(option);
//Q_UNUSED(option);
Q_UNUSED
(
widget
);
Q_UNUSED
(
widget
);
setZValue
(
CACHE_ZVALUE
);
// setZValue(CACHE_ZVALUE);
UBGraphicsItem
::
assignZValue
(
this
,
CACHE_ZVALUE
);
painter
->
setBrush
(
mMaskColor
);
painter
->
setBrush
(
mMaskColor
);
painter
->
setPen
(
mMaskColor
);
painter
->
setPen
(
mMaskColor
);
...
...
src/tools/UBGraphicsCompass.cpp
View file @
7c02a524
...
@@ -85,7 +85,8 @@ UBItem* UBGraphicsCompass::deepCopy() const
...
@@ -85,7 +85,8 @@ UBItem* UBGraphicsCompass::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setRect
(
this
->
rect
());
copy
->
setRect
(
this
->
rect
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
...
...
src/tools/UBGraphicsCurtainItem.cpp
View file @
7c02a524
...
@@ -57,8 +57,8 @@ UBGraphicsCurtainItem::~UBGraphicsCurtainItem()
...
@@ -57,8 +57,8 @@ UBGraphicsCurtainItem::~UBGraphicsCurtainItem()
QVariant
UBGraphicsCurtainItem
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
QVariant
UBGraphicsCurtainItem
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
{
{
if
(
change
==
QGraphicsItem
::
ItemSelectedHasChanged
&&
QGraphicsRectItem
::
scene
()
&&
isSelected
())
//
if (change == QGraphicsItem::ItemSelectedHasChanged && QGraphicsRectItem::scene() && isSelected())
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetCurtain
);
//
setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCurtain);
QVariant
newValue
=
value
;
QVariant
newValue
=
value
;
...
@@ -130,7 +130,8 @@ UBItem* UBGraphicsCurtainItem::deepCopy() const
...
@@ -130,7 +130,8 @@ UBItem* UBGraphicsCurtainItem::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setBrush
(
this
->
brush
());
copy
->
setBrush
(
this
->
brush
());
copy
->
setPen
(
this
->
pen
());
copy
->
setPen
(
this
->
pen
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/tools/UBGraphicsCurtainItemDelegate.cpp
View file @
7c02a524
...
@@ -52,7 +52,7 @@ bool UBGraphicsCurtainItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *ev
...
@@ -52,7 +52,7 @@ bool UBGraphicsCurtainItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *ev
if
(
!
mDelegated
->
isSelected
())
if
(
!
mDelegated
->
isSelected
())
{
{
mDelegated
->
setSelected
(
true
);
mDelegated
->
setSelected
(
true
);
mDelegated
->
setZValue
(
UBGraphicsScene
::
toolLayerStart
+
UBGraphicsScene
::
toolOffsetCurtain
);
//
mDelegated->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCurtain);
positionHandles
();
positionHandles
();
return
true
;
return
true
;
...
@@ -69,13 +69,13 @@ QVariant UBGraphicsCurtainItemDelegate::itemChange(QGraphicsItem::GraphicsItemCh
...
@@ -69,13 +69,13 @@ QVariant UBGraphicsCurtainItemDelegate::itemChange(QGraphicsItem::GraphicsItemCh
{
{
if
(
change
==
QGraphicsItem
::
ItemZValueHasChanged
)
if
(
change
==
QGraphicsItem
::
ItemZValueHasChanged
)
{
{
mFrame
->
setZValue
(
mDelegated
->
zValue
()
+
1
);
//
mFrame->setZValue(mDelegated->zValue() + 1);
foreach
(
DelegateButton
*
button
,
mButtons
)
//
foreach(DelegateButton* button, mButtons)
{
//
{
button
->
setZValue
(
mDelegated
->
zValue
()
+
2
);
//
button->setZValue(mDelegated->zValue() + 2);
button
->
setZValue
(
mDelegated
->
zValue
()
+
2
);
//
button->setZValue(mDelegated->zValue() + 2);
}
//
}
}
}
if
(
change
==
QGraphicsItem
::
ItemVisibleHasChanged
)
if
(
change
==
QGraphicsItem
::
ItemVisibleHasChanged
)
...
...
src/tools/UBGraphicsProtractor.cpp
View file @
7c02a524
...
@@ -580,7 +580,8 @@ UBItem* UBGraphicsProtractor::deepCopy() const
...
@@ -580,7 +580,8 @@ UBItem* UBGraphicsProtractor::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setRect
(
this
->
rect
());
copy
->
setRect
(
this
->
rect
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
copy
->
mCurrentAngle
=
this
->
mCurrentAngle
;
copy
->
mCurrentAngle
=
this
->
mCurrentAngle
;
...
...
src/tools/UBGraphicsRuler.cpp
View file @
7c02a524
...
@@ -74,7 +74,8 @@ UBItem* UBGraphicsRuler::deepCopy() const
...
@@ -74,7 +74,8 @@ UBItem* UBGraphicsRuler::deepCopy() const
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setRect
(
this
->
rect
());
copy
->
setRect
(
this
->
rect
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
...
...
src/tools/UBGraphicsTriangle.cpp
View file @
7c02a524
...
@@ -93,7 +93,8 @@ UBItem* UBGraphicsTriangle::deepCopy(void) const
...
@@ -93,7 +93,8 @@ UBItem* UBGraphicsTriangle::deepCopy(void) const
copy
->
setPos
(
this
->
pos
());
copy
->
setPos
(
this
->
pos
());
copy
->
setPolygon
(
this
->
polygon
());
copy
->
setPolygon
(
this
->
polygon
());
copy
->
setZValue
(
this
->
zValue
());
// copy->setZValue(this->zValue());
UBGraphicsItem
::
assignZValue
(
copy
,
this
->
zValue
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
// 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