| 36 | } |
| 37 | |
| 38 | virtual void setMetaObject(const QMetaObject *metaObject) |
| 39 | { |
| 40 | if (m_rowCount) { |
| 41 | beginRemoveRows(QModelIndex(), 0, m_rowCount - 1); |
| 42 | m_metaObject = nullptr; |
| 43 | m_rowCount = 0; |
| 44 | endRemoveRows(); |
| 45 | } else { |
| 46 | m_metaObject = nullptr; |
| 47 | } |
| 48 | |
| 49 | if (!metaObject) |
| 50 | return; |
| 51 | if (!Probe::instance()->metaObjectRegistry()->isValid(metaObject)) |
| 52 | return; |
| 53 | |
| 54 | const auto newRowCount = (metaObject->*MetaCount)(); |
| 55 | if (newRowCount) { |
| 56 | beginInsertRows(QModelIndex(), 0, newRowCount - 1); |
| 57 | m_metaObject = metaObject; |
| 58 | m_rowCount = newRowCount; |
| 59 | endInsertRows(); |
| 60 | } else { |
| 61 | m_metaObject = metaObject; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
| 66 | { |
nothing calls this directly
no test coverage detected