Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QtFont Class Reference

#include <QtFont.h>

Inheritance diagram for QtFont:

Inheritance graph
[legend]
Collaboration diagram for QtFont:

Collaboration graph
[legend]
List of all members.

Detailed Description

An implementation of FontBase that uses a Qt QFont as implementation.

Author:
Kaustuv <kaustuv@stanford.edu>

Definition at line 27 of file QtFont.h.

Public Member Functions

virtual std::string family () const
 Get the family associated with the font.
virtual const QFontfont () const
 Get the font object held in here.
bool isSet ()
 Is the font set ?
virtual bool italic () const
 Returns true if the font is italic, othwise returns false.
virtual int pointSize () const
 Get the pointsize of the font.
 QtFont (const QFont &qfont)
 This constructor provides and way of creting QtFont from QFont.
 QtFont (const std::string &family, int pointsize=12, int weight=QFont::Normal, bool italic=false)
 Constructor which is called to set the family.
 QtFont ()
 The default constructor.
virtual void setFamily (const std::string &family)
 Set the family associated with the font.
void setFont (const QFont &qfont)
 Set the font object of this class to be the one described by qfont.
virtual void setItalic (bool enable)
 Set the font to be italic.
virtual void setPointSize (int pointsize)
 Set the pointsize of the font.
virtual void setWeight (int weight)
 Set the weight of the font.
void unsetFont ()
 Sets the font object of this class to be Null.
virtual int weight () const
 Get the weight of the font.
virtual ~QtFont ()
 The destructor.

Private Attributes

bool m_flag
 Keeps a track if the font is set of not.
QFont m_font
 The font object.


Constructor & Destructor Documentation

QtFont::QtFont  ) 
 

The default constructor.

Definition at line 21 of file QtFont.cxx.

QtFont::QtFont const std::string family,
int  pointsize = 12,
int  weight = QFont::Normal,
bool  italic = false
 

Constructor which is called to set the family.

Definition at line 28 of file QtFont.cxx.

QtFont::QtFont const QFont qfont  ) 
 

This constructor provides and way of creting QtFont from QFont.

Definition at line 35 of file QtFont.cxx.

References m_flag, and m_font.

QtFont::~QtFont  )  [virtual]
 

The destructor.

Definition at line 42 of file QtFont.cxx.


Member Function Documentation

string QtFont::family  )  const [virtual]
 

Get the family associated with the font.

Implements FontBase.

Definition at line 48 of file QtFont.cxx.

References QFont::family(), QString::latin1(), and m_font.

const QFont & QtFont::font  )  const [virtual]
 

Get the font object held in here.

Definition at line 106 of file QtFont.cxx.

References m_font.

bool QtFont::isSet  ) 
 

Is the font set ?

Definition at line 128 of file QtFont.cxx.

References m_flag.

bool QtFont::italic  )  const [virtual]
 

Returns true if the font is italic, othwise returns false.

Implements FontBase.

Definition at line 92 of file QtFont.cxx.

References QFont::italic(), and m_font.

int QtFont::pointSize  )  const [virtual]
 

Get the pointsize of the font.

Implements FontBase.

Definition at line 64 of file QtFont.cxx.

References m_font, and QFont::pointSize().

void QtFont::setFamily const std::string family  )  [virtual]
 

Set the family associated with the font.

Implements FontBase.

Definition at line 57 of file QtFont.cxx.

References m_font, and QFont::setFamily().

void QtFont::setFont const QFont qfont  ) 
 

Set the font object of this class to be the one described by qfont.

Definition at line 113 of file QtFont.cxx.

References m_flag, and m_font.

void QtFont::setItalic bool  enable  )  [virtual]
 

Set the font to be italic.

Implements FontBase.

Definition at line 99 of file QtFont.cxx.

References m_font, and QFont::setItalic().

void QtFont::setPointSize int  pointsize  )  [virtual]
 

Set the pointsize of the font.

Implements FontBase.

Definition at line 71 of file QtFont.cxx.

References m_font, and QFont::setPointSize().

void QtFont::setWeight int  weight  )  [virtual]
 

Set the weight of the font.

Implements FontBase.

Definition at line 85 of file QtFont.cxx.

References m_font, and QFont::setWeight().

void QtFont::unsetFont  ) 
 

Sets the font object of this class to be Null.

i.e. programs using this class should have a logic built into it which now will start using default font for drawing. Sets the object m_flag as false.

Definition at line 121 of file QtFont.cxx.

References m_flag.

int QtFont::weight  )  const [virtual]
 

Get the weight of the font.

Implements FontBase.

Definition at line 78 of file QtFont.cxx.

References m_font, and QFont::weight().


Member Data Documentation

bool QtFont::m_flag [private]
 

Keeps a track if the font is set of not.

Definition at line 35 of file QtFont.h.

Referenced by isSet(), QtFont(), setFont(), and unsetFont().

QFont QtFont::m_font [private]
 

The font object.

Definition at line 32 of file QtFont.h.

Referenced by family(), font(), italic(), pointSize(), QtFont(), setFamily(), setFont(), setItalic(), setPointSize(), setWeight(), and weight().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3