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
Marco Bubke
flatpak-qt-creator
Commits
bea2684e
Commit
bea2684e
authored
Feb 16, 2010
by
Thomas Hartmann
Browse files
QmlDesigner.propertyEditor: only allocate className/id backendObject once
parent
993707e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
View file @
bea2684e
...
...
@@ -124,7 +124,9 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS
createPropertyEditorValue
(
fxObjectNode
,
propertyName
,
fxObjectNode
.
instanceValue
(
propertyName
),
&
m_backendValuesPropertyMap
,
propertyEditor
);
// className
PropertyEditorValue
*
valueObject
=
new
PropertyEditorValue
(
&
m_backendValuesPropertyMap
);
PropertyEditorValue
*
valueObject
=
qobject_cast
<
PropertyEditorValue
*>
(
QmlMetaType
::
toQObject
(
m_backendValuesPropertyMap
.
value
(
"className"
)));
if
(
!
valueObject
)
valueObject
=
new
PropertyEditorValue
(
&
m_backendValuesPropertyMap
);
valueObject
->
setName
(
"className"
);
valueObject
->
setModelNode
(
fxObjectNode
.
modelNode
());
valueObject
->
setValue
(
fxObjectNode
.
modelNode
().
simplifiedTypeName
());
...
...
@@ -132,7 +134,9 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS
m_backendValuesPropertyMap
.
insert
(
"className"
,
QVariant
::
fromValue
(
valueObject
));
// id
valueObject
=
new
PropertyEditorValue
(
&
m_backendValuesPropertyMap
);
valueObject
=
qobject_cast
<
PropertyEditorValue
*>
(
QmlMetaType
::
toQObject
(
m_backendValuesPropertyMap
.
value
(
"id"
)));
if
(
!
valueObject
)
valueObject
=
new
PropertyEditorValue
(
&
m_backendValuesPropertyMap
);
valueObject
->
setName
(
"id"
);
valueObject
->
setValue
(
fxObjectNode
.
id
());
QObject
::
connect
(
valueObject
,
SIGNAL
(
valueChanged
(
QString
)),
&
m_backendValuesPropertyMap
,
SIGNAL
(
valueChanged
(
QString
)));
...
...
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