avoid putting empty text or unhelpful html elements in the tip text
svn path=/trunk/KDE/kdelibs/; revision=945121
This commit is contained in:
parent
93a9b754a6
commit
d2d756f3fd
@ -64,9 +64,19 @@ public:
|
|||||||
|
|
||||||
void setContent(const ToolTipContent &data)
|
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();
|
document->clear();
|
||||||
data.registerResources(document);
|
data.registerResources(document);
|
||||||
document->setHtml("<p><b>" + data.mainText() + "</b><br>" + data.subText() + "</p>");
|
document->setHtml("<p>" + html + "</p>");
|
||||||
document->adjustSize();
|
document->adjustSize();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user