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
Marco Bubke
flatpak-qt-creator
Commits
1fb52019
Commit
1fb52019
authored
Apr 07, 2010
by
Thomas Hartmann
Browse files
QmlDesigner.propertyEditor start transaction only if necessary
parent
586acac6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp
View file @
1fb52019
...
...
@@ -171,13 +171,13 @@ bool QmlAnchorBindingProxy::hasAnchors()
void
QmlAnchorBindingProxy
::
setTopTarget
(
const
QVariant
&
target
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
QmlItemNode
newTarget
(
target
.
value
<
ModelNode
>
());
if
(
newTarget
==
m_topTarget
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
m_topTarget
=
newTarget
;
calcTopMargin
();
...
...
@@ -187,13 +187,13 @@ void QmlAnchorBindingProxy::setTopTarget(const QVariant &target)
void
QmlAnchorBindingProxy
::
setBottomTarget
(
const
QVariant
&
target
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
QmlItemNode
newTarget
(
target
.
value
<
ModelNode
>
());
if
(
newTarget
==
m_bottomTarget
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
m_bottomTarget
=
newTarget
;
calcBottomMargin
();
...
...
@@ -202,13 +202,13 @@ void QmlAnchorBindingProxy::setBottomTarget(const QVariant &target)
void
QmlAnchorBindingProxy
::
setLeftTarget
(
const
QVariant
&
target
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
QmlItemNode
newTarget
(
target
.
value
<
ModelNode
>
());
if
(
newTarget
==
m_leftTarget
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
m_leftTarget
=
newTarget
;
calcLeftMargin
();
...
...
@@ -217,13 +217,13 @@ void QmlAnchorBindingProxy::setLeftTarget(const QVariant &target)
void
QmlAnchorBindingProxy
::
setRightTarget
(
const
QVariant
&
target
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
QmlItemNode
newTarget
(
target
.
value
<
ModelNode
>
());
if
(
newTarget
==
m_rightTarget
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
m_rightTarget
=
newTarget
;
calcRightMargin
();
...
...
@@ -232,13 +232,13 @@ void QmlAnchorBindingProxy::setRightTarget(const QVariant &target)
void
QmlAnchorBindingProxy
::
setVerticalTarget
(
const
QVariant
&
target
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
QmlItemNode
newTarget
(
target
.
value
<
ModelNode
>
());
if
(
newTarget
==
m_verticalTarget
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
m_verticalTarget
=
newTarget
;
m_fxItemNode
.
anchors
().
setAnchor
(
AnchorLine
::
VerticalCenter
,
m_verticalTarget
,
AnchorLine
::
VerticalCenter
);
...
...
@@ -247,13 +247,13 @@ void QmlAnchorBindingProxy::setVerticalTarget(const QVariant &target)
void
QmlAnchorBindingProxy
::
setHorizontalTarget
(
const
QVariant
&
target
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
QmlItemNode
newTarget
(
target
.
value
<
ModelNode
>
());
if
(
newTarget
==
m_horizontalTarget
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
m_horizontalTarget
=
newTarget
;
m_fxItemNode
.
anchors
().
setAnchor
(
AnchorLine
::
HorizontalCenter
,
m_horizontalTarget
,
AnchorLine
::
HorizontalCenter
);
...
...
@@ -275,14 +275,14 @@ void QmlAnchorBindingProxy::resetLayout() {
void
QmlAnchorBindingProxy
::
setBottomAnchor
(
bool
anchor
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
m_fxItemNode
.
hasNodeParent
())
return
;
if
(
bottomAnchored
()
==
anchor
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
anchor
)
{
removeBottomAnchor
();
}
else
{
...
...
@@ -296,14 +296,14 @@ void QmlAnchorBindingProxy::setBottomAnchor(bool anchor)
void
QmlAnchorBindingProxy
::
setLeftAnchor
(
bool
anchor
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
m_fxItemNode
.
hasNodeParent
())
return
;
if
(
leftAnchored
()
==
anchor
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
anchor
)
{
removeLeftAnchor
();
}
else
{
...
...
@@ -316,14 +316,14 @@ void QmlAnchorBindingProxy::setLeftAnchor(bool anchor)
void
QmlAnchorBindingProxy
::
setRightAnchor
(
bool
anchor
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
m_fxItemNode
.
hasNodeParent
())
return
;
if
(
rightAnchored
()
==
anchor
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
anchor
)
{
removeRightAnchor
();
}
else
{
...
...
@@ -410,14 +410,14 @@ void QmlAnchorBindingProxy::calcRightMargin()
void
QmlAnchorBindingProxy
::
setTopAnchor
(
bool
anchor
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
m_fxItemNode
.
hasNodeParent
())
return
;
if
(
topAnchored
()
==
anchor
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
anchor
)
{
removeTopAnchor
();
}
else
{
...
...
@@ -458,14 +458,14 @@ void QmlAnchorBindingProxy::removeRightAnchor() {
void
QmlAnchorBindingProxy
::
setVerticalCentered
(
bool
centered
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
m_fxItemNode
.
hasNodeParent
())
return
;
if
(
verticalCentered
()
==
centered
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
centered
)
{
m_fxItemNode
.
anchors
().
removeAnchor
(
AnchorLine
::
VerticalCenter
);
m_fxItemNode
.
anchors
().
removeMargin
(
AnchorLine
::
VerticalCenter
);
...
...
@@ -477,14 +477,14 @@ void QmlAnchorBindingProxy::setVerticalCentered(bool centered)
void
QmlAnchorBindingProxy
::
setHorizontalCentered
(
bool
centered
)
{
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
m_fxItemNode
.
hasNodeParent
())
return
;
if
(
horizontalCentered
()
==
centered
)
return
;
RewriterTransaction
transaction
=
m_fxItemNode
.
modelNode
().
view
()
->
beginRewriterTransaction
();
if
(
!
centered
)
{
m_fxItemNode
.
anchors
().
removeAnchor
(
AnchorLine
::
HorizontalCenter
);
m_fxItemNode
.
anchors
().
removeMargin
(
AnchorLine
::
HorizontalCenter
);
...
...
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