void ModelObjectInspectorView::selectModelObject(const openstudio::model::ModelObject& modelObject) { if (m_modelObject){ this->disconnect(m_modelObject->getImpl<openstudio::model::detail::ModelObject_Impl>().get()); } m_modelObject = modelObject; connect(m_modelObject->getImpl<model::detail::ModelObject_Impl>().get(), &model::detail::ModelObject_Impl::onChange, this, &ModelObjectInspectorView::update); onSelectModelObject(*m_modelObject); }
void ModelObjectInspectorView::selectModelObject(const openstudio::model::ModelObject& modelObject) { if (m_modelObject){ m_modelObject->getImpl<openstudio::model::detail::ModelObject_Impl>().get()->onChange.disconnect<ModelObjectInspectorView, &ModelObjectInspectorView::update>(this); } m_modelObject = modelObject; m_modelObject->getImpl<model::detail::ModelObject_Impl>().get()->onChange.connect<ModelObjectInspectorView, &ModelObjectInspectorView::update>(this); onSelectModelObject(*m_modelObject); }