void WatchVector::attachFpData(PixelBox *f, QString name) { int idx; if (!f) { return; } if (!getNumFreeMappings()) { return; } if (getIndexFromPixelBox(f) != -1) { return; } /* Fill empty slot with attachment */ idx = getFirstFreeMapping(); m_pData[idx] = f; m_qName[idx] = name; m_nActiveMappings++; connect(f, SIGNAL(dataChanged()), this, SLOT(updateData())); connect(f, SIGNAL(dataDeleted()), this, SLOT(detachData())); connect(this->m_pImageView, SIGNAL(minMaxAreaChanged(const QRect&)), f, SLOT(setMinMaxArea(const QRect&))); connect(this->m_pImageView, SIGNAL(setMappingBounds()), this, SLOT(updateAllMinMax())); connect(f, SIGNAL(minMaxAreaChanged()), this, SLOT(onMinMaxAreaChanged())); addMappingOptions(idx); updateGUI(); }
bool VertexTableModel::addVertexBox(VertexBox *vb, QString &name) { for (int i = 0; i < m_pData.count(); i++) { if (m_pData[i] == vb) { return false; } } m_pData.append(vb); m_Names.append(name); connect(vb, SIGNAL(dataDeleted()), this, SLOT(detachData())); connect(vb, SIGNAL(dataChanged()), this, SLOT(updateData())); reset(); return true; }