| 78 | } |
| 79 | |
| 80 | void TextDocumentInspector::documentSelected(const QItemSelection &selected, |
| 81 | const QItemSelection &deselected) |
| 82 | { |
| 83 | Q_UNUSED(deselected); |
| 84 | if (selected.isEmpty()) { |
| 85 | m_textDocumentModel->setDocument(nullptr); |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | const QModelIndex selectedRow = selected.first().topLeft(); |
| 90 | QObject *selectedObj = selectedRow.data(ObjectModel::ObjectRole).value<QObject *>(); |
| 91 | QTextDocument *doc = qobject_cast<QTextDocument *>(selectedObj); |
| 92 | |
| 93 | m_textDocumentModel->setDocument(doc); |
| 94 | } |
| 95 | |
| 96 | void TextDocumentInspector::documentElementSelected(const QItemSelection &selected, |
| 97 | const QItemSelection &deselected) |
nothing calls this directly
no test coverage detected