QRect Clock::preparePainter(QPainter *p, const QRect &rect, const QFont &font, const QString &text, bool singleline) { QRect tmpRect = rect; QFont tmpFont = font; prepareFont(tmpFont, tmpRect, text, singleline); p->setFont(tmpFont); return tmpRect; }
void DateTimeGroup::generatePixmap() { if (m_useCustomColor || !m_svgExistsInTheme) { return; } if (!m_svg) { m_svg = new Plasma::Svg(this); m_svg->setImagePath("widgets/labeltexture"); m_svg->setContainsMultipleImages(true); } QRect rect(contentsRect().toRect()); QFont font(m_plainDateTimeGroupFont); prepareFont(font, rect, dtg, true); m_pixmap = Plasma::PaintUtils::texturedText(dtg, font, m_svg); }
void Clock::generatePixmap() { if (m_useCustomColor || !m_svgExistsInTheme) { return; } if (!m_svg) { m_svg = new Plasma::Svg(this); m_svg->setImagePath("widgets/labeltexture"); m_svg->setContainsMultipleImages(true); } const QString fakeTimeString = KGlobal::locale()->formatTime(QTime(23,59,59), m_showSeconds); const QString timeString = KGlobal::locale()->formatTime(m_time, m_showSeconds); QRect rect(contentsRect().toRect()); QFont font(m_plainClockFont); prepareFont(font, rect, fakeTimeString, true); m_pixmap = Plasma::PaintUtils::texturedText(timeString, font, m_svg); }