Debugger: Fix tooltips

Fixes: QTCREATORBUG-19574
Fixes: QTCREATORBUG-23807
Change-Id: I61f997e69f4a747aff8c5e1044bb6d856494ae47
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Viacheslav Tertychnyi
2020-04-02 18:18:04 +03:00
parent 3af1a7b4cf
commit e0e5334d83
6 changed files with 12 additions and 4 deletions

View File

@@ -1081,6 +1081,7 @@ void CdbEngine::doUpdateLocals(const UpdateParameters &updateParameters)
showMessage(response.data["msg"].data(), LogError);
}
watchHandler()->notifyUpdateFinished();
updateToolTips();
};
runCommand(cmd);

View File

@@ -2358,6 +2358,10 @@ void DebuggerEngine::updateItem(const QString &iname)
QTC_CHECK(item);
WatchModelBase *model = handler->model();
QTC_CHECK(model);
if (item && !item->wantsChildren) {
updateToolTips();
return;
}
if (item && !model->hasChildren(model->indexForItem(item))) {
handler->notifyUpdateStarted(UpdateParameters(iname));
item->setValue(decodeData({}, "notaccessible"));

View File

@@ -1179,7 +1179,7 @@ DebuggerToolTipManagerPrivate::DebuggerToolTipManagerPrivate(DebuggerEngine *eng
this, &DebuggerToolTipManagerPrivate::saveSessionData);
connect(SessionManager::instance(), &SessionManager::aboutToUnloadSession,
this, &DebuggerToolTipManagerPrivate::sessionAboutToChange);
setupEditors();
debugModeEntered();
}
void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
@@ -1241,8 +1241,6 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
DEBUG("SYNC IN STATE" << tooltip->state);
tooltip->updateTooltip(m_engine);
*handled = true;
} else {
context.iname = "tooltip." + toHex(context.expression);
@@ -1256,7 +1254,6 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
tooltip->context.mousePosition = point;
ToolTip::move(point, DebuggerMainWindow::instance());
DEBUG("UPDATING DELAYED.");
*handled = true;
} else {
DEBUG("CREATING DELAYED.");
tooltip = new DebuggerToolTipHolder(context);
@@ -1272,6 +1269,8 @@ void DebuggerToolTipManagerPrivate::slotTooltipOverrideRequested
}
}
}
*handled = true;
}
void DebuggerToolTipManagerPrivate::slotEditorOpened(IEditor *e)
@@ -1323,6 +1322,7 @@ void DebuggerToolTipManagerPrivate::leavingDebugMode()
foreach (IEditor *e, DocumentModel::editorsForOpenedDocuments()) {
if (auto toolTipEditor = qobject_cast<BaseTextEditor *>(e)) {
toolTipEditor->editorWidget()->verticalScrollBar()->disconnect(this);
toolTipEditor->editorWidget()->disconnect(this);
toolTipEditor->disconnect(this);
}
}

View File

@@ -4818,6 +4818,7 @@ void GdbEngine::handleFetchVariables(const DebuggerResponse &response)
m_inUpdateLocals = false;
updateLocalsView(response.data);
watchHandler()->notifyUpdateFinished();
updateToolTips();
}
QString GdbEngine::msgPtraceError(DebuggerStartMode sm)

View File

@@ -786,6 +786,7 @@ void LldbEngine::doUpdateLocals(const UpdateParameters &params)
cmd.callback = [this](const DebuggerResponse &response) {
updateLocalsView(response.data);
watchHandler()->notifyUpdateFinished();
updateToolTips();
};
runCommand(cmd);

View File

@@ -735,6 +735,7 @@ void UvscEngine::handleUpdateLocals(bool partial)
updateLocalsView(all);
watchHandler()->notifyUpdateFinished();
updateToolTips();
}
void UvscEngine::handleInsertBreakpoint(const QString &exp, const Breakpoint &bp)