Detachment fix.

This commit is contained in:
Andrzej Kapolka 2014-08-21 15:22:34 -07:00
parent 74b39773d6
commit e152e0c2be
2 changed files with 6 additions and 2 deletions

View file

@ -1188,7 +1188,9 @@ QVariant HeightfieldTextureBrushTool::createEdit(bool alternate) {
if (alternate) {
return QVariant::fromValue(PaintHeightfieldTextureEdit(_position, _radius->value(), SharedObjectPointer(), QColor()));
} else {
return QVariant::fromValue(PaintHeightfieldTextureEdit(_position, _radius->value(), _textureEditor->getObject(),
SharedObjectPointer texture = _textureEditor->getObject();
_textureEditor->detachObject();
return QVariant::fromValue(PaintHeightfieldTextureEdit(_position, _radius->value(), texture,
_texture ? _texture->getAverageColor() : QColor()));
}
}

View file

@ -193,7 +193,9 @@ void SharedObjectEditor::detachObject() {
for (int i = 0; i < form->rowCount(); i++) {
QWidget* widget = form->itemAt(i, QFormLayout::FieldRole)->widget();
QMetaProperty property = metaObject->property(widget->property("propertyIndex").toInt());
connect(_object.data(), signal(property.notifySignal().methodSignature()), SLOT(updateProperty()));
if (property.hasNotifySignal()) {
connect(_object.data(), signal(property.notifySignal().methodSignature()), SLOT(updateProperty()));
}
}
}