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
a672c9bf
Commit
a672c9bf
authored
May 20, 2013
by
Ilia Ryabokon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Presentation changes
parent
2806b135
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
179 additions
and
173 deletions
+179
-173
Sankore_3.1.pro
Sankore_3.1.pro
+1
-1
UBBoardView.cpp
src/board/UBBoardView.cpp
+135
-137
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+35
-35
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+7
-0
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+1
-0
No files found.
Sankore_3.1.pro
View file @
a672c9bf
...
@@ -374,7 +374,7 @@ macx {
...
@@ -374,7 +374,7 @@ macx {
linux-g++
* {
linux-g++
* {
CONFIG += link_prl
CONFIG += link_prl
LIBS += -lcrypto
LIBS += -lcrypto
LIBS += -lprofiler
#
LIBS += -lprofiler
LIBS += -lX11
LIBS += -lX11
QMAKE_CFLAGS += -fopenmp
QMAKE_CFLAGS += -fopenmp
QMAKE_CXXFLAGS += -fopenmp
QMAKE_CXXFLAGS += -fopenmp
...
...
src/board/UBBoardView.cpp
View file @
a672c9bf
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsItemDelegate.cpp
View file @
a672c9bf
...
@@ -158,6 +158,8 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec
...
@@ -158,6 +158,8 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec
,
mDeleteButton
(
NULL
)
,
mDeleteButton
(
NULL
)
,
mDuplicateButton
(
NULL
)
,
mDuplicateButton
(
NULL
)
,
mMenuButton
(
NULL
)
,
mMenuButton
(
NULL
)
,
mZOrderUpButton
(
0
)
,
mZOrderDownButton
(
0
)
,
mMenu
(
0
)
,
mMenu
(
0
)
,
mLockAction
(
0
)
,
mLockAction
(
0
)
,
mShowOnDisplayAction
(
0
)
,
mShowOnDisplayAction
(
0
)
...
@@ -243,13 +245,10 @@ void UBGraphicsItemDelegate::createControls()
...
@@ -243,13 +245,10 @@ void UBGraphicsItemDelegate::createControls()
void
UBGraphicsItemDelegate
::
freeControls
()
void
UBGraphicsItemDelegate
::
freeControls
()
{
{
QGraphicsScene
*
controlsScene
=
delegated
()
->
scene
();
QGraphicsScene
*
controlsScene
=
delegated
()
->
scene
();
Q_ASSERT
(
controlsScene
);
UB_FREE_CONTROL
(
mFrame
,
controlsScene
);
UB_FREE_CONTROL
(
mDeleteButton
,
controlsScene
);
UB_FREE_CONTROL
(
mMenuButton
,
controlsScene
);
UB_FREE_CONTROL
(
mZOrderUpButton
,
controlsScene
);
UB_FREE_CONTROL
(
mZOrderDownButton
,
controlsScene
);
UB_FREE_CONTROL
(
mFrame
,
controlsScene
);
freeButtons
();
freeButtons
();
}
}
...
@@ -263,7 +262,6 @@ bool UBGraphicsItemDelegate::controlsExist() const
...
@@ -263,7 +262,6 @@ bool UBGraphicsItemDelegate::controlsExist() const
;
;
}
}
UBGraphicsItemDelegate
::~
UBGraphicsItemDelegate
()
UBGraphicsItemDelegate
::~
UBGraphicsItemDelegate
()
{
{
if
(
UBApplication
::
boardController
)
if
(
UBApplication
::
boardController
)
...
@@ -277,44 +275,35 @@ UBGraphicsItemDelegate::~UBGraphicsItemDelegate()
...
@@ -277,44 +275,35 @@ UBGraphicsItemDelegate::~UBGraphicsItemDelegate()
QVariant
UBGraphicsItemDelegate
::
itemChange
(
QGraphicsItem
::
GraphicsItemChange
change
,
const
QVariant
&
value
)
QVariant
UBGraphicsItemDelegate
::
itemChange
(
QGraphicsItem
::
GraphicsItemChange
change
,
const
QVariant
&
value
)
{
{
UBGraphicsScene
*
ubScene
=
castUBGraphicsScene
();
UBGraphicsScene
*
ubScene
=
castUBGraphicsScene
();
switch
(
static_cast
<
int
>
(
change
))
{
if
(
change
==
QGraphicsItem
::
ItemSelectedHasChanged
)
{
case
QGraphicsItem
:
:
ItemSelectedHasChanged
:
{
bool
ok
;
bool
selected
=
value
.
toUInt
(
&
ok
);
if
(
ok
)
{
if
(
ubScene
&&
!
ubScene
->
multipleSelectionProcess
())
{
if
(
ubScene
&&
!
ubScene
->
multipleSelectionProcess
())
{
if
(
selected
)
{
if
(
value
.
toBool
())
{
//selected(true)
if
(
!
controlsExist
())
{
createControls
();
mAntiScaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
UBApplication
::
boardController
->
currentZoom
());
positionHandles
();
ubScene
->
setSelectedZLevel
(
delegated
());
ubScene
->
setSelectedZLevel
(
delegated
());
}
}
else
{
}
else
{
ubScene
->
setOwnZlevel
(
delegated
());
ubScene
->
setOwnZlevel
(
delegated
());
}
freeControls
();
}
}
}
}
}
if
((
change
==
QGraphicsItem
::
ItemSelectedHasChanged
}
break
;
||
change
==
QGraphicsItem
::
ItemPositionHasChanged
||
change
==
QGraphicsItem
::
ItemTransformHasChanged
)
case
QGraphicsItem
:
:
ItemPositionHasChanged
:
&&
ubScene
case
QGraphicsItem
:
:
ItemTransformHasChanged
:
&&
!
ubScene
->
multipleSelectionProcess
()
case
QGraphicsItem
:
:
ItemZValueHasChanged
:
&&
UBApplication
::
boardController
)
{
if
(
!
controlsExist
())
{
createControls
();
}
mAntiScaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
UBApplication
::
boardController
->
currentZoom
());
mAntiScaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
UBApplication
::
boardController
->
currentZoom
());
positionHandles
();
positionHandles
();
}
if
(
ubScene
)
{
if
(
change
==
QGraphicsItem
::
ItemPositionHasChanged
||
change
==
QGraphicsItem
::
ItemTransformHasChanged
||
change
==
QGraphicsItem
::
ItemZValueHasChanged
)
{
UBGraphicsScene
*
ubScene
=
qobject_cast
<
UBGraphicsScene
*>
(
mDelegated
->
scene
());
if
(
ubScene
)
ubScene
->
setModified
(
true
);
ubScene
->
setModified
(
true
);
}
}
break
;
}
return
value
;
return
value
;
}
}
...
@@ -425,6 +414,10 @@ QGraphicsItem *UBGraphicsItemDelegate::delegated()
...
@@ -425,6 +414,10 @@ QGraphicsItem *UBGraphicsItemDelegate::delegated()
void
UBGraphicsItemDelegate
::
positionHandles
()
void
UBGraphicsItemDelegate
::
positionHandles
()
{
{
if
(
!
controlsExist
())
{
return
;
}
if
(
mDelegated
->
isSelected
())
{
if
(
mDelegated
->
isSelected
())
{
bool
shownOnDisplay
=
mDelegated
->
data
(
UBGraphicsItemData
::
ItemLayerType
).
toInt
()
!=
UBItemLayerType
::
Control
;
bool
shownOnDisplay
=
mDelegated
->
data
(
UBGraphicsItemData
::
ItemLayerType
).
toInt
()
!=
UBItemLayerType
::
Control
;
showHide
(
shownOnDisplay
);
showHide
(
shownOnDisplay
);
...
@@ -644,6 +637,13 @@ void UBGraphicsItemDelegate::buildButtons()
...
@@ -644,6 +637,13 @@ void UBGraphicsItemDelegate::buildButtons()
}
}
void
UBGraphicsItemDelegate
::
freeButtons
()
void
UBGraphicsItemDelegate
::
freeButtons
()
{
{
//Previously deleted with the frame
// Rimplement for some specific behavior
mButtons
.
clear
();
mDeleteButton
=
0
;
mMenuButton
=
0
;
mZOrderUpButton
=
0
;
mZOrderDownButton
=
0
;
}
}
void
UBGraphicsItemDelegate
::
decorateMenu
(
QMenu
*
menu
)
void
UBGraphicsItemDelegate
::
decorateMenu
(
QMenu
*
menu
)
...
...
src/domain/UBGraphicsScene.cpp
View file @
a672c9bf
...
@@ -1034,6 +1034,13 @@ UBGraphicsPolygonItem* UBGraphicsScene::arcToPolygonItem(const QLineF& pStartRad
...
@@ -1034,6 +1034,13 @@ UBGraphicsPolygonItem* UBGraphicsScene::arcToPolygonItem(const QLineF& pStartRad
return
polygonToPolygonItem
(
polygon
);
return
polygonToPolygonItem
(
polygon
);
}
}
void
UBGraphicsScene
::
clearSelectionFrame
()
{
if
(
mSelectionFrame
)
{
mSelectionFrame
->
setEnclosedItems
(
QList
<
QGraphicsItem
*>
());
}
}
void
UBGraphicsScene
::
updateMultipleSelectionFrame
()
void
UBGraphicsScene
::
updateMultipleSelectionFrame
()
{
{
qDebug
()
<<
"selected item count"
<<
selectedItems
().
count
();
qDebug
()
<<
"selected item count"
<<
selectedItems
().
count
();
...
...
src/domain/UBGraphicsScene.h
View file @
a672c9bf
...
@@ -311,6 +311,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
...
@@ -311,6 +311,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
UBGraphicsPolygonItem
*
polygonToPolygonItem
(
const
QPolygonF
pPolygon
);
UBGraphicsPolygonItem
*
polygonToPolygonItem
(
const
QPolygonF
pPolygon
);
void
setMultipleSelectionProcess
(
bool
pEnabled
)
{
mMultipleSelectionProcess
=
pEnabled
;}
void
setMultipleSelectionProcess
(
bool
pEnabled
)
{
mMultipleSelectionProcess
=
pEnabled
;}
bool
multipleSelectionProcess
()
const
{
return
mMultipleSelectionProcess
;}
bool
multipleSelectionProcess
()
const
{
return
mMultipleSelectionProcess
;}
void
clearSelectionFrame
();
void
updateMultipleSelectionFrame
();
void
updateMultipleSelectionFrame
();
public
slots
:
public
slots
:
...
...
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