From 5a2ae9f9760054b0365d67603afc8a599d44c13d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9nard?= Date: Thu, 27 Nov 2008 14:52:08 +0000 Subject: [PATCH] Don't try to create a nice shadow on a text if the text is empty (avoid some warnings) Rev by aseigo svn path=/trunk/KDE/kdelibs/; revision=889759 --- paintutils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paintutils.cpp b/paintutils.cpp index e13c16097..29245573f 100644 --- a/paintutils.cpp +++ b/paintutils.cpp @@ -49,6 +49,10 @@ void shadowBlur(QImage &image, int radius, const QColor &color) QPixmap shadowText(QString text, QColor textColor, QColor shadowColor, QPoint offset, int radius) { + //don't try to paint stuff on a future null pixmap because the text is empty + if (text.size() == 0) { + return QPixmap(); + } // Draw text QFontMetrics fm(text); QRect textRect = fm.boundingRect(text);