QtFont Class Reference

#include <QtFont.h>

Inheritance diagram for QtFont:

Inheritance graph
FontBase
[legend]
Collaboration diagram for QtFont:

Collaboration graph
FontBaseQFont
[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 28 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 (  ) 

The default constructor.

Definition at line 23 of file QtFont.cxx.

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 30 of file QtFont.cxx.

QtFont ( const QFont qfont  ) 

This constructor provides and way of creting QtFont from QFont.

Definition at line 37 of file QtFont.cxx.

References QtFont::m_flag, and QtFont::m_font.

~QtFont (  )  [virtual]

The destructor.

Definition at line 44 of file QtFont.cxx.


Member Function Documentation

string family (  )  const [virtual]

Get the family associated with the font.

Implements FontBase.

Definition at line 50 of file QtFont.cxx.

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

const QFont & font (  )  const [virtual]

Get the font object held in here.

Definition at line 108 of file QtFont.cxx.

References QtFont::m_font.

bool isSet (  ) 

Is the font set ?

Definition at line 130 of file QtFont.cxx.

References QtFont::m_flag.

bool italic (  )  const [virtual]

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

Implements FontBase.

Definition at line 94 of file QtFont.cxx.

References QFont::italic(), and QtFont::m_font.

int pointSize (  )  const [virtual]

Get the pointsize of the font.

Implements FontBase.

Definition at line 66 of file QtFont.cxx.

References QtFont::m_font, and QFont::pointSize().

void setFamily ( const std::string &  family  )  [virtual]

Set the family associated with the font.

Implements FontBase.

Definition at line 59 of file QtFont.cxx.

References QtFont::m_font, and QFont::setFamily().

void setFont ( const QFont qfont  ) 

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

Definition at line 115 of file QtFont.cxx.

References QtFont::m_flag, and QtFont::m_font.

void setItalic ( bool  enable  )  [virtual]

Set the font to be italic.

Implements FontBase.

Definition at line 101 of file QtFont.cxx.

References QtFont::m_font, and QFont::setItalic().

void setPointSize ( int  pointsize  )  [virtual]

Set the pointsize of the font.

Implements FontBase.

Definition at line 73 of file QtFont.cxx.

References QtFont::m_font, and QFont::setPointSize().

void setWeight ( int  weight  )  [virtual]

Set the weight of the font.

Implements FontBase.

Definition at line 87 of file QtFont.cxx.

References QtFont::m_font, and QFont::setWeight().

void 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 123 of file QtFont.cxx.

References QtFont::m_flag.

int weight (  )  const [virtual]

Get the weight of the font.

Implements FontBase.

Definition at line 80 of file QtFont.cxx.

References QtFont::m_font, and QFont::weight().


Member Data Documentation

bool m_flag [private]

Keeps a track if the font is set of not.

Definition at line 36 of file QtFont.h.

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

QFont m_font [private]

The font object.

Definition at line 33 of file QtFont.h.

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


The documentation for this class was generated from the following files:
Generated for HippoDraw Class Library by doxygen