MCPcopy Create free account
hub / github.com/KDE/kdevelop / updateView

Method updateView

kdevplatform/documentation/documentationview.cpp:252–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void DocumentationView::updateView()
253{
254 if (mCurrent != mHistory.end()) {
255 mProviders->setCurrentIndex(mProvidersModel->rowForProvider((*mCurrent)->provider()));
256 mIdentifiers->completer()->setModel((*mCurrent)->provider()->indexModel());
257 mIdentifiers->setText((*mCurrent)->name());
258 mIdentifiers->completer()->setCompletionPrefix((*mCurrent)->name());
259 } else {
260 mIdentifiers->clear();
261 }
262
263 QLayoutItem* lastview = layout()->takeAt(0);
264 Q_ASSERT(lastview);
265
266 if (lastview->widget()->parent() == this) {
267 lastview->widget()->deleteLater();
268 }
269
270 delete lastview;
271
272 mFindDoc->setEnabled(false);
273 QWidget* w;
274 if (mCurrent != mHistory.end()) {
275 w = (*mCurrent)->documentationWidget(mFindDoc, this);
276 Q_ASSERT(w);
277
278 if (auto* const standardView = qobject_cast<StandardDocumentationView*>(w)) {
279 connect(standardView, &StandardDocumentationView::browseForward, this, &DocumentationView::tryBrowseForward);
280 connect(standardView, &StandardDocumentationView::browseBack, this, &DocumentationView::tryBrowseBack);
281 }
282 } else {
283 // placeholder widget at location of doc view
284 w = new QWidget(this);
285 }
286
287 mFind->setEnabled(mFindDoc->isEnabled());
288 if (!mFindDoc->isEnabled()) {
289 mFindDoc->hide();
290 }
291
292 QLayoutItem* findWidget = layout()->takeAt(0);
293 layout()->addWidget(w);
294 layout()->addItem(findWidget);
295}
296
297void DocumentationView::changedProvider(int row)
298{

Callers

nothing calls this directly

Calls 15

setCurrentIndexMethod · 0.80
rowForProviderMethod · 0.80
endMethod · 0.45
providerMethod · 0.45
setModelMethod · 0.45
indexModelMethod · 0.45
setTextMethod · 0.45
nameMethod · 0.45
clearMethod · 0.45
parentMethod · 0.45
widgetMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected