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
30e51f5a
Commit
30e51f5a
authored
Jul 17, 2013
by
Didier Clerc
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'OEFUniboard' of github.com:stayonshadow/PrivateBoard into OEFUniboard
parents
b4ec6f6c
3b0bb2f0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
56 deletions
+19
-56
UBBoardController.cpp
src/board/UBBoardController.cpp
+6
-13
UBBoardController.h
src/board/UBBoardController.h
+2
-2
UBMimeData.cpp
src/core/UBMimeData.cpp
+1
-2
UBGraphicsGroupContainerItem.cpp
src/domain/UBGraphicsGroupContainerItem.cpp
+3
-15
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+4
-1
UBGraphicsProxyWidget.cpp
src/domain/UBGraphicsProxyWidget.cpp
+3
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+0
-5
UBSelectionFrame.cpp
src/domain/UBSelectionFrame.cpp
+0
-18
No files found.
src/board/UBBoardController.cpp
View file @
30e51f5a
...
@@ -543,7 +543,7 @@ void UBBoardController::duplicateScene()
...
@@ -543,7 +543,7 @@ void UBBoardController::duplicateScene()
duplicateScene
(
mActiveSceneIndex
);
duplicateScene
(
mActiveSceneIndex
);
}
}
UBGraphicsItem
*
UBBoardController
::
duplicateItem
(
UBItem
*
item
,
bool
bAsync
)
UBGraphicsItem
*
UBBoardController
::
duplicateItem
(
UBItem
*
item
)
{
{
if
(
!
item
)
if
(
!
item
)
return
NULL
;
return
NULL
;
...
@@ -602,12 +602,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -602,12 +602,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
if
(
mitem
)
if
(
mitem
)
{
{
sourceUrl
=
mitem
->
mediaFileUrl
();
sourceUrl
=
mitem
->
mediaFileUrl
();
if
(
bAsync
)
{
downloadURL
(
sourceUrl
,
srcFile
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
,
false
);
downloadURL
(
sourceUrl
,
srcFile
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
,
false
);
return
NULL
;
// async operation
return
NULL
;
// async operation
}
}
}
}
break
;
}
break
;
case
UBMimeType
:
:
VectorImage
:
case
UBMimeType
:
:
VectorImage
:
...
@@ -643,8 +640,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -643,8 +640,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
mActiveScene
->
setURStackEnable
(
false
);
mActiveScene
->
setURStackEnable
(
false
);
foreach
(
QGraphicsItem
*
pIt
,
children
){
foreach
(
QGraphicsItem
*
pIt
,
children
){
UBItem
*
pItem
=
dynamic_cast
<
UBItem
*>
(
pIt
);
UBItem
*
pItem
=
dynamic_cast
<
UBItem
*>
(
pIt
);
if
(
pItem
){
// we diong sync duplication of all childs.
if
(
pItem
){
QGraphicsItem
*
itemToGroup
=
dynamic_cast
<
QGraphicsItem
*>
(
duplicateItem
(
pItem
,
false
));
QGraphicsItem
*
itemToGroup
=
dynamic_cast
<
QGraphicsItem
*>
(
duplicateItem
(
pItem
));
if
(
itemToGroup
)
if
(
itemToGroup
)
duplicatedItems
.
append
(
itemToGroup
);
duplicatedItems
.
append
(
itemToGroup
);
}
}
...
@@ -2220,11 +2217,7 @@ void UBBoardController::copy()
...
@@ -2220,11 +2217,7 @@ void UBBoardController::copy()
UBItem
*
ubItem
=
dynamic_cast
<
UBItem
*>
(
gi
);
UBItem
*
ubItem
=
dynamic_cast
<
UBItem
*>
(
gi
);
if
(
ubItem
&&
!
mActiveScene
->
tools
().
contains
(
gi
))
if
(
ubItem
&&
!
mActiveScene
->
tools
().
contains
(
gi
))
{
selected
<<
ubItem
;
UBItem
*
itemCopy
=
ubItem
->
deepCopy
();
if
(
itemCopy
)
selected
<<
itemCopy
;
}
}
}
if
(
selected
.
size
()
>
0
)
if
(
selected
.
size
()
>
0
)
...
...
src/board/UBBoardController.h
View file @
30e51f5a
...
@@ -168,7 +168,7 @@ class UBBoardController : public UBDocumentContainer
...
@@ -168,7 +168,7 @@ class UBBoardController : public UBDocumentContainer
void
moveSceneToIndex
(
int
source
,
int
target
);
void
moveSceneToIndex
(
int
source
,
int
target
);
void
duplicateScene
(
int
index
);
void
duplicateScene
(
int
index
);
UBGraphicsItem
*
duplicateItem
(
UBItem
*
item
,
bool
bAsync
=
true
);
UBGraphicsItem
*
duplicateItem
(
UBItem
*
item
);
void
deleteScene
(
int
index
);
void
deleteScene
(
int
index
);
bool
cacheIsVisible
()
{
return
mCacheWidgetIsEnabled
;}
bool
cacheIsVisible
()
{
return
mCacheWidgetIsEnabled
;}
...
...
src/core/UBMimeData.cpp
View file @
30e51f5a
...
@@ -61,6 +61,5 @@ UBMimeDataGraphicsItem::UBMimeDataGraphicsItem(QList<UBItem*> pItems)
...
@@ -61,6 +61,5 @@ UBMimeDataGraphicsItem::UBMimeDataGraphicsItem(QList<UBItem*> pItems)
UBMimeDataGraphicsItem
::~
UBMimeDataGraphicsItem
()
UBMimeDataGraphicsItem
::~
UBMimeDataGraphicsItem
()
{
{
foreach
(
UBItem
*
item
,
mItems
)
// Explanation: selected items are owned by the scene and handled by this class
delete
item
;
}
}
src/domain/UBGraphicsGroupContainerItem.cpp
View file @
30e51f5a
...
@@ -183,16 +183,6 @@ void UBGraphicsGroupContainerItem::paint(QPainter *painter, const QStyleOptionGr
...
@@ -183,16 +183,6 @@ void UBGraphicsGroupContainerItem::paint(QPainter *painter, const QStyleOptionGr
Q_UNUSED
(
painter
);
Q_UNUSED
(
painter
);
Q_UNUSED
(
option
);
Q_UNUSED
(
option
);
// we would not use paint smth for the moment
// if (option->state & QStyle::State_Selected) {
// painter->setBrush(Qt::NoBrush);
// QPen tmpPen;
// qreal tmpPenWidth = 1.0;
// tmpPen.setWidth(tmpPenWidth);
// tmpPen.setColor(Qt::lightGray);
// painter->setPen(tmpPen);
// painter->drawRect(itemsBoundingRect.adjusted(tmpPenWidth / 2, tmpPenWidth / 2, -tmpPenWidth / 2, -tmpPenWidth / 2));
// }
Delegate
()
->
postpaint
(
painter
,
option
,
widget
);
Delegate
()
->
postpaint
(
painter
,
option
,
widget
);
}
}
...
@@ -211,8 +201,6 @@ UBGraphicsGroupContainerItem *UBGraphicsGroupContainerItem::deepCopy() const
...
@@ -211,8 +201,6 @@ UBGraphicsGroupContainerItem *UBGraphicsGroupContainerItem::deepCopy() const
copyItemParameters
(
copy
);
copyItemParameters
(
copy
);
// copy->resize(this->size());
return
copy
;
return
copy
;
}
}
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
30e51f5a
...
@@ -120,14 +120,17 @@ void DelegateButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
...
@@ -120,14 +120,17 @@ void DelegateButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void
DelegateButton
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
void
DelegateButton
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
{
{
painter
->
save
();
painter
->
setCompositionMode
(
QPainter
::
CompositionMode_SourceOver
);
QGraphicsSvgItem
::
paint
(
painter
,
option
,
widget
);
QGraphicsSvgItem
::
paint
(
painter
,
option
,
widget
);
painter
->
restore
();
if
(
mIsPressed
&&
mShowProgressIndicator
)
{
if
(
mIsPressed
&&
mShowProgressIndicator
)
{
QPen
pen
;
QPen
pen
;
pen
.
setBrush
(
Qt
::
white
);
pen
.
setBrush
(
Qt
::
white
);
pen
.
setWidth
(
3
);
pen
.
setWidth
(
3
);
painter
->
save
();
painter
->
save
();
painter
->
setCompositionMode
(
QPainter
::
CompositionMode_SourceOver
);
painter
->
setPen
(
pen
);
painter
->
setPen
(
pen
);
int
spanAngle
=
qMin
(
mPressProgres
,
UBSettings
::
longClickInterval
)
*
360
/
UBSettings
::
longClickInterval
;
int
spanAngle
=
qMin
(
mPressProgres
,
UBSettings
::
longClickInterval
)
*
360
/
UBSettings
::
longClickInterval
;
...
...
src/domain/UBGraphicsProxyWidget.cpp
View file @
30e51f5a
...
@@ -49,8 +49,11 @@ UBGraphicsProxyWidget::~UBGraphicsProxyWidget()
...
@@ -49,8 +49,11 @@ UBGraphicsProxyWidget::~UBGraphicsProxyWidget()
void
UBGraphicsProxyWidget
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
void
UBGraphicsProxyWidget
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
{
{
painter
->
save
();
painter
->
setCompositionMode
(
QPainter
::
CompositionMode_SourceOver
);
QGraphicsProxyWidget
::
paint
(
painter
,
option
,
widget
);
QGraphicsProxyWidget
::
paint
(
painter
,
option
,
widget
);
Delegate
()
->
postpaint
(
painter
,
option
,
widget
);
Delegate
()
->
postpaint
(
painter
,
option
,
widget
);
painter
->
restore
();
}
}
QVariant
UBGraphicsProxyWidget
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
QVariant
UBGraphicsProxyWidget
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
...
...
src/domain/UBGraphicsScene.cpp
View file @
30e51f5a
...
@@ -319,8 +319,6 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta
...
@@ -319,8 +319,6 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent, bool enableUndoRedoSta
mShouldUseOMP
=
QSysInfo
::
MacintoshVersion
>=
QSysInfo
::
MV_10_5
;
mShouldUseOMP
=
QSysInfo
::
MacintoshVersion
>=
QSysInfo
::
MV_10_5
;
#endif
#endif
// setItemIndexMethod(QGraphicsScene::BspTreeIndex);
setUuid
(
QUuid
::
createUuid
());
setUuid
(
QUuid
::
createUuid
());
setDocument
(
parent
);
setDocument
(
parent
);
createEraiser
();
createEraiser
();
...
@@ -1070,9 +1068,6 @@ void UBGraphicsScene::notifyZChanged(QGraphicsItem *item, qreal zValue)
...
@@ -1070,9 +1068,6 @@ void UBGraphicsScene::notifyZChanged(QGraphicsItem *item, qreal zValue)
void
UBGraphicsScene
::
updateSelectionFrame
()
void
UBGraphicsScene
::
updateSelectionFrame
()
{
{
qDebug
()
<<
"selected item count"
<<
selectedItems
().
count
();
qDebug
()
<<
"selected item count"
<<
selectedItems
().
count
();
// if (!mMultipleSelectionProcess) {
// return;
// }
if
(
!
mSelectionFrame
)
{
if
(
!
mSelectionFrame
)
{
mSelectionFrame
=
new
UBSelectionFrame
();
mSelectionFrame
=
new
UBSelectionFrame
();
...
...
src/domain/UBSelectionFrame.cpp
View file @
30e51f5a
...
@@ -133,12 +133,6 @@ void UBSelectionFrame::mousePressEvent(QGraphicsSceneMouseEvent *event)
...
@@ -133,12 +133,6 @@ void UBSelectionFrame::mousePressEvent(QGraphicsSceneMouseEvent *event)
}
else
{
}
else
{
mOperationMode
=
om_moving
;
mOperationMode
=
om_moving
;
}
}
// foreach (UBGraphicsItemDelegate *curDelegate, mEnclosedtems) {
// qDebug() << "TransformBefore" << curDelegate->delegated()->transform();
// }
// QGraphicsRectItem::mousePressEvent(event);
}
}
void
UBSelectionFrame
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
void
UBSelectionFrame
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
...
@@ -191,9 +185,6 @@ void UBSelectionFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
...
@@ -191,9 +185,6 @@ void UBSelectionFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
item
->
update
();
item
->
update
();
item
->
setTransform
(
ownTransform
,
false
);
item
->
setTransform
(
ownTransform
,
false
);
// int resultAngle = (int)mRotationAngle % 360;
// setCursorFromAngle(QString::number(resultAngle));
qDebug
()
<<
"curAngle"
<<
mRotationAngle
;
qDebug
()
<<
"curAngle"
<<
mRotationAngle
;
}
break
;
}
break
;
...
@@ -219,11 +210,6 @@ void UBSelectionFrame::mouseReleaseEvent(QGraphicsSceneMouseEvent */*event*/)
...
@@ -219,11 +210,6 @@ void UBSelectionFrame::mouseReleaseEvent(QGraphicsSceneMouseEvent */*event*/)
}
}
mOperationMode
=
om_idle
;
mOperationMode
=
om_idle
;
// foreach (UBGraphicsItemDelegate *curDelegate, mEnclosedtems) {
// qDebug() << "TransformBefore" << curDelegate->delegated()->transform();
// }
// QGraphicsRectItem::mouseReleaseEvent(event);
}
}
void
UBSelectionFrame
::
onZoomChanged
(
qreal
pZoom
)
void
UBSelectionFrame
::
onZoomChanged
(
qreal
pZoom
)
...
@@ -232,11 +218,7 @@ void UBSelectionFrame::onZoomChanged(qreal pZoom)
...
@@ -232,11 +218,7 @@ void UBSelectionFrame::onZoomChanged(qreal pZoom)
qDebug
()
<<
"Board current zoom"
<<
UBApplication
::
boardController
->
currentZoom
();
qDebug
()
<<
"Board current zoom"
<<
UBApplication
::
boardController
->
currentZoom
();
qDebug
()
<<
"UBApplication::boardController->systemScaleFactor()"
<<
UBApplication
::
boardController
->
systemScaleFactor
();
qDebug
()
<<
"UBApplication::boardController->systemScaleFactor()"
<<
UBApplication
::
boardController
->
systemScaleFactor
();
mAntiscaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
pZoom
);
mAntiscaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
pZoom
);
// updateScale();
// QTransform tr;
// tr.scale(mAntiscaleRatio, mAntiscaleRatio);
// this->setTransform(tr);
}
}
void
UBSelectionFrame
::
remove
()
void
UBSelectionFrame
::
remove
()
...
...
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