forked from qt-creator/qt-creator
Debugger: Compactify new DebuggerToolTipManager code a bit
Change-Id: I126a6159c5d82af03838da5fcb7dcf2d919d894f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -72,9 +72,6 @@ public:
|
|||||||
void slotTooltipOverrideRequested(TextEditor::TextEditorWidget *editorWidget,
|
void slotTooltipOverrideRequested(TextEditor::TextEditorWidget *editorWidget,
|
||||||
const QPoint &point, int pos, bool *handled);
|
const QPoint &point, int pos, bool *handled);
|
||||||
void slotEditorOpened(Core::IEditor *e);
|
void slotEditorOpened(Core::IEditor *e);
|
||||||
void slotEditorAboutToClose(Core::IEditor *e);
|
|
||||||
void slotCurrentEditorAboutToChange(Core::IEditor *e);
|
|
||||||
void slotCurrentEditorChanged(Core::IEditor *e);
|
|
||||||
void hideAllToolTips();
|
void hideAllToolTips();
|
||||||
void purgeClosedToolTips();
|
void purgeClosedToolTips();
|
||||||
|
|
||||||
@@ -973,24 +970,6 @@ void DebuggerToolTipManagerPrivate::slotEditorOpened(IEditor *e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerToolTipManagerPrivate::slotEditorAboutToClose(IEditor *e)
|
|
||||||
{
|
|
||||||
if (auto textEditor = qobject_cast<BaseTextEditor *>(e))
|
|
||||||
m_tooltips.erase(textEditor->editorWidget());
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerToolTipManagerPrivate::slotCurrentEditorAboutToChange(Core::IEditor *e)
|
|
||||||
{
|
|
||||||
if (auto textEditor = qobject_cast<BaseTextEditor *>(e))
|
|
||||||
textEditor->widget()->window()->removeEventFilter(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerToolTipManagerPrivate::slotCurrentEditorChanged(Core::IEditor *e)
|
|
||||||
{
|
|
||||||
if (auto textEditor = qobject_cast<BaseTextEditor *>(e))
|
|
||||||
textEditor->widget()->window()->installEventFilter(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DebuggerToolTipManagerPrivate::debugModeEntered()
|
void DebuggerToolTipManagerPrivate::debugModeEntered()
|
||||||
{
|
{
|
||||||
// Hook up all signals in debug mode.
|
// Hook up all signals in debug mode.
|
||||||
@@ -1001,22 +980,18 @@ void DebuggerToolTipManagerPrivate::debugModeEntered()
|
|||||||
this, &DebuggerToolTipManagerPrivate::updateVisibleToolTips);
|
this, &DebuggerToolTipManagerPrivate::updateVisibleToolTips);
|
||||||
connect(em, &EditorManager::editorOpened,
|
connect(em, &EditorManager::editorOpened,
|
||||||
this, &DebuggerToolTipManagerPrivate::slotEditorOpened);
|
this, &DebuggerToolTipManagerPrivate::slotEditorOpened);
|
||||||
connect(
|
connect(em, &EditorManager::editorAboutToClose, [this](IEditor *editor) {
|
||||||
em,
|
if (auto textEditor = qobject_cast<BaseTextEditor *>(editor))
|
||||||
&EditorManager::editorAboutToClose,
|
m_tooltips.erase(textEditor->editorWidget());
|
||||||
this,
|
});
|
||||||
&DebuggerToolTipManagerPrivate::slotEditorAboutToClose);
|
connect(em, &EditorManager::currentEditorAboutToChange, [this](IEditor *editor) {
|
||||||
connect(
|
if (auto textEditor = qobject_cast<BaseTextEditor *>(editor))
|
||||||
em,
|
textEditor->widget()->window()->removeEventFilter(this);
|
||||||
&EditorManager::currentEditorAboutToChange,
|
});
|
||||||
this,
|
connect(em, &EditorManager::currentEditorChanged, [this](IEditor *editor) {
|
||||||
&DebuggerToolTipManagerPrivate::slotCurrentEditorAboutToChange);
|
if (auto textEditor = qobject_cast<BaseTextEditor *>(editor))
|
||||||
connect(
|
textEditor->widget()->window()->installEventFilter(this);
|
||||||
em,
|
});
|
||||||
&EditorManager::currentEditorChanged,
|
|
||||||
this,
|
|
||||||
&DebuggerToolTipManagerPrivate::slotCurrentEditorChanged);
|
|
||||||
|
|
||||||
setupEditors();
|
setupEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user