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
bce67995
Commit
bce67995
authored
Sep 20, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UBToolWidget is QWidget now. Implemented all expected behavior.
parent
f9e12cc3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
13 deletions
+21
-13
UBBoardController.cpp
src/board/UBBoardController.cpp
+12
-12
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+1
-1
UBToolWidget.cpp
src/gui/UBToolWidget.cpp
+7
-0
UBToolWidget.h
src/gui/UBToolWidget.h
+1
-0
No files found.
src/board/UBBoardController.cpp
View file @
bce67995
...
@@ -2318,13 +2318,9 @@ void UBBoardController::moveGraphicsWidgetToControlView(UBGraphicsWidgetItem* gr
...
@@ -2318,13 +2318,9 @@ void UBBoardController::moveGraphicsWidgetToControlView(UBGraphicsWidgetItem* gr
{
{
mActiveScene
->
setURStackEnable
(
false
);
mActiveScene
->
setURStackEnable
(
false
);
graphicsWidget
->
remove
(
false
);
graphicsWidget
->
remove
(
false
);
UBGraphicsItem
*
toolW3C
=
duplicateItem
(
dynamic_cast
<
UBItem
*>
(
graphicsWidget
));
mActiveScene
->
addItemToDeletion
(
graphicsWidget
);
UBGraphicsWidgetItem
*
copyedGraphicsWidget
=
NULL
;
if
(
UBGraphicsWidgetItem
::
Type
==
toolW3C
->
type
())
UBToolWidget
*
toolWidget
=
new
UBToolWidget
(
graphicsWidget
,
mControlView
);
copyedGraphicsWidget
=
static_cast
<
UBGraphicsWidgetItem
*>
(
toolW3C
);
UBToolWidget
*
toolWidget
=
new
UBToolWidget
(
copyedGraphicsWidget
,
mControlView
);
mActiveScene
->
setURStackEnable
(
true
);
mActiveScene
->
setURStackEnable
(
true
);
QPoint
controlViewPos
=
mControlView
->
mapFromScene
(
graphicsWidget
->
sceneBoundingRect
().
center
());
QPoint
controlViewPos
=
mControlView
->
mapFromScene
(
graphicsWidget
->
sceneBoundingRect
().
center
());
...
@@ -2335,11 +2331,15 @@ void UBBoardController::moveGraphicsWidgetToControlView(UBGraphicsWidgetItem* gr
...
@@ -2335,11 +2331,15 @@ void UBBoardController::moveGraphicsWidgetToControlView(UBGraphicsWidgetItem* gr
void
UBBoardController
::
moveToolWidgetToScene
(
UBToolWidget
*
toolWidget
)
void
UBBoardController
::
moveToolWidgetToScene
(
UBToolWidget
*
toolWidget
)
{
{
UBGraphicsWidgetItem
*
graphicsWidgetItem
=
addW3cWidget
(
toolWidget
->
toolWidget
()
->
widgetUrl
(),
QPointF
(
0
,
0
));
UBGraphicsWidgetItem
*
widgetToScene
=
toolWidget
->
toolWidget
();
graphicsWidgetItem
->
setPos
(
toolWidget
->
pos
());
toolWidget
->
hide
();
QPoint
mainWindowCenter
=
toolWidget
->
mapTo
(
mMainWindow
,
QPoint
(
toolWidget
->
width
(),
toolWidget
->
height
())
/
2
);
delete
toolWidget
;
QPoint
controlViewCenter
=
mControlView
->
mapFrom
(
mMainWindow
,
mainWindowCenter
);
graphicsWidgetItem
->
setSelected
(
true
);
QPointF
scenePos
=
mControlView
->
mapToScene
(
controlViewCenter
);
mActiveScene
->
addGraphicsWidget
(
widgetToScene
,
scenePos
);
toolWidget
->
remove
();
}
}
...
...
src/domain/UBGraphicsScene.cpp
View file @
bce67995
...
@@ -1310,7 +1310,7 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
...
@@ -1310,7 +1310,7 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
if
(
graphicsWidget
->
canBeContent
())
if
(
graphicsWidget
->
canBeContent
())
{
{
// graphicsWidget->widgetWebView()
->loadMainHtml();
graphicsWidget
->
loadMainHtml
();
graphicsWidget
->
setSelected
(
true
);
graphicsWidget
->
setSelected
(
true
);
if
(
mUndoRedoStackEnabled
)
{
//should be deleted after scene own undo stack implemented
if
(
mUndoRedoStackEnabled
)
{
//should be deleted after scene own undo stack implemented
...
...
src/gui/UBToolWidget.cpp
View file @
bce67995
...
@@ -222,6 +222,13 @@ QPoint UBToolWidget::naturalCenter() const
...
@@ -222,6 +222,13 @@ QPoint UBToolWidget::naturalCenter() const
return
QPoint
(
0
,
0
);
return
QPoint
(
0
,
0
);
}
}
void
UBToolWidget
::
remove
()
{
mToolWidget
=
NULL
;
hide
();
deleteLater
();
}
void
UBToolWidget
::
centerOn
(
const
QPoint
&
pos
)
void
UBToolWidget
::
centerOn
(
const
QPoint
&
pos
)
{
{
QWidget
::
move
(
pos
-
QPoint
(
width
()
/
2
,
height
()
/
2
));
QWidget
::
move
(
pos
-
QPoint
(
width
()
/
2
,
height
()
/
2
));
...
...
src/gui/UBToolWidget.h
View file @
bce67995
...
@@ -32,6 +32,7 @@ class UBToolWidget : public QWidget
...
@@ -32,6 +32,7 @@ class UBToolWidget : public QWidget
UBToolWidget
(
UBGraphicsWidgetItem
*
pWidget
,
QWidget
*
pParent
=
0
);
UBToolWidget
(
UBGraphicsWidgetItem
*
pWidget
,
QWidget
*
pParent
=
0
);
virtual
~
UBToolWidget
();
virtual
~
UBToolWidget
();
void
remove
();
void
centerOn
(
const
QPoint
&
pos
);
void
centerOn
(
const
QPoint
&
pos
);
QPoint
naturalCenter
()
const
;
QPoint
naturalCenter
()
const
;
...
...
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