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.
13 #include "qfontexample.h"
17 void QFontExample::set(QFont const & font, QString const & text)
25 QSize QFontExample::sizeHint() const
27 QFontMetrics m(font_);
28 return QSize(m.width(text_) + 10, m.ascent() + m.descent() + 6);
32 void QFontExample::paintEvent(QPaintEvent *)
35 QFontMetrics m(font_);
39 p.drawRect(0, 0, width() - 1, height() - 1);
40 p.drawText(5, 3 + m.ascent(), text_);