if (propertyTakesComponent)
m_merger->setupComponent(newNode);
- if (modelProperty.isDefaultProperty()) { //In the default property case we do some magic
+ if (modelProperty.isDefaultProperty() || isComponentType(modelProperty.parentModelNode().type())) { //In the default property case we do some magic
if (modelProperty.isNodeListProperty()) {
modelProperty.reparentHere(newNode);
} else { //The default property could a NodeProperty implicitly (delegate:)
context,
*this);
parentProperty.reparentHere(newNode);
- if (nodeIndex >= 0) {
+ if (parentProperty.isNodeListProperty()) {
int currentIndex = parentProperty.toNodeListProperty().toModelNodeList().indexOf(newNode);
if (nodeIndex != currentIndex)
parentProperty.toNodeListProperty().slide(currentIndex, nodeIndex);