Skip to content

Commit c072239

Browse files
bobsayshilolmilianw
authored andcommitted
fix: Show the same thing on lines with and without samples
1 parent 9d2767d commit c072239

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/models/disassemblymodel.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,15 @@ QVariant DisassemblyModel::data(const QModelIndex& index, int role) const
130130
return {};
131131
}
132132

133+
const auto tooltip = tr("addr: <tt>%1</tt><br/>assembly: <tt>%2</tt><br/>hexdump: <tt>%3</tt>")
134+
.arg(QString::number(data.addr, 16), line.toHtmlEscaped(), data.hexdump);
135+
133136
auto it = m_offsetMap.find(data.addr);
134137
if (it != m_offsetMap.end()) {
135138
const auto event = index.column() - COLUMN_COUNT;
136139
const auto& locationCost = it.value();
137140

138141
if (role == Qt::ToolTipRole) {
139-
auto tooltip = tr("addr: <tt>%1</tt><br/>assembly: <tt>%2</tt><br/>hexdump: <tt>%3</tt>")
140-
.arg(QString::number(data.addr, 16), line.toHtmlEscaped(), data.hexdump);
141142
return Util::formatTooltip(tooltip, locationCost, m_results.selfCosts);
142143
}
143144

@@ -156,7 +157,7 @@ QVariant DisassemblyModel::data(const QModelIndex& index, int role) const
156157
return Util::formatCostRelative(costLine, totalCost, true);
157158
} else {
158159
if (role == Qt::ToolTipRole) {
159-
return tr("<qt><tt>%1</tt><hr/>No samples at this location.</qt>").arg(line.toHtmlEscaped());
160+
return tr("<qt>%1<hr/>No samples at this location.</qt>").arg(tooltip);
160161
} else
161162
return QString();
162163
}

0 commit comments

Comments
 (0)