Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
80d0b18f
Commit
80d0b18f
authored
Dec 01, 2010
by
Marco Bubke
Browse files
QmlDesigner.NodeInstances: Use internalId for instanceId
parent
a91d137d
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/designercore/include/nodeinstance.h
View file @
80d0b18f
...
...
@@ -19,7 +19,7 @@ class NodeInstance
{
friend
class
NodeInstanceView
;
public:
static
NodeInstance
create
(
const
ModelNode
&
node
,
qint32
instanceId
);
static
NodeInstance
create
(
const
ModelNode
&
node
);
NodeInstance
();
~
NodeInstance
();
NodeInstance
(
const
NodeInstance
&
other
);
...
...
src/plugins/qmldesigner/designercore/include/nodeinstanceview.h
View file @
80d0b18f
...
...
@@ -153,8 +153,6 @@ private: // functions
RemovePropertiesCommand
createRemovePropertiesCommand
(
const
QList
<
AbstractProperty
>
&
propertyList
)
const
;
AddImportCommand
createImportCommand
(
const
Import
&
import
);
qint32
generateInstanceId
();
void
resetHorizontalAnchors
(
const
ModelNode
&
node
);
void
resetVerticalAnchors
(
const
ModelNode
&
node
);
...
...
@@ -170,8 +168,6 @@ private: //variables
uint
m_blockUpdates
;
QWeakPointer
<
NodeInstanceServerInterface
>
m_nodeInstanceServer
;
qint32
m_instanceIdCounter
;
;
};
}
// namespace ProxyNodeInstanceView
...
...
src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp
View file @
80d0b18f
...
...
@@ -12,8 +12,7 @@ class ProxyNodeInstanceData
{
public:
ProxyNodeInstanceData
()
:
instanceId
(
-
1
),
parentInstanceId
(
-
1
),
:
parentInstanceId
(
-
1
),
penWidth
(
1
),
isAnchoredBySibling
(
false
),
isAnchoredByChildren
(
false
),
...
...
@@ -23,7 +22,6 @@ public:
isInPositioner
(
false
)
{}
qint32
instanceId
;
qint32
parentInstanceId
;
ModelNode
modelNode
;
QRectF
boundingRect
;
...
...
@@ -58,12 +56,11 @@ NodeInstance::NodeInstance(ProxyNodeInstanceData *dPointer)
{
}
NodeInstance
NodeInstance
::
create
(
const
ModelNode
&
node
,
qint32
instanceId
)
NodeInstance
NodeInstance
::
create
(
const
ModelNode
&
node
)
{
ProxyNodeInstanceData
*
d
=
new
ProxyNodeInstanceData
;
d
->
modelNode
=
node
;
d
->
instanceId
=
instanceId
;
return
NodeInstance
(
d
);
}
...
...
@@ -95,7 +92,7 @@ ModelNode NodeInstance::modelNode() const
qint32
NodeInstance
::
instanceId
()
const
{
if
(
d
)
{
return
d
->
instanceId
;
return
d
->
modelNode
.
internalId
()
;
}
else
{
return
-
1
;
}
...
...
@@ -109,7 +106,7 @@ bool NodeInstance::isValid() const
void
NodeInstance
::
makeInvalid
()
{
if
(
d
)
d
->
instanceId
=
-
1
;
d
->
modelNode
=
ModelNode
()
;
}
QRectF
NodeInstance
::
boundingRect
()
const
...
...
src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
View file @
80d0b18f
...
...
@@ -135,7 +135,6 @@ void NodeInstanceView::modelAttached(Model *model)
AbstractView
::
modelAttached
(
model
);
m_nodeInstanceServer
=
new
NodeInstanceServerProxy
(
this
);
connect
(
m_nodeInstanceServer
.
data
(),
SIGNAL
(
processCrashed
()),
this
,
SLOT
(
restartProcess
()));
m_instanceIdCounter
=
1
;
setBlockUpdates
(
true
);
nodeInstanceServer
()
->
createScene
(
createCreateSceneCommand
());
...
...
@@ -633,12 +632,7 @@ NodeInstanceServerInterface *NodeInstanceView::nodeInstanceServer() const
NodeInstance
NodeInstanceView
::
loadNode
(
const
ModelNode
&
node
)
{
qint32
instanceId
=
0
;
if
(
!
node
.
isRootNode
())
instanceId
=
generateInstanceId
();
NodeInstance
instance
(
NodeInstance
::
create
(
node
,
instanceId
));
NodeInstance
instance
(
NodeInstance
::
create
(
node
));
insertInstanceRelationships
(
instance
);
...
...
@@ -918,9 +912,4 @@ void NodeInstanceView::childrenChanged(const ChildrenChangedCommand &command)
emitCustomNotification
(
"__instance children changed__"
,
childNodeList
);
}
qint32
NodeInstanceView
::
generateInstanceId
()
{
return
m_instanceIdCounter
++
;
}
}
Write
Preview
Supports
Markdown
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