diff options
Diffstat (limited to 'sigmodr/models/WeatherGroupModel.cpp')
| -rw-r--r-- | sigmodr/models/WeatherGroupModel.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sigmodr/models/WeatherGroupModel.cpp b/sigmodr/models/WeatherGroupModel.cpp index 643ba026..c2994324 100644 --- a/sigmodr/models/WeatherGroupModel.cpp +++ b/sigmodr/models/WeatherGroupModel.cpp @@ -80,16 +80,17 @@ void Sigmodr::WeatherGroupModel::addObject(Sigmod::Object* object) if (!object) object = qobject_cast<Sigmod::Sigmod*>(m_object)->newWeather(); if (object->className() == "Weather") - m_objects.append(new WeatherModel(this, qobject_cast<Sigmod::Weather*>(object))); + addChild(new WeatherModel(this, qobject_cast<Sigmod::Weather*>(object))); } -void Sigmodr::WeatherGroupModel::deleteObject(BaseObjectModel* model) +void Sigmodr::WeatherGroupModel::deleteObject(BaseModel* model) { - const int index = m_objects.indexOf(model); + const int index = find(model); if (0 <= index) { qobject_cast<Sigmod::Sigmod*>(m_object)->deleteWeather(index); m_objects[index]->deleteLater(); m_objects.removeAt(index); + childRowChanged(index); } } |
