QString WatchData::toToolTip() const { if (!valuetooltip.isEmpty()) return QString::number(valuetooltip.size()); QString res; QTextStream str(&res); str << "<html><body><table>"; formatToolTipRow(str, tr("Name"), name); formatToolTipRow(str, tr("Expression"), exp); formatToolTipRow(str, tr("Internal Type"), type); formatToolTipRow(str, tr("Displayed Type"), displayedType); QString val = value; if (value.size() > 1000) { val.truncate(1000); val += tr(" ... <cut off>"); } formatToolTipRow(str, tr("Value"), val); formatToolTipRow(str, tr("Object Address"), QString::fromAscii(hexAddress())); if (referencingAddress) formatToolTipRow(str, tr("Referencing Address"), QString::fromAscii(hexReferencingAddress())); if (size) formatToolTipRow(str, tr("Size"), QString::number(size)); formatToolTipRow(str, tr("Internal ID"), iname); formatToolTipRow(str, tr("Generation"), QString::number(generation)); str << "</table></body></html>"; return res; }
QString WatchItem::toToolTip() const { QString res; QTextStream str(&res); str << "<html><body><table>"; formatToolTipRow(str, tr("Name"), name); formatToolTipRow(str, tr("Expression"), expression()); formatToolTipRow(str, tr("Internal Type"), QLatin1String(type)); bool ok; const quint64 intValue = value.toULongLong(&ok); if (ok && intValue) { formatToolTipRow(str, tr("Value"), QLatin1String("(dec) ") + value); formatToolTipRow(str, QString(), QLatin1String("(hex) ") + QString::number(intValue, 16)); formatToolTipRow(str, QString(), QLatin1String("(oct) ") + QString::number(intValue, 8)); formatToolTipRow(str, QString(), QLatin1String("(bin) ") + QString::number(intValue, 2)); } else { QString val = value; if (val.size() > 1000) { val.truncate(1000); val += QLatin1Char(' '); val += tr("... <cut off>"); } formatToolTipRow(str, tr("Value"), val); } if (realAddress()) formatToolTipRow(str, tr("Object Address"), formatToolTipAddress(realAddress())); if (origaddr) formatToolTipRow(str, tr("Pointer Address"), formatToolTipAddress(origaddr)); if (arrayIndex >= 0) formatToolTipRow(str, tr("Array Index"), QString::number(arrayIndex)); if (size) formatToolTipRow(str, tr("Static Object Size"), tr("%n bytes", 0, size)); formatToolTipRow(str, tr("Internal ID"), QLatin1String(internalName())); str << "</table></body></html>"; return res; }