Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
Umbrello
Commits
d9d5adac
Commit
d9d5adac
authored
Jun 25, 2014
by
Ralf Habacker
Browse files
Fix of 'No undo support for applying layouts'.
CCBUG: 336709
parent
bf2958d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
umbrello/layoutgenerator.cpp
View file @
d9d5adac
...
...
@@ -12,13 +12,16 @@
#include
"associationline.h"
#include
"associationwidget.h"
#include
"cmds.h"
#include
"debug_utils.h"
#include
"floatingtextwidget.h"
#include
"uml.h"
#include
"umlwidget.h"
//
app
includes
//
kde
includes
#include
<KConfigGroup>
#include
<KDesktopFile>
#include
<KLocale>
#include
<KStandardDirs>
// qt includes
...
...
@@ -245,15 +248,21 @@ bool LayoutGenerator::apply(UMLScene *scene)
*/
}
UMLApp
::
app
()
->
beginMacro
(
i18n
(
"Apply layout"
));
foreach
(
UMLWidget
*
widget
,
scene
->
widgetList
())
{
QString
id
=
Uml
::
ID
::
toString
(
widget
->
localID
());
if
(
!
m_nodes
.
contains
(
id
))
continue
;
QPoint
p
=
origin
(
id
);
widget
->
setStartMovePosition
(
widget
->
pos
());
widget
->
setX
(
p
.
x
());
widget
->
setY
(
p
.
y
()
-
widget
->
height
());
widget
->
adjustAssocs
(
widget
->
x
(),
widget
->
y
());
// adjust assoc lines
UMLApp
::
app
()
->
executeCommand
(
new
Uml
::
CmdMoveWidget
(
widget
));
}
UMLApp
::
app
()
->
endMacro
();
foreach
(
AssociationWidget
*
assoc
,
scene
->
associationList
())
{
assoc
->
calculateEndingPoints
();
...
...
umbrello/widgets/umlwidget.cpp
View file @
d9d5adac
...
...
@@ -610,6 +610,15 @@ QPointF UMLWidget::startMovePosition() const
return
m_startMovePostion
;
}
/**
* Set the start position of the move action.
* @param position point where the move began
*/
void
UMLWidget
::
setStartMovePosition
(
const
QPointF
&
position
)
{
m_startMovePostion
=
position
;
}
/**
* Return the start size of the resize action.
* @return size where the resize began
...
...
umbrello/widgets/umlwidget.h
View file @
d9d5adac
...
...
@@ -200,6 +200,8 @@ public:
virtual
void
saveToXMI
(
QDomDocument
&
qDoc
,
QDomElement
&
qElement
);
QPointF
startMovePosition
()
const
;
void
setStartMovePosition
(
const
QPointF
&
position
);
QSizeF
startResizeSize
()
const
;
virtual
QSizeF
calculateSize
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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