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
ea229497
Commit
ea229497
authored
Jul 24, 2012
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
e67b39f7
9f95f1be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
UBBoardView.cpp
src/board/UBBoardView.cpp
+18
-4
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+4
-2
No files found.
src/board/UBBoardView.cpp
View file @
ea229497
...
@@ -417,7 +417,7 @@ bool UBBoardView::itemShouldReceiveMousePressEvent(QGraphicsItem *item)
...
@@ -417,7 +417,7 @@ bool UBBoardView::itemShouldReceiveMousePressEvent(QGraphicsItem *item)
return
true
;
return
true
;
if
(
item
==
scene
()
->
backgroundObject
())
if
(
item
==
scene
()
->
backgroundObject
())
return
tru
e
;
return
fals
e
;
if
(
itemIsLocked
(
item
))
if
(
itemIsLocked
(
item
))
return
false
;
return
false
;
...
@@ -577,6 +577,19 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
...
@@ -577,6 +577,19 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
{
{
mLastPressedMousePos
=
mapToScene
(
event
->
pos
());
mLastPressedMousePos
=
mapToScene
(
event
->
pos
());
if
(
movingItem
&&
QGraphicsSvgItem
::
Type
!=
movingItem
->
type
()
&&
UBGraphicsDelegateFrame
::
Type
!=
movingItem
->
type
())
{
foreach
(
QGraphicsItem
*
item
,
scene
()
->
selectedItems
())
{
if
(
item
!=
movingItem
)
{
item
->
setSelected
(
false
);
}
}
}
if
(
itemShouldReceiveMousePressEvent
(
movingItem
))
if
(
itemShouldReceiveMousePressEvent
(
movingItem
))
QGraphicsView
::
mousePressEvent
(
event
);
QGraphicsView
::
mousePressEvent
(
event
);
else
else
...
@@ -704,6 +717,8 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
...
@@ -704,6 +717,8 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
mMouseDownPos
=
event
->
pos
();
mMouseDownPos
=
event
->
pos
();
movingItem
=
scene
()
->
itemAt
(
this
->
mapToScene
(
event
->
posF
().
toPoint
()));
if
(
!
movingItem
)
emit
clickOnBoard
();
emit
clickOnBoard
();
if
(
event
->
button
()
==
Qt
::
LeftButton
&&
isInteractive
())
if
(
event
->
button
()
==
Qt
::
LeftButton
&&
isInteractive
())
...
@@ -732,8 +747,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
...
@@ -732,8 +747,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
}
}
else
if
(
currentTool
==
UBStylusTool
::
Selector
||
currentTool
==
UBStylusTool
::
Play
)
else
if
(
currentTool
==
UBStylusTool
::
Selector
||
currentTool
==
UBStylusTool
::
Play
)
{
{
movingItem
=
scene
()
->
itemAt
(
this
->
mapToScene
(
event
->
posF
().
toPoint
()));
connect
(
&
mLongPressTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
longPressEvent
()));
connect
(
&
mLongPressTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
longPressEvent
()));
if
(
!
movingItem
&&
!
mController
->
cacheIsVisible
())
if
(
!
movingItem
&&
!
mController
->
cacheIsVisible
())
mLongPressTimer
.
start
();
mLongPressTimer
.
start
();
...
@@ -998,6 +1011,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
...
@@ -998,6 +1011,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
textItem
->
setSelected
(
true
);
textItem
->
setSelected
(
true
);
textItem
->
setFocus
();
}
}
else
else
{
{
...
...
src/domain/UBGraphicsScene.cpp
View file @
ea229497
...
@@ -1593,12 +1593,14 @@ UBGraphicsTextItem* UBGraphicsScene::textForObjectName(const QString& pString, c
...
@@ -1593,12 +1593,14 @@ UBGraphicsTextItem* UBGraphicsScene::textForObjectName(const QString& pString, c
if
(
!
textItem
){
if
(
!
textItem
){
textItem
=
addTextWithFont
(
pString
,
QPointF
(
0
,
0
)
,
72
,
UBSettings
::
settings
()
->
fontFamily
(),
true
,
false
);
textItem
=
addTextWithFont
(
pString
,
QPointF
(
0
,
0
)
,
72
,
UBSettings
::
settings
()
->
fontFamily
(),
true
,
false
);
textItem
->
setObjectName
(
objectName
);
textItem
->
setObjectName
(
objectName
);
QSizeF
size
=
textItem
->
size
();
textItem
->
setPos
(
QPointF
(
-
size
.
width
()
/
2.0
,
-
size
.
height
()
/
2.0
));
}
}
textItem
->
setPlainText
(
pString
);
textItem
->
setPlainText
(
pString
);
textItem
->
adjustSize
();
textItem
->
adjustSize
();
QSizeF
size
=
textItem
->
size
();
textItem
->
clearFocus
();
textItem
->
set
Pos
(
QPointF
(
-
size
.
width
()
/
2.0
,
-
size
.
height
()
/
2.0
)
);
textItem
->
set
TextInteractionFlags
(
Qt
::
TextSelectableByMouse
|
Qt
::
TextSelectableByKeyboard
);
return
textItem
;
return
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