3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
12 #include "qfontexample.h"
16 void QFontExample::set(QFont const & font, QString const & text)
24 QSize QFontExample::sizeHint() const
26 QFontMetrics m(font_);
27 return QSize(m.width(text_) + 10, m.ascent() + m.descent() + 6);
31 void QFontExample::paintEvent(QPaintEvent *)
34 QFontMetrics m(font_);
38 p.drawRect(0, 0, width() - 1, height() - 1);
39 p.drawText(5, 3 + m.ascent(), text_);