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
712bd523
Commit
712bd523
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
30e51f5a
1afbc194
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
30 deletions
+54
-30
UBBoardView.cpp
src/board/UBBoardView.cpp
+28
-30
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+12
-0
UBGraphicsMediaItem.h
src/domain/UBGraphicsMediaItem.h
+3
-0
UBGraphicsTextItem.cpp
src/domain/UBGraphicsTextItem.cpp
+9
-0
UBGraphicsTextItem.h
src/domain/UBGraphicsTextItem.h
+2
-0
No files found.
src/board/UBBoardView.cpp
View file @
712bd523
...
...
@@ -91,7 +91,6 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool
,
mMultipleSelectionIsEnabled
(
false
)
,
bIsControl
(
isControl
)
,
bIsDesktop
(
isDesktop
)
,
mRubberBandInPlayMode
(
false
)
//enables rubberband with play tool
{
init
();
...
...
@@ -535,12 +534,7 @@ Here we determines cases when items should to get mouse press event at pressing
case
UBGraphicsTriangle
:
:
Type
:
case
UBGraphicsCompass
:
:
Type
:
case
UBGraphicsCache
:
:
Type
:
return
true
;
case
UBGraphicsDelegateFrame
:
:
Type
:
case
QGraphicsSvgItem
:
:
Type
:
return
true
;
case
DelegateButton
:
:
Type
:
return
true
;
...
...
@@ -989,10 +983,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
if
(
!
movingItem
&&
!
mController
->
cacheIsVisible
())
mLongPressTimer
.
start
();
if
(
mUBRubberBand
)
{
mUBRubberBand
->
hide
();
}
handleItemMousePress
(
event
);
event
->
accept
();
break
;
...
...
@@ -1006,9 +996,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
QListIterator
<
QGraphicsItem
*>
it
(
scene
()
->
items
(
fuzzyRect
));
while
(
it
.
hasNext
()
&&
!
foundTextItem
)
{
foundTextItem
=
qgraphicsitem_cast
<
UBGraphicsTextItem
*>
(
it
.
next
());
}
if
(
foundTextItem
)
{
...
...
@@ -1091,7 +1079,7 @@ void UBBoardView::mouseMoveEvent (QMouseEvent *event)
switch
(
currentTool
)
{
case
UBStylusTool
:
:
Hand
:
{
if
(
!
mMouseButtonIsPressed
&&
mTabletStylusIsPressed
)
{
if
(
!
mMouseButtonIsPressed
&&
!
mTabletStylusIsPressed
)
{
break
;
}
QPointF
eventPosition
=
event
->
posF
();
...
...
@@ -1109,7 +1097,7 @@ void UBBoardView::mouseMoveEvent (QMouseEvent *event)
return
;
}
bool
rubberMove
=
currentTool
!=
(
UBStylusTool
::
Play
||
mRubberBandInPlayMode
)
bool
rubberMove
=
(
currentTool
!=
(
UBStylusTool
::
Play
)
)
&&
(
mMouseButtonIsPressed
||
mTabletStylusIsPressed
)
&&
!
movingItem
;
...
...
@@ -1172,13 +1160,13 @@ void UBBoardView::mouseMoveEvent (QMouseEvent *event)
case
UBStylusTool
:
:
Text
:
case
UBStylusTool
:
:
Capture
:
{
if
(
mRubberBand
&&
(
mIsCreatingTextZone
||
mIsCreatingSceneGrabZone
))
{
if
(
mRubberBand
&&
(
mIsCreatingTextZone
||
mIsCreatingSceneGrabZone
))
{
mRubberBand
->
setGeometry
(
QRect
(
mMouseDownPos
,
event
->
pos
()).
normalized
());
event
->
accept
();
}
else
{
QGraphicsView
::
mouseMoveEvent
(
event
);
}
else
QGraphicsView
::
mouseMoveEvent
(
event
);
}
break
;
default
:
...
...
@@ -1240,7 +1228,6 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
{
if
(
isUBItem
(
movingItem
)
&&
DelegateButton
::
Type
!=
movingItem
->
type
()
&&
QGraphicsSvgItem
::
Type
!=
movingItem
->
type
()
&&
UBGraphicsDelegateFrame
::
Type
!=
movingItem
->
type
()
&&
UBGraphicsCache
::
Type
!=
movingItem
->
type
()
&&
QGraphicsWebView
::
Type
!=
movingItem
->
type
()
&&
// for W3C widgets as Tools.
...
...
@@ -1257,6 +1244,13 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
if
(
movingItem
->
isSelected
())
bReleaseIsNeed
=
true
;
UBGraphicsTextItem
*
textItem
=
dynamic_cast
<
UBGraphicsTextItem
*>
(
movingItem
);
UBGraphicsMediaItem
*
movieItem
=
dynamic_cast
<
UBGraphicsMediaItem
*>
(
movingItem
);
if
(
textItem
)
textItem
->
setSelected
(
true
);
else
if
(
movieItem
)
movieItem
->
setSelected
(
true
);
else
movingItem
->
setSelected
(
true
);
}
...
...
@@ -1266,10 +1260,6 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
else
bReleaseIsNeed
=
true
;
if
(
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
mUBRubberBand
->
hide
();
}
if
(
bReleaseIsNeed
)
{
QGraphicsView
::
mouseReleaseEvent
(
event
);
...
...
@@ -1297,6 +1287,7 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
suspendedMousePressEvent
=
NULL
;
}
}
QGraphicsView
::
mouseReleaseEvent
(
event
);
}
else
if
(
currentTool
==
UBStylusTool
::
Text
)
...
...
@@ -1368,10 +1359,6 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
else
bReleaseIsNeed
=
true
;
if
(
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
mUBRubberBand
->
hide
();
}
if
(
bReleaseIsNeed
)
{
QGraphicsView
::
mouseReleaseEvent
(
event
);
...
...
@@ -1399,8 +1386,6 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
}
else
if
(
currentTool
==
UBStylusTool
::
Capture
)
{
if
(
mRubberBand
)
mRubberBand
->
hide
();
if
(
scene
()
&&
mRubberBand
&&
mIsCreatingSceneGrabZone
&&
mRubberBand
->
geometry
().
width
()
>
16
)
{
...
...
@@ -1428,6 +1413,19 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
}
}
if
(
mUBRubberBand
)
{
mUBRubberBand
->
hide
();
delete
mUBRubberBand
;
mUBRubberBand
=
NULL
;
}
if
(
mRubberBand
)
{
mRubberBand
->
hide
();
delete
mRubberBand
;
mRubberBand
=
NULL
;
}
mMouseButtonIsPressed
=
false
;
mPendingStylusReleaseEvent
=
false
;
mTabletStylusIsPressed
=
false
;
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
712bd523
...
...
@@ -121,6 +121,18 @@ UBGraphicsMediaItem::~UBGraphicsMediaItem()
}
void
UBGraphicsMediaItem
::
setSelected
(
bool
selected
)
{
if
(
selected
){
Delegate
()
->
createControls
();
if
(
mediaType_Audio
==
mMediaType
)
Delegate
()
->
frame
()
->
setOperationMode
(
UBGraphicsDelegateFrame
::
ResizingHorizontally
);
else
Delegate
()
->
frame
()
->
setOperationMode
(
UBGraphicsDelegateFrame
::
Resizing
);
}
UBGraphicsProxyWidget
::
setSelected
(
selected
);
}
QVariant
UBGraphicsMediaItem
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
{
if
((
change
==
QGraphicsItem
::
ItemEnabledChange
)
...
...
src/domain/UBGraphicsMediaItem.h
View file @
712bd523
...
...
@@ -91,6 +91,9 @@ public:
virtual
void
setSourceUrl
(
const
QUrl
&
pSourceUrl
);
void
setSelected
(
bool
selected
);
public
slots
:
void
toggleMute
();
...
...
src/domain/UBGraphicsTextItem.cpp
View file @
712bd523
...
...
@@ -77,6 +77,15 @@ UBGraphicsTextItem::~UBGraphicsTextItem()
{
}
void
UBGraphicsTextItem
::
setSelected
(
bool
selected
)
{
if
(
selected
){
Delegate
()
->
createControls
();
Delegate
()
->
frame
()
->
setOperationMode
(
UBGraphicsDelegateFrame
::
Resizing
);
}
QGraphicsTextItem
::
setSelected
(
selected
);
}
QVariant
UBGraphicsTextItem
::
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
)
{
QVariant
newValue
=
value
;
...
...
src/domain/UBGraphicsTextItem.h
View file @
712bd523
...
...
@@ -92,6 +92,8 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
void
setHtml
(
const
QString
&
text
);
void
setSelected
(
bool
selected
);
signals
:
void
textUndoCommandAdded
(
UBGraphicsTextItem
*
textItem
);
...
...
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