forked from qt-creator/qt-creator
TextEditor: make the format of completion item detail text adjustable
Instead of always assuming content in the form of rich text allow each item individually to define it's text format for the detail text that is shown as a tooltip of a completion item. Fixes: QTCREATORBUG-22429 Change-Id: I9fa71373a743c26fa06d48acc5f0509584830ca0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -495,6 +495,11 @@ bool ClangAssistProposalItem::isKeyword() const
|
||||
return m_codeCompletions[0].completionKind == CodeCompletion::KeywordCompletionKind;
|
||||
}
|
||||
|
||||
Qt::TextFormat ClangAssistProposalItem::detailFormat() const
|
||||
{
|
||||
return Qt::RichText;
|
||||
}
|
||||
|
||||
bool ClangAssistProposalItem::isSnippet() const
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
QIcon icon() const final;
|
||||
QString detail() const final;
|
||||
bool isKeyword() const final;
|
||||
Qt::TextFormat detailFormat() const final;
|
||||
bool isSnippet() const final;
|
||||
bool isValid() const final;
|
||||
quint64 hash() const final;
|
||||
|
||||
@@ -131,6 +131,11 @@ QString ClangPreprocessorAssistProposalItem::detail() const
|
||||
return QString();
|
||||
}
|
||||
|
||||
Qt::TextFormat ClangPreprocessorAssistProposalItem::detailFormat() const
|
||||
{
|
||||
return Qt::RichText;
|
||||
}
|
||||
|
||||
bool ClangPreprocessorAssistProposalItem::isSnippet() const
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
void setDetail(const QString &detail);
|
||||
QString detail() const final;
|
||||
|
||||
Qt::TextFormat detailFormat() const final;
|
||||
|
||||
bool isSnippet() const final;
|
||||
bool isValid() const final;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user