quint32 MonitorGraphicsView::selectedFixtureID() { MonitorFixtureItem *item = getSelectedItem(); if (item != NULL) return item->fixtureID(); else return Fixture::invalidId(); }
void MonitorGraphicsView::removeFixture(quint32 id) { MonitorFixtureItem *item = NULL; if (id == Fixture::invalidId()) { item = getSelectedItem(); if (item != NULL) id = item->fixtureID(); } else item = m_fixtures[id]; if (item == NULL) return; m_scene->removeItem(item); m_fixtures.take(id); delete item; }
bool MonitorGraphicsView::removeFixture(quint32 id) { MonitorFixtureItem *item = NULL; if (id == Fixture::invalidId()) { item = getSelectedItem(); if (item != NULL) id = item->fixtureID(); } else item = m_fixtures[id]; if (item == NULL) return false; m_scene->removeItem(item); m_fixtures.take(id); m_doc->monitorProperties()->removeFixture(id); delete item; return true; }