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
408811c5
Commit
408811c5
authored
May 21, 2012
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group fixes Uuid data
parent
2e3d33cc
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
160 additions
and
73 deletions
+160
-73
UBBoardController.cpp
src/board/UBBoardController.cpp
+29
-0
UBBoardController.h
src/board/UBBoardController.h
+1
-0
UBSettings.cpp
src/core/UBSettings.cpp
+3
-0
UBSettings.h
src/core/UBSettings.h
+4
-1
UBGraphicsAudioItem.cpp
src/domain/UBGraphicsAudioItem.cpp
+6
-0
UBGraphicsAudioItem.h
src/domain/UBGraphicsAudioItem.h
+1
-0
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+1
-1
UBGraphicsPDFItem.cpp
src/domain/UBGraphicsPDFItem.cpp
+5
-0
UBGraphicsPDFItem.h
src/domain/UBGraphicsPDFItem.h
+1
-0
UBGraphicsPixmapItem.cpp
src/domain/UBGraphicsPixmapItem.cpp
+6
-0
UBGraphicsPixmapItem.h
src/domain/UBGraphicsPixmapItem.h
+2
-0
UBGraphicsProxyWidget.cpp
src/domain/UBGraphicsProxyWidget.cpp
+5
-0
UBGraphicsProxyWidget.h
src/domain/UBGraphicsProxyWidget.h
+1
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+36
-66
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+3
-3
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+6
-0
UBGraphicsStrokesGroup.h
src/domain/UBGraphicsStrokesGroup.h
+1
-0
UBGraphicsTextItem.cpp
src/domain/UBGraphicsTextItem.cpp
+6
-0
UBGraphicsTextItem.h
src/domain/UBGraphicsTextItem.h
+1
-0
UBGraphicsVideoItem.cpp
src/domain/UBGraphicsVideoItem.cpp
+6
-0
UBGraphicsVideoItem.h
src/domain/UBGraphicsVideoItem.h
+1
-0
UBGraphicsWidgetItem.cpp
src/domain/UBGraphicsWidgetItem.cpp
+16
-1
UBGraphicsWidgetItem.h
src/domain/UBGraphicsWidgetItem.h
+3
-0
ubgraphicsgroupcontaineritem.cpp
src/domain/ubgraphicsgroupcontaineritem.cpp
+6
-0
ubgraphicsgroupcontaineritem.h
src/domain/ubgraphicsgroupcontaineritem.h
+1
-0
UBGraphicsCurtainItem.cpp
src/tools/UBGraphicsCurtainItem.cpp
+6
-0
UBGraphicsCurtainItem.h
src/tools/UBGraphicsCurtainItem.h
+3
-1
No files found.
src/board/UBBoardController.cpp
View file @
408811c5
...
...
@@ -50,6 +50,7 @@
#include "domain/UBW3CWidget.h"
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBPageSizeUndoCommand.h"
#include "domain/ubgraphicsgroupcontaineritem.h"
#include "tools/UBToolsManager.h"
...
...
@@ -140,6 +141,8 @@ void UBBoardController::init()
setActiveDocumentScene
(
doc
);
connect
(
UBApplication
::
mainWindow
->
actionGroupItems
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
groupButtonClicked
()));
undoRedoStateChange
(
true
);
}
...
...
@@ -760,6 +763,32 @@ void UBBoardController::lastScene()
emit
pageChanged
();
}
void
UBBoardController
::
groupButtonClicked
()
{
QAction
*
groupAction
=
UBApplication
::
mainWindow
->
actionGroupItems
;
QList
<
QGraphicsItem
*>
selItems
=
activeScene
()
->
selectedItems
();
if
(
!
selItems
.
count
())
{
qDebug
()
<<
"Got grouping request when there is no any selected item on the scene"
;
return
;
}
if
(
groupAction
->
text
()
==
UBSettings
::
settings
()
->
actionGroupText
)
{
//The only way to get information from item, considering using smth else
UBGraphicsGroupContainerItem
*
groupItem
=
activeScene
()
->
createGroup
(
selItems
);
groupItem
->
setSelected
(
true
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
}
else
if
(
groupAction
->
text
()
==
UBSettings
::
settings
()
->
actionUngroupText
)
{
//Considering one selected item and it's a group
if
(
selItems
.
count
()
>
1
)
{
qDebug
()
<<
"can't make sense of ungrouping more then one item. Grouping action should be performed for that purpose"
;
return
;
}
UBGraphicsGroupContainerItem
*
currentGroup
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
selItems
.
first
());
if
(
currentGroup
)
{
currentGroup
->
destroy
();
}
}
}
void
UBBoardController
::
downloadURL
(
const
QUrl
&
url
,
const
QPointF
&
pPos
,
const
QSize
&
pSize
,
bool
isBackground
)
{
...
...
src/board/UBBoardController.h
View file @
408811c5
...
...
@@ -184,6 +184,7 @@ class UBBoardController : public QObject
void
nextScene
();
void
firstScene
();
void
lastScene
();
void
groupButtonClicked
();
void
downloadURL
(
const
QUrl
&
url
,
const
QPointF
&
pPos
=
QPointF
(
0
.
0
,
0
.
0
),
const
QSize
&
pSize
=
QSize
(),
bool
isBackground
=
false
);
void
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
=
false
);
void
changeBackground
(
bool
isDark
,
bool
isCrossed
);
...
...
src/core/UBSettings.cpp
View file @
408811c5
...
...
@@ -384,6 +384,9 @@ void UBSettings::init()
historyLimit
=
new
UBSetting
(
this
,
"Web"
,
"HistoryLimit"
,
15
);
teacherGuidePageZeroActivated
=
new
UBSetting
(
this
,
"DockPalette"
,
"TeacherGuideActivatePageZero"
,
true
);
teacherGuideLessonPagesActivated
=
new
UBSetting
(
this
,
"DockPalette"
,
"TeacherGuideActivateLessonPages"
,
true
);
actionGroupText
=
"Group items"
;
actionUngroupText
=
"Ungroup items"
;
}
...
...
src/core/UBSettings.h
View file @
408811c5
...
...
@@ -18,7 +18,7 @@
class
UBSettings
:
public
QObject
{
Q_OBJECT
;
Q_OBJECT
public
:
...
...
@@ -206,6 +206,9 @@ class UBSettings : public QObject
QString
softwareHomeUrl
;
QString
actionGroupText
;
QString
actionUngroupText
;
UBSetting
*
appToolBarPositionedAtTop
;
UBSetting
*
appToolBarDisplayText
;
UBSetting
*
appEnableAutomaticSoftwareUpdates
;
...
...
src/domain/UBGraphicsAudioItem.cpp
View file @
408811c5
...
...
@@ -118,3 +118,9 @@ void UBGraphicsAudioItem::tick ( qint64 time )
mTimeLcd
->
display
(
displayTime
.
toString
(
"mm:ss"
)
);
}
void
UBGraphicsAudioItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
}
src/domain/UBGraphicsAudioItem.h
View file @
408811c5
...
...
@@ -45,6 +45,7 @@ public:
{
UBGraphicsMediaItem
::
clearSource
();
}
void
setUuid
(
const
QUuid
&
pUuid
);
private
slots
:
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
408811c5
...
...
@@ -74,7 +74,7 @@ class UBGraphicsToolBarItem : public QGraphicsRectItem, public QObject
{
public
:
UBGraphicsToolBarItem
(
QGraphicsItem
*
parent
=
0
);
virtual
~
UBGraphicsToolBarItem
()
{
};
virtual
~
UBGraphicsToolBarItem
()
{
;}
bool
isVisibleOnBoard
()
const
{
return
mVisible
;
}
void
setVisibleOnBoard
(
bool
visible
)
{
mVisible
=
visible
;
}
...
...
src/domain/UBGraphicsPDFItem.cpp
View file @
408811c5
...
...
@@ -46,6 +46,11 @@ QVariant UBGraphicsPDFItem::itemChange(GraphicsItemChange change, const QVariant
return
GraphicsPDFItem
::
itemChange
(
change
,
newValue
);
}
void
UBGraphicsPDFItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
}
void
UBGraphicsPDFItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
...
...
src/domain/UBGraphicsPDFItem.h
View file @
408811c5
...
...
@@ -51,6 +51,7 @@ class UBGraphicsPDFItem: public GraphicsPDFItem, public UBItem, public UBGraphic
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
virtual
void
clearSource
(){;}
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
protected
:
...
...
src/domain/UBGraphicsPixmapItem.cpp
View file @
408811c5
...
...
@@ -52,6 +52,12 @@ QVariant UBGraphicsPixmapItem::itemChange(GraphicsItemChange change, const QVari
return
QGraphicsPixmapItem
::
itemChange
(
change
,
newValue
);
}
void
UBGraphicsPixmapItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
}
void
UBGraphicsPixmapItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
QMimeData
*
pMime
=
new
QMimeData
();
...
...
src/domain/UBGraphicsPixmapItem.h
View file @
408811c5
...
...
@@ -52,6 +52,8 @@ class UBGraphicsPixmapItem : public QObject, public QGraphicsPixmapItem, public
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
virtual
void
clearSource
(){;}
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
protected
:
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
...
...
src/domain/UBGraphicsProxyWidget.cpp
View file @
408811c5
...
...
@@ -67,6 +67,11 @@ QVariant UBGraphicsProxyWidget::itemChange(GraphicsItemChange change, const QVar
return
QGraphicsProxyWidget
::
itemChange
(
change
,
newValue
);
}
void
UBGraphicsProxyWidget
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsProxyWidget
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
...
...
src/domain/UBGraphicsProxyWidget.h
View file @
408811c5
...
...
@@ -44,6 +44,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
virtual
void
clearSource
(){;}
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
protected
:
...
...
src/domain/UBGraphicsScene.cpp
View file @
408811c5
...
...
@@ -65,9 +65,6 @@
#include "core/memcheck.h"
const
QString
groupText
=
"Group items"
;
const
QString
ungroupText
=
"Ungroup items"
;
qreal
UBZLayerController
::
errorNumber
=
-
20000001.0
;
UBZLayerController
::
UBZLayerController
(
QGraphicsScene
*
scene
)
:
...
...
@@ -296,14 +293,6 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
// Just for debug. Do not delete please
// connect(this, SIGNAL(selectionChanged()), this, SLOT(selectionChangedProcessing()));
connect
(
this
,
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
updateGroupButtonState
()));
// just a stub don't treat as a result code
// static int i = 0;
// i++;
// if (i == 1) {
connect
(
UBApplication
::
mainWindow
->
actionGroupItems
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
groupButtonClicked
()));
// qDebug() << "the connect is accepted";
// }
}
UBGraphicsScene
::~
UBGraphicsScene
()
...
...
@@ -332,65 +321,21 @@ void UBGraphicsScene::updateGroupButtonState()
if
(
selCount
<
1
)
{
groupAction
->
setEnabled
(
false
);
groupAction
->
setText
(
g
roupText
);
groupAction
->
setText
(
UBSettings
::
settings
()
->
actionG
roupText
);
}
else
if
(
selCount
==
1
)
{
if
(
selItems
.
first
()
->
type
()
==
UBGraphicsGroupContainerItem
::
Type
)
{
groupAction
->
setEnabled
(
true
);
groupAction
->
setText
(
u
ngroupText
);
groupAction
->
setText
(
UBSettings
::
settings
()
->
actionU
ngroupText
);
}
else
{
groupAction
->
setEnabled
(
false
);
}
}
else
if
(
selCount
>
1
)
{
groupAction
->
setEnabled
(
true
);
groupAction
->
setText
(
g
roupText
);
groupAction
->
setText
(
UBSettings
::
settings
()
->
actionG
roupText
);
}
}
void
UBGraphicsScene
::
groupButtonClicked
()
{
QAction
*
groupAction
=
UBApplication
::
mainWindow
->
actionGroupItems
;
QList
<
QGraphicsItem
*>
selItems
=
selectedItems
();
if
(
!
selItems
.
count
())
{
qDebug
()
<<
"Got grouping request when there is no any selected item on the scene"
;
return
;
}
if
(
groupAction
->
text
()
==
groupText
)
{
//The only way to get information from item, considering using smth else
UBGraphicsGroupContainerItem
*
groupItem
=
new
UBGraphicsGroupContainerItem
();
foreach
(
QGraphicsItem
*
item
,
selItems
)
{
if
(
item
->
type
()
==
UBGraphicsGroupContainerItem
::
Type
)
{
QList
<
QGraphicsItem
*>
childItems
=
item
->
childItems
();
UBGraphicsGroupContainerItem
*
currentGroup
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
item
);
if
(
currentGroup
)
{
currentGroup
->
destroy
();
}
foreach
(
QGraphicsItem
*
chItem
,
childItems
)
{
groupItem
->
addToGroup
(
chItem
);
}
}
else
{
groupItem
->
addToGroup
(
item
);
}
}
addItem
(
groupItem
);
groupItem
->
setVisible
(
true
);
groupItem
->
setFocus
();
}
else
if
(
groupAction
->
text
()
==
ungroupText
)
{
//Considering one selected item and it's a group
if
(
selItems
.
count
()
>
1
)
{
qDebug
()
<<
"can't make sense of ungrouping more then one item. Grouping action should be performed for that purpose"
;
return
;
}
UBGraphicsGroupContainerItem
*
currentGroup
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
selItems
.
first
());
if
(
currentGroup
)
{
currentGroup
->
destroy
();
}
}
}
// MARK: -
// MARK: Mouse/Tablet events handling
...
...
@@ -1582,6 +1527,39 @@ UBGraphicsW3CWidgetItem* UBGraphicsScene::addOEmbed(const QUrl& pContentUrl, con
return
widget
;
}
UBGraphicsGroupContainerItem
*
UBGraphicsScene
::
createGroup
(
QList
<
QGraphicsItem
*>
items
)
{
UBGraphicsGroupContainerItem
*
groupItem
=
new
UBGraphicsGroupContainerItem
();
foreach
(
QGraphicsItem
*
item
,
items
)
{
if
(
item
->
type
()
==
UBGraphicsGroupContainerItem
::
Type
)
{
QList
<
QGraphicsItem
*>
childItems
=
item
->
childItems
();
UBGraphicsGroupContainerItem
*
currentGroup
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
item
);
if
(
currentGroup
)
{
currentGroup
->
destroy
();
}
foreach
(
QGraphicsItem
*
chItem
,
childItems
)
{
groupItem
->
addToGroup
(
chItem
);
}
}
else
{
groupItem
->
addToGroup
(
item
);
}
}
addItem
(
groupItem
);
groupItem
->
setVisible
(
true
);
groupItem
->
setFocus
();
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
0
,
groupItem
);
UBApplication
::
undoStack
->
push
(
uc
);
}
setDocumentUpdated
();
return
groupItem
;
}
UBGraphicsSvgItem
*
UBGraphicsScene
::
addSvg
(
const
QUrl
&
pSvgFileUrl
,
const
QPointF
&
pPos
)
{
QString
path
=
pSvgFileUrl
.
toLocalFile
();
...
...
@@ -2188,14 +2166,6 @@ void UBGraphicsScene::setOwnZlevel(QGraphicsItem *item)
{
item
->
setZValue
(
item
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
}
void
UBGraphicsScene
::
groupItems
(
QList
<
QGraphicsItem
*>
&
itemList
)
{
foreach
(
QGraphicsItem
*
item
,
itemList
)
{
qDebug
()
<<
"selected item found"
;
item
->
setSelected
(
false
);
}
}
qreal
UBGraphicsScene
::
changeZLevelTo
(
QGraphicsItem
*
item
,
UBZLayerController
::
moveDestination
dest
)
{
...
...
src/domain/UBGraphicsScene.h
View file @
408811c5
...
...
@@ -46,6 +46,7 @@ class UBGraphicsStroke;
class
UBMagnifierParams
;
class
UBMagnifier
;
class
UBGraphicsCache
;
class
UBGraphicsGroupContainerItem
;
const
double
PI
=
4
.
0
*
atan
(
1
.
0
);
...
...
@@ -141,6 +142,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
UBGraphicsW3CWidgetItem
*
addOEmbed
(
const
QUrl
&
pContentUrl
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
));
UBGraphicsGroupContainerItem
*
createGroup
(
QList
<
QGraphicsItem
*>
items
);
QGraphicsItem
*
setAsBackgroundObject
(
QGraphicsItem
*
item
,
bool
pAdaptTransformation
=
false
,
bool
expand
=
false
);
QGraphicsItem
*
backgroundObject
()
const
...
...
@@ -289,7 +292,6 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void
setSelectedZLevel
(
QGraphicsItem
*
item
);
void
setOwnZlevel
(
QGraphicsItem
*
item
);
void
groupItems
(
QList
<
QGraphicsItem
*>
&
itemList
);
public
slots
:
void
hideEraser
();
...
...
@@ -307,8 +309,6 @@ public slots:
void
selectionChangedProcessing
();
void
updateGroupButtonState
();
void
groupButtonClicked
();
void
moveMagnifier
(
QPoint
newPos
);
void
closeMagnifier
();
void
zoomInMagnifier
();
...
...
src/domain/UBGraphicsStrokesGroup.cpp
View file @
408811c5
...
...
@@ -22,6 +22,12 @@ UBGraphicsStrokesGroup::~UBGraphicsStrokesGroup()
}
}
void
UBGraphicsStrokesGroup
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsStrokesGroup
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
if
(
mDelegate
->
mousePressEvent
(
event
))
...
...
src/domain/UBGraphicsStrokesGroup.h
View file @
408811c5
...
...
@@ -21,6 +21,7 @@ public:
{
return
Type
;
}
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
protected
:
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
...
...
src/domain/UBGraphicsTextItem.cpp
View file @
408811c5
...
...
@@ -296,6 +296,12 @@ QSizeF UBGraphicsTextItem::size() const
return
QSizeF
(
textWidth
(),
textHeight
());
}
void
UBGraphicsTextItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsTextItem
::
undoCommandAdded
()
{
...
...
src/domain/UBGraphicsTextItem.h
View file @
408811c5
...
...
@@ -81,6 +81,7 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
virtual
void
clearSource
(){;}
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
signals
:
void
textUndoCommandAdded
(
UBGraphicsTextItem
*
textItem
);
...
...
src/domain/UBGraphicsVideoItem.cpp
View file @
408811c5
...
...
@@ -107,6 +107,12 @@ void UBGraphicsVideoItem::showOnDisplayChanged(bool shown)
vid
->
toggleMute
();
}
void
UBGraphicsVideoItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsVideoItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
mShouldMove
=
(
event
->
buttons
()
&
Qt
::
LeftButton
);
...
...
src/domain/UBGraphicsVideoItem.h
View file @
408811c5
...
...
@@ -48,6 +48,7 @@ public:
{
UBGraphicsMediaItem
::
clearSource
();
}
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
public
slots
:
void
hasVideoChanged
(
bool
hasVideo
);
...
...
src/domain/UBGraphicsWidgetItem.cpp
View file @
408811c5
...
...
@@ -58,6 +58,11 @@ void UBGraphicsWidgetItem::javaScriptWindowObjectCleared()
}
void
UBGraphicsWidgetItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsWidgetItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
...
...
@@ -340,7 +345,11 @@ UBItem* UBGraphicsAppleWidgetItem::deepCopy() const
return
appleWidget
;
}
void
UBGraphicsAppleWidgetItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
UBGraphicsW3CWidgetItem
::
UBGraphicsW3CWidgetItem
(
const
QUrl
&
pWidgetUrl
,
QGraphicsItem
*
parent
,
int
widgetType
)
:
UBGraphicsWidgetItem
(
parent
,
widgetType
)
...
...
@@ -389,6 +398,12 @@ void UBGraphicsW3CWidgetItem::paint(QPainter * painter, const QStyleOptionGraphi
}
}
void
UBGraphicsW3CWidgetItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsW3CWidgetItem
::
javaScriptWindowObjectCleared
()
{
UBGraphicsWidgetItem
::
javaScriptWindowObjectCleared
();
...
...
src/domain/UBGraphicsWidgetItem.h
View file @
408811c5
...
...
@@ -78,6 +78,7 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
virtual
QUrl
getSnapshotPath
(){
return
SnapshotFile
;}
virtual
void
clearSource
();
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
protected
:
...
...
@@ -129,6 +130,7 @@ class UBGraphicsAppleWidgetItem : public UBGraphicsWidgetItem
}
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
};
...
...
@@ -155,6 +157,7 @@ class UBGraphicsW3CWidgetItem : public UBGraphicsWidgetItem
UBW3CWidget
*
w3cWidget
()
const
;
virtual
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
private
slots
:
...
...
src/domain/ubgraphicsgroupcontaineritem.cpp
View file @
408811c5
...
...
@@ -180,6 +180,12 @@ void UBGraphicsGroupContainerItem::remove()
mDelegate
->
remove
();
}
void
UBGraphicsGroupContainerItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsGroupContainerItem
::
destroy
()
{
foreach
(
QGraphicsItem
*
item
,
childItems
())
{
...
...
src/domain/ubgraphicsgroupcontaineritem.h
View file @
408811c5
...
...
@@ -28,6 +28,7 @@ public:
return
Type
;
}
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
void
destroy
();
...
...
src/tools/UBGraphicsCurtainItem.cpp
View file @
408811c5
...
...
@@ -71,6 +71,12 @@ QVariant UBGraphicsCurtainItem::itemChange(GraphicsItemChange change, const QVar
return
QGraphicsRectItem
::
itemChange
(
change
,
newValue
);
}
void
UBGraphicsCurtainItem
::
setUuid
(
const
QUuid
&
pUuid
)
{
UBItem
::
setUuid
(
pUuid
);
setData
(
UBGraphicsItemData
::
ItemUuid
,
QVariant
(
pUuid
));
//store item uuid inside the QGraphicsItem to fast operations with Items on the scene
}
void
UBGraphicsCurtainItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
if
(
mDelegate
->
mousePressEvent
(
event
))
...
...
src/tools/UBGraphicsCurtainItem.h
View file @
408811c5
...
...
@@ -48,7 +48,9 @@ class UBGraphicsCurtainItem : public QObject, public QGraphicsRectItem, public U
//TODO UB 4.x not nice ...
void
triggerRemovedSignal
();
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
virtual
void
clearSource
(){};
virtual
void
clearSource
(){;}
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
signals
:
...
...
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