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
d44cc5b6
Commit
d44cc5b6
authored
Apr 20, 2012
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multiple selection
parent
0a1799a5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
48 deletions
+71
-48
api.pri
src/api/api.pri
+0
-3
UBBoardView.cpp
src/board/UBBoardView.cpp
+37
-7
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+26
-13
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+5
-22
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+2
-2
UBRubberBand.cpp
src/gui/UBRubberBand.cpp
+1
-1
No files found.
src/api/api.pri
View file @
d44cc5b6
...
...
@@ -8,7 +8,4 @@ SOURCES += src/api/UBWidgetUniboardAPI.cpp \
src/api/UBLibraryAPI.cpp \
src/api/UBW3CWidgetAPI.cpp \
src/api/UBWidgetMessageAPI.cpp
src/board/UBBoardView.cpp
View file @
d44cc5b6
...
...
@@ -46,6 +46,9 @@
#include "domain/UBGraphicsPDFItem.h"
#include "domain/UBGraphicsPolygonItem.h"
#include "domain/UBItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsSvgItem.h"
#include "document/UBDocumentProxy.h"
...
...
@@ -517,6 +520,8 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
}
}
QSet
<
QGraphicsItem
*>
mJustSelectedItems
;
void
UBBoardView
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
...
...
@@ -538,14 +543,39 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
event
->
accept
();
}
else
if
(
currentTool
==
UBStylusTool
::
Selector
)
{
if
((
event
->
pos
()
-
mLastPressedMousePos
).
manhattanLength
()
<
QApplication
::
startDragDistance
())
{
return
;
}
{
if
((
event
->
pos
()
-
mLastPressedMousePos
).
manhattanLength
()
<
QApplication
::
startDragDistance
())
{
return
;
}
if
(
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
mUBRubberBand
->
setGeometry
(
QRect
(
mMouseDownPos
,
event
->
pos
()).
normalized
());
}
if
(
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
QRect
bandRect
(
mMouseDownPos
,
event
->
pos
());
bandRect
=
bandRect
.
normalized
();
mUBRubberBand
->
setGeometry
(
bandRect
);
QList
<
QGraphicsItem
*>
rubberItems
=
items
(
bandRect
);
foreach
(
QGraphicsItem
*
item
,
mJustSelectedItems
)
{
if
(
!
rubberItems
.
contains
(
item
))
{
item
->
setSelected
(
false
);
mJustSelectedItems
.
remove
(
item
);
}
}
foreach
(
QGraphicsItem
*
item
,
items
(
bandRect
))
{
if
(
item
->
type
()
==
UBGraphicsW3CWidgetItem
::
Type
||
item
->
type
()
==
UBGraphicsPixmapItem
::
Type
||
item
->
type
()
==
UBGraphicsVideoItem
::
Type
||
item
->
type
()
==
UBGraphicsAudioItem
::
Type
||
item
->
type
()
==
UBGraphicsSvgItem
::
Type
)
{
if
(
!
mJustSelectedItems
.
contains
(
item
))
{
item
->
setSelected
(
true
);
mJustSelectedItems
.
insert
(
item
);
}
}
}
}
if
(
movingItem
&&
(
mMouseButtonIsPressed
||
mTabletStylusIsPressed
))
{
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
d44cc5b6
...
...
@@ -138,6 +138,21 @@ UBGraphicsItemDelegate::~UBGraphicsItemDelegate()
QVariant
UBGraphicsItemDelegate
::
itemChange
(
QGraphicsItem
::
GraphicsItemChange
change
,
const
QVariant
&
value
)
{
if
(
change
==
QGraphicsItem
::
ItemSelectedHasChanged
)
{
bool
ok
;
bool
selected
=
value
.
toUInt
(
&
ok
);
if
(
ok
)
{
UBGraphicsScene
*
ubScene
=
castUBGraphicsScene
();
if
(
ubScene
)
{
if
(
selected
)
{
ubScene
->
setSelectedZLevel
(
delegated
());
}
else
{
ubScene
->
setOwnZlevel
(
delegated
());
}
}
}
}
if
((
change
==
QGraphicsItem
::
ItemSelectedHasChanged
||
change
==
QGraphicsItem
::
ItemPositionHasChanged
||
change
==
QGraphicsItem
::
ItemTransformHasChanged
)
...
...
@@ -145,19 +160,6 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
{
mAntiScaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
UBApplication
::
boardController
->
currentZoom
());
if
(
mDelegated
->
isSelected
())
{
QList
<
QGraphicsItem
*>
items
=
mDelegated
->
scene
()
->
selectedItems
();
foreach
(
QGraphicsItem
*
item
,
items
)
{
if
(
item
!=
mDelegated
)
{
item
->
setSelected
(
false
);
}
}
}
positionHandles
();
}
...
...
@@ -247,6 +249,17 @@ bool UBGraphicsItemDelegate::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_UNUSED
(
event
);
//Deselect all the rest selected items if no ctrl key modifier
if
(
delegated
()
->
scene
()
&&
delegated
()
->
scene
()
->
selectedItems
().
count
()
&&
event
->
modifiers
()
!=
Qt
::
ControlModifier
)
{
foreach
(
QGraphicsItem
*
item
,
delegated
()
->
scene
()
->
selectedItems
())
{
if
(
item
!=
delegated
())
{
item
->
setSelected
(
false
);
}
}
}
commitUndoStep
();
return
true
;
...
...
src/domain/UBGraphicsScene.cpp
View file @
d44cc5b6
...
...
@@ -306,17 +306,6 @@ void UBGraphicsScene::selectionChangedProcessing()
if
(
selectedItems
().
count
())
UBApplication
::
showMessage
(
"ZValue is "
+
QString
::
number
(
selectedItems
().
first
()
->
zValue
(),
'f'
)
+
"own z value is "
+
QString
::
number
(
selectedItems
().
first
()
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
(),
'f'
));
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
if
(
nextItem
->
isSelected
())
{
nextItem
->
setZValue
(
mZLayerController
->
generateZLevel
(
itemLayerType
::
SelectedItem
));
}
else
{
nextItem
->
setZValue
(
nextItem
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
}
}
}
// MARK: -
...
...
@@ -492,8 +481,6 @@ bool UBGraphicsScene::inputDeviceRelease()
bool
accepted
=
false
;
if
(
mPointer
)
{
mPointer
->
hide
();
...
...
@@ -1921,17 +1908,13 @@ void UBGraphicsScene::setNominalSize(int pWidth, int pHeight)
setNominalSize
(
QSize
(
pWidth
,
pHeight
));
}
void
UBGraphicsScene
::
setSelectedZLevel
(
QList
<
QGraphicsItem
*>
itemList
)
{
foreach
(
QGraphicsItem
*
item
,
itemList
)
{
item
->
setZValue
(
mZLayerController
->
generateZLevel
(
itemLayerType
::
SelectedItem
));
}
void
UBGraphicsScene
::
setSelectedZLevel
(
QGraphicsItem
*
item
)
{
item
->
setZValue
(
mZLayerController
->
generateZLevel
(
itemLayerType
::
SelectedItem
));
}
void
UBGraphicsScene
::
setOwnZlevel
(
Q
List
<
QGraphicsItem
*>
itemList
)
void
UBGraphicsScene
::
setOwnZlevel
(
Q
GraphicsItem
*
item
)
{
foreach
(
QGraphicsItem
*
item
,
itemList
)
{
item
->
setZValue
(
item
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
}
item
->
setZValue
(
item
->
data
(
UBGraphicsItemData
::
ItemOwnZValue
).
toReal
());
}
qreal
UBGraphicsScene
::
changeZLevelTo
(
QGraphicsItem
*
item
,
UBZLayerController
::
moveDestination
dest
)
...
...
src/domain/UBGraphicsScene.h
View file @
d44cc5b6
...
...
@@ -285,8 +285,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
return
mPreviousPoint
;
}
void
setSelectedZLevel
(
Q
List
<
QGraphicsItem
*>
itemList
);
void
setOwnZlevel
(
Q
List
<
QGraphicsItem
*>
itemList
);
void
setSelectedZLevel
(
Q
GraphicsItem
*
item
);
void
setOwnZlevel
(
Q
GraphicsItem
*
item
);
public
slots
:
void
hideEraser
();
...
...
src/gui/UBRubberBand.cpp
View file @
d44cc5b6
...
...
@@ -35,7 +35,7 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p)
#elif defined(Q_WS_MAC)
customStyle
=
new
QMacStyle
();
#elif defined(Q_WS_X11)
customStyle
=
QStyleFactory
::
create
(
"oxygen"
);
//
customStyle = QStyleFactory::create("oxygen");
#endif
if
(
customStyle
)
...
...
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