avoid putting empty text or unhelpful html elements in the tip text

svn path=/trunk/KDE/kdelibs/; revision=945121
This commit is contained in:
Aaron J. Seigo 2009-03-26 22:08:36 +00:00
parent 93a9b754a6
commit d2d756f3fd

View File

@ -64,9 +64,19 @@ public:
void setContent(const ToolTipContent &data)
{
QString html;
if (!data.mainText().isEmpty()) {
html.append("<b>" + data.mainText() + "</b>");
if (!data.subText().isEmpty()) {
html.append("<br>");
}
}
html.append(data.subText());
document->clear();
data.registerResources(document);
document->setHtml("<p><b>" + data.mainText() + "</b><br>" + data.subText() + "</p>");
document->setHtml("<p>" + html + "</p>");
document->adjustSize();
update();
}