2003-08-23 00:17:00 +00:00
|
|
|
// -*- C++ -*-
|
2002-11-18 19:52:29 +00:00
|
|
|
/**
|
|
|
|
* \file qfontexample.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-11-18 19:52:29 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <qwidget.h>
|
|
|
|
#include <qfont.h>
|
|
|
|
|
|
|
|
class QFontExample : public QWidget {
|
|
|
|
|
|
|
|
public:
|
|
|
|
QFontExample(QWidget * parent, const char * name)
|
|
|
|
: QWidget(parent, name) {}
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-18 19:52:29 +00:00
|
|
|
void set(QFont const & font, QString const & text);
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-18 19:52:29 +00:00
|
|
|
virtual QSize sizeHint() const;
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-18 19:52:29 +00:00
|
|
|
protected:
|
|
|
|
virtual void paintEvent(QPaintEvent * p);
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-11-18 19:52:29 +00:00
|
|
|
private:
|
|
|
|
QFont font_;
|
|
|
|
QString text_;
|
|
|
|
};
|