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 #include <QPaintEvent>
19 void QFontExample::set(QFont const & font, QString const & text)
27 QSize QFontExample::sizeHint() const
29 QFontMetrics m(font_);
30 return QSize(m.width(text_) + 10, m.ascent() + m.descent() + 6);
34 void QFontExample::paintEvent(QPaintEvent *)
37 QFontMetrics m(font_);
41 p.drawRect(0, 0, width() - 1, height() - 1);
42 p.drawText(5, 3 + m.ascent(), text_);