Truncate the length of a tooltip's main text and sub text to 5000 characters.
svn path=/trunk/KDE/kdelibs/; revision=1178011
This commit is contained in:
parent
b6d4b71680
commit
968d659989
@ -44,6 +44,8 @@ struct ToolTipResource
|
||||
QVariant data;
|
||||
};
|
||||
|
||||
const int MAXIMUM_TEXT_LENGTH = 5000;
|
||||
|
||||
class ToolTipContentPrivate
|
||||
{
|
||||
public:
|
||||
@ -121,7 +123,9 @@ void ToolTipContent::setMainText(const QString &text)
|
||||
|
||||
QString ToolTipContent::mainText() const
|
||||
{
|
||||
return d->mainText;
|
||||
QString text = d->mainText;
|
||||
text.truncate(MAXIMUM_TEXT_LENGTH);
|
||||
return text;
|
||||
}
|
||||
|
||||
void ToolTipContent::setSubText(const QString &text)
|
||||
@ -131,7 +135,9 @@ void ToolTipContent::setSubText(const QString &text)
|
||||
|
||||
QString ToolTipContent::subText() const
|
||||
{
|
||||
return d->subText;
|
||||
QString text = d->subText;
|
||||
text.truncate(MAXIMUM_TEXT_LENGTH);
|
||||
return text;
|
||||
}
|
||||
|
||||
void ToolTipContent::setImage(const QPixmap &image)
|
||||
|
Loading…
Reference in New Issue
Block a user