63 /* |
63 /* |
64 * Takes an existing object and migrates it to this model, at the specified position. |
64 * Takes an existing object and migrates it to this model, at the specified position. |
65 */ |
65 */ |
66 void Model::insertObject(int position, LDObject* object) |
66 void Model::insertObject(int position, LDObject* object) |
67 { |
67 { |
|
68 connect(object, SIGNAL(codeChanged(QString,QString)), this, SLOT(recountTriangles())); |
|
69 |
68 if (object->model() and object->model() != this) |
70 if (object->model() and object->model() != this) |
69 object->model()->withdraw(object); |
71 object->model()->withdraw(object); |
70 |
72 |
71 // TODO: check that the object isn't in the vector once there's a cheap way to do so! |
73 // TODO: check that the object isn't in the vector once there's a cheap way to do so! |
72 beginInsertRows({}, position, position); |
74 beginInsertRows({}, position, position); |