Clang: Use CppHoverHandler for diagnostic tooltips

We used to call QTextCharFormat::setToolTip from the ExtraSelection to
install the diagnostic tooltip. Since this allows to set only text
tooltips and we would like to introduce a custom tooltip widget for
diagnostics, make use of CppHoverHandler, which is more flexible.

Change-Id: Ia1b2c3c50810596ce4a3a025002e6e4efd8789db
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2016-01-27 13:37:19 +01:00
committed by Alessandro Portale
parent 593ed52c94
commit 9a4284d666
14 changed files with 475 additions and 52 deletions

View File

@@ -51,6 +51,9 @@ public:
const QVector<ClangBackEnd::DiagnosticContainer> &diagnosticsWithFixIts() const;
QList<QTextEdit::ExtraSelection> takeExtraSelections();
bool hasDiagnosticsAt(uint line, uint column) const;
QVector<ClangBackEnd::DiagnosticContainer> diagnosticsAt(uint line, uint column) const;
void clearDiagnosticsWithFixIts();
private:
@@ -59,7 +62,6 @@ private:
void generateEditorSelections();
void generateTextMarks();
void addClangTextMarks(const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics);
void clearWarningsAndErrors();
private:
TextEditor::TextDocument *m_textDocument;