forked from qt-creator/qt-creator
Clang: Use QString::arg to build the string
Change-Id: Iec04857b67d2f84ccc824ef85a015ead32ec2c61 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -182,20 +182,21 @@ void ClangHoverHandler::processToolTipInfo(const CppTools::ToolTipInfo &info)
|
|||||||
if (!info.sizeInBytes.isEmpty())
|
if (!info.sizeInBytes.isEmpty())
|
||||||
text.append("\n\n" + tr("%1 bytes").arg(info.sizeInBytes));
|
text.append("\n\n" + tr("%1 bytes").arg(info.sizeInBytes));
|
||||||
if (info.value.isValid()) {
|
if (info.value.isValid()) {
|
||||||
text.append("\n\n" + tr("Value: "));
|
QString value;
|
||||||
switch (info.value.type()) {
|
switch (info.value.type()) {
|
||||||
case static_cast<QVariant::Type>(QMetaType::LongLong):
|
case static_cast<QVariant::Type>(QMetaType::LongLong):
|
||||||
text.append(QString::number(info.value.toLongLong()));
|
value = QString::number(info.value.toLongLong());
|
||||||
break;
|
break;
|
||||||
case static_cast<QVariant::Type>(QMetaType::ULongLong):
|
case static_cast<QVariant::Type>(QMetaType::ULongLong):
|
||||||
text.append(QString::number(info.value.toULongLong()));
|
value = QString::number(info.value.toULongLong());
|
||||||
break;
|
break;
|
||||||
case static_cast<QVariant::Type>(QMetaType::Double):
|
case static_cast<QVariant::Type>(QMetaType::Double):
|
||||||
text.append(QString::number(info.value.toDouble()));
|
value = QString::number(info.value.toDouble());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
QTC_CHECK(false);
|
QTC_CHECK(false);
|
||||||
}
|
}
|
||||||
|
text.append("\n\n" + tr("Value: %1").arg(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
setToolTip(text);
|
setToolTip(text);
|
||||||
|
Reference in New Issue
Block a user