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
6311ca2b
Commit
6311ca2b
authored
Jan 21, 2014
by
-f
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy/paste action the zlevel order is respected
parent
6e66f94c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
UBBoardController.cpp
src/board/UBBoardController.cpp
+13
-2
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+4
-2
No files found.
src/board/UBBoardController.cpp
View file @
6311ca2b
...
...
@@ -2255,13 +2255,22 @@ void UBBoardController::copy()
void
UBBoardController
::
paste
()
{
QClipboard
*
clipboard
=
QApplication
::
clipboard
();
QPointF
pos
(
0
,
0
);
qreal
xPosition
=
((
qreal
)
qrand
()
/
(
qreal
)
RAND_MAX
)
*
400
;
qreal
yPosition
=
((
qreal
)
qrand
()
/
(
qreal
)
RAND_MAX
)
*
200
;
QPointF
pos
(
xPosition
-
200
,
yPosition
-
100
);
processMimeData
(
clipboard
->
mimeData
(),
pos
);
selectedDocument
()
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
()));
}
bool
zLevelLessThan
(
UBItem
*
s1
,
UBItem
*
s2
)
{
qreal
s1Zvalue
=
dynamic_cast
<
QGraphicsItem
*>
(
s1
)
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
();
qreal
s2Zvalue
=
dynamic_cast
<
QGraphicsItem
*>
(
s2
)
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
();
return
s1Zvalue
<
s2Zvalue
;
}
void
UBBoardController
::
processMimeData
(
const
QMimeData
*
pMimeData
,
const
QPointF
&
pPos
)
{
if
(
pMimeData
->
hasFormat
(
UBApplication
::
mimeTypeUniboardPage
))
...
...
@@ -2291,7 +2300,9 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
if
(
mimeData
)
{
foreach
(
UBItem
*
item
,
mimeData
->
items
())
QList
<
UBItem
*>
items
=
mimeData
->
items
();
qStableSort
(
items
.
begin
(),
items
.
end
(),
zLevelLessThan
);
foreach
(
UBItem
*
item
,
items
)
{
QGraphicsItem
*
pItem
=
dynamic_cast
<
QGraphicsItem
*>
(
item
);
if
(
NULL
!=
pItem
){
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
6311ca2b
...
...
@@ -782,11 +782,13 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
button
->
setParentItem
(
mFrame
);
button
->
setPos
(
topX
+
(
i
++
*
1.6
*
mFrameWidth
*
mAntiScaleRatio
),
topY
);
button
->
setTransform
(
tr
);
}
else
if
(
button
->
getSection
()
==
Qt
::
BottomLeftSection
)
{
}
else
if
(
button
->
getSection
()
==
Qt
::
BottomLeftSection
)
{
button
->
setParentItem
(
mFrame
);
button
->
setPos
(
bottomX
+
(
++
j
*
1.6
*
mFrameWidth
*
mAntiScaleRatio
),
bottomY
);
button
->
setTransform
(
tr
);
}
else
if
(
button
->
getSection
()
==
Qt
::
TitleBarArea
){
}
else
if
(
button
->
getSection
()
==
Qt
::
TitleBarArea
){
button
->
setParentItem
(
mFrame
);
button
->
setPos
(
topXTitleBar
+
(
k
++
*
(
frameButtonHeight
+
5
)),
topYTitleBar
);
button
->
setTransform
(
tr
);
...
...
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