diff --git a/tooltipcontent.cpp b/tooltipcontent.cpp index 881c17115..6a928a08c 100644 --- a/tooltipcontent.cpp +++ b/tooltipcontent.cpp @@ -95,9 +95,9 @@ ToolTipContent::ToolTipContent(const QString &mainText, const QPixmap &image) : d(new ToolTipContentPrivate) { - d->mainText = mainText; - d->subText = subText; - d->image = image; + setMainText(mainText); + setSubText(subText); + setImage(image); } ToolTipContent::ToolTipContent(const QString &mainText, @@ -105,9 +105,9 @@ ToolTipContent::ToolTipContent(const QString &mainText, const QIcon &icon) : d(new ToolTipContentPrivate) { - d->mainText = mainText; - d->subText = subText; - d->image = icon.pixmap(IconSize(KIconLoader::Desktop)); + setMainText(mainText); + setSubText(subText); + setImage(icon); } bool ToolTipContent::isEmpty() const @@ -120,7 +120,7 @@ bool ToolTipContent::isEmpty() const void ToolTipContent::setMainText(const QString &text) { - d->mainText = text; + d->mainText = text.trimmed(); } QString ToolTipContent::mainText() const @@ -132,7 +132,7 @@ QString ToolTipContent::mainText() const void ToolTipContent::setSubText(const QString &text) { - d->subText = text; + d->subText = text.trimmed(); } QString ToolTipContent::subText() const