]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/qfontexample.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / qfontexample.h
1 // -*- C++ -*-
2 /**
3  * \file qfontexample.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QT_QFONTEXAMPLE_H
13 #define QT_QFONTEXAMPLE_H
14
15 #include <qwidget.h>
16 #include <qfont.h>
17 //Added by qt3to4:
18 #include <QPaintEvent>
19
20 class QFontExample : public QWidget {
21
22 public:
23         QFontExample(QWidget * parent)
24                 : QWidget(parent) {}
25
26         void set(QFont const & font, QString const & text);
27
28         virtual QSize sizeHint() const;
29
30 protected:
31         virtual void paintEvent(QPaintEvent * p);
32
33 private:
34         QFont font_;
35         QString text_;
36 };
37
38 #endif