| 212 | } |
| 213 | |
| 214 | void SGWireframeWidget::setModel(QAbstractItemModel *vertexModel, QAbstractItemModel *adjacencyModel) |
| 215 | { |
| 216 | if (m_vertexModel) { |
| 217 | disconnect(m_vertexModel, nullptr, this, nullptr); |
| 218 | } |
| 219 | m_vertexModel = vertexModel; |
| 220 | m_vertexModel->rowCount(); |
| 221 | connect(m_vertexModel, &QAbstractItemModel::modelReset, |
| 222 | this, &SGWireframeWidget::onVertexModelReset); |
| 223 | connect(m_vertexModel, &QAbstractItemModel::dataChanged, |
| 224 | this, &SGWireframeWidget::onVertexModelDataChanged); |
| 225 | connect(m_vertexModel, &QAbstractItemModel::rowsInserted, |
| 226 | this, &SGWireframeWidget::onVertexModelRowsInserted); |
| 227 | |
| 228 | if (m_adjacencyModel) { |
| 229 | disconnect(m_adjacencyModel, nullptr, this, nullptr); |
| 230 | } |
| 231 | m_adjacencyModel = adjacencyModel; |
| 232 | m_adjacencyModel->rowCount(); |
| 233 | connect(m_adjacencyModel, &QAbstractItemModel::modelReset, |
| 234 | this, &SGWireframeWidget::onAdjacencyModelReset); |
| 235 | connect(m_adjacencyModel, &QAbstractItemModel::dataChanged, |
| 236 | this, &SGWireframeWidget::onAdjacencyModelDataChanged); |
| 237 | connect(m_adjacencyModel, &QAbstractItemModel::rowsInserted, |
| 238 | this, &SGWireframeWidget::onAdjacencyModelRowsInserted); |
| 239 | } |
| 240 | |
| 241 | void SGWireframeWidget::setHighlightModel(QItemSelectionModel *selectionModel) |
| 242 | { |