forked from qt-creator/qt-creator
Do not use deprecated Qt functionality.
Replace all* remaining deprecated Qt 4 functions with their Qt 5 counterparts. This means we no longer need to define the QT_DISABLE_DEPRECATED_BEFORE macro. This patch is relatively small because most source-compatible changes of this kind have been done before. * The one exception is the QmlDesigner, which uses QWeakPointer in a deprecated way all over the place. Change-Id: Id4b839c6685f3b5bdf2b89137f95231758ec53c7 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -311,11 +311,11 @@ QString ClangFunctionHintModel::text(int index) const
|
||||
const int end = overview.markedArgumentEnd();
|
||||
|
||||
QString hintText;
|
||||
hintText += Qt::escape(prettyMethod.left(begin));
|
||||
hintText += prettyMethod.left(begin).toHtmlEscaped());
|
||||
hintText += "<b>";
|
||||
hintText += Qt::escape(prettyMethod.mid(begin, end - begin));
|
||||
hintText += prettyMethod.mid(begin, end - begin).toHtmlEscaped());
|
||||
hintText += "</b>";
|
||||
hintText += Qt::escape(prettyMethod.mid(end));
|
||||
hintText += prettyMethod.mid(end).toHtmlEscaped());
|
||||
return hintText;
|
||||
#endif
|
||||
return m_functionSymbols.at(index).hint();
|
||||
|
||||
@@ -91,7 +91,7 @@ void CompletionProposalsBuilder::operator ()(const CXCompletionResult &cxResult)
|
||||
#if defined(CINDEX_VERSION) && (CINDEX_VERSION > 5)
|
||||
const QString brief = Internal::getQString(clang_getCompletionBriefComment(cxResult.CompletionString));
|
||||
if (!brief.isEmpty())
|
||||
m_comment += QLatin1String("<b>Brief:</b> ") + Qt::escape(brief);
|
||||
m_comment += (QLatin1String("<b>Brief:</b> ") + brief).toHtmlEscaped();
|
||||
#endif
|
||||
|
||||
if (m_resultAvailability == CodeCompletionResult::Deprecated) {
|
||||
@@ -384,12 +384,12 @@ void CompletionProposalsBuilder::concatChunksForObjectiveCMessage(const CXComple
|
||||
const QString text = Internal::getQString(clang_getCompletionChunkText(cxString, index), false);
|
||||
if (chunkKind == CXCompletionChunk_ResultType) {
|
||||
hintPrefix += QLatin1String("(");
|
||||
hintPrefix += Qt::escape(text);
|
||||
hintPrefix += text.toHtmlEscaped();
|
||||
hintPrefix += QLatin1String(") ");
|
||||
indentBonus += 3 + text.length();
|
||||
addSpaceAtPrefixEnd = false;
|
||||
} else {
|
||||
hintPrefix += Qt::escape(text);
|
||||
hintPrefix += text.toHtmlEscaped();
|
||||
indentBonus += text.length();
|
||||
m_snippet += text;
|
||||
}
|
||||
@@ -426,12 +426,12 @@ void CompletionProposalsBuilder::concatChunksForObjectiveCMessage(const CXComple
|
||||
case CXCompletionChunk_Comma:
|
||||
case CXCompletionChunk_HorizontalSpace:
|
||||
m_snippet += text;
|
||||
parts.back().text += Qt::escape(text);
|
||||
parts.back().text += text.toHtmlEscaped();
|
||||
break;
|
||||
case CXCompletionChunk_Placeholder:
|
||||
appendSnippet(text);
|
||||
parts.back().text += QLatin1String("<b>");
|
||||
parts.back().text += Qt::escape(text);
|
||||
parts.back().text += text.toHtmlEscaped();
|
||||
parts.back().text += QLatin1String("</b>");
|
||||
break;
|
||||
case CXCompletionChunk_LeftAngle:
|
||||
@@ -487,7 +487,7 @@ void CompletionProposalsBuilder::concatChunksForNestedName(const CXCompletionStr
|
||||
case CXCompletionChunk_Comma:
|
||||
case CXCompletionChunk_HorizontalSpace:
|
||||
m_snippet += text;
|
||||
m_hint += Qt::escape(text);
|
||||
m_hint += text.toHtmlEscaped();
|
||||
break;
|
||||
|
||||
case CXCompletionChunk_Placeholder:
|
||||
@@ -575,7 +575,7 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr
|
||||
case CXCompletionChunk_Text:
|
||||
case CXCompletionChunk_LeftAngle:
|
||||
case CXCompletionChunk_RightAngle:
|
||||
m_hint += Qt::escape(text);
|
||||
m_hint += text.toHtmlEscaped();
|
||||
break;
|
||||
|
||||
case CXCompletionChunk_HorizontalSpace:
|
||||
@@ -583,14 +583,14 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr
|
||||
if (isInsideTemplateSpec) {
|
||||
m_snippet += text;
|
||||
}
|
||||
m_hint += Qt::escape(text);
|
||||
m_hint += text.toHtmlEscaped();
|
||||
break;
|
||||
|
||||
case CXCompletionChunk_Placeholder:
|
||||
if (isInsideTemplateSpec) {
|
||||
appendSnippet(text);
|
||||
}
|
||||
m_hint += Qt::escape(text);
|
||||
m_hint += text.toHtmlEscaped();
|
||||
break;
|
||||
|
||||
case CXCompletionChunk_TypedText:
|
||||
@@ -599,7 +599,7 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr
|
||||
break;
|
||||
|
||||
case CXCompletionChunk_ResultType: {
|
||||
m_hint += Qt::escape(text);
|
||||
m_hint += text.toHtmlEscaped();
|
||||
QChar last = text[text.size() - 1];
|
||||
if (last != QLatin1Char('*') && last != QLatin1Char('&'))
|
||||
m_hint += QLatin1Char(' ');
|
||||
@@ -698,7 +698,7 @@ void CompletionProposalsBuilder::appendOptionalChunks(const CXCompletionString &
|
||||
|
||||
switch (chunkKind) {
|
||||
case CXCompletionChunk_Placeholder:
|
||||
chunk.hint += Qt::escape(text);
|
||||
chunk.hint += text.toHtmlEscaped();
|
||||
break;
|
||||
|
||||
case CXCompletionChunk_Comma:
|
||||
@@ -742,7 +742,7 @@ void CompletionProposalsBuilder::appendSnippet(const QString &text)
|
||||
void CompletionProposalsBuilder::appendHintBold(const QString &text)
|
||||
{
|
||||
m_hint += QLatin1String("<b>");
|
||||
m_hint += Qt::escape(text);
|
||||
m_hint += text.toHtmlEscaped();
|
||||
m_hint += QLatin1String("</b>");
|
||||
}
|
||||
|
||||
|
||||
@@ -187,10 +187,10 @@ void ClangCodeModelPlugin::test_CXX_snippets()
|
||||
if (ccr.text() != text)
|
||||
continue;
|
||||
hasText = true;
|
||||
QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toAscii());
|
||||
QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toLatin1());
|
||||
}
|
||||
const QString textError(QLatin1String("Text not found:") + text);
|
||||
QVERIFY2(hasText, textError.toAscii());
|
||||
QVERIFY2(hasText, textError.toLatin1());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,12 +298,12 @@ void ClangCodeModelPlugin::test_ObjC_hints()
|
||||
if (ccr.text() != text)
|
||||
continue;
|
||||
hasText = true;
|
||||
QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toAscii());
|
||||
QVERIFY2(hint == ccr.hint(), hintError.arg(ccr.hint()).toAscii());
|
||||
QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toLatin1());
|
||||
QVERIFY2(hint == ccr.hint(), hintError.arg(ccr.hint()).toLatin1());
|
||||
}
|
||||
const QString textError(QString::fromLatin1("Text \"%1\" not found in set %2")
|
||||
.arg(text).arg(texts.join(QLatin1Char(','))));
|
||||
QVERIFY2(hasText, textError.toAscii());
|
||||
QVERIFY2(hasText, textError.toLatin1());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user