Dax89 / QHexView

A versatile Hexadecimal widget for Qt5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling multiple metadata objects on the same line

sykhro opened this issue · comments

commented

When hovering a metadata element, the tooltip displays the string from all the metadata inserted in that line. Is this the expected behaviour?
met

Mmmh, it looks like a bug.

commented

Well, by looking at the code it seems like elements are all merged in a single tooltip

const auto& linemetadata = this->get(line);
for(auto& mi : linemetadata)
{
if(mi.comment.isEmpty())
continue;
if(!s.isEmpty())
s += "\n";
s += mi.comment;
}
return s;

QHexView/qhexview.cpp

Lines 81 to 84 in 4524ca3

QString comments = m_document->metadata()->comments(position.line);
if(!comments.isEmpty())
QToolTip::showText(helpevent->globalPos(), comments, this);

I got around this with a silly hack downstream for now

commented

fixed by fca3521