MCPcopy Create free account
hub / github.com/KDAB/GammaRay / documentSelected

Method documentSelected

plugins/textdocumentinspector/textdocumentinspector.cpp:80–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void 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
96void TextDocumentInspector::documentElementSelected(const QItemSelection &selected,
97 const QItemSelection &deselected)

Callers

nothing calls this directly

Calls 3

setDocumentMethod · 0.80
isEmptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected