QtFont.cxx
Go to the documentation of this file.
1 
14 #include "QtFont.h"
15 
16 #include <string>
17 
18 using std::string;
19 
20 namespace hippodraw {
21 
24  : m_font( QFont ("times") ),
25  m_flag( false )
26 {
27 }
28 
30 QtFont ( const std::string & family, int pointsize, int weight, bool italic )
31  :m_font( family.c_str(), pointsize, weight, italic ),
32  m_flag( false )
33 {
34 }
35 
37 QtFont( const QFont& qfont )
38 {
39  m_font = qfont;
40  m_flag = true;
41 }
42 
45 {
46 }
47 
48 string
50 family() const
51 {
52  QString qstr = m_font.family();
53 
54  return qstr.latin1();
55 }
56 
57 void
59 setFamily ( const std::string & family )
60 {
61  m_font.setFamily( family.c_str() );
62 }
63 
64 int
66 pointSize() const
67 {
68  return m_font.pointSize();
69 }
70 
71 void
73 setPointSize( int pointsize )
74 {
75  m_font.setPointSize( pointsize );
76 }
77 
78 int
80 weight () const
81 {
82  return m_font.weight();
83 }
84 
85 void
88 {
89  m_font.setWeight( weight );
90 }
91 
92 bool
94 italic () const
95 {
96  return m_font.italic();
97 }
98 
99 void
100 QtFont::
101 setItalic( bool enable )
102 {
103  m_font.setItalic( enable );
104 }
105 
106 const QFont &
107 QtFont::
108 font() const
109 {
110  return m_font;
111 }
112 
113 void
114 QtFont::
115 setFont( const QFont & qfont )
116 {
117  m_font = qfont;
118  m_flag = true;
119 }
120 
121 void
122 QtFont::
124 {
125  m_flag = false;
126 }
127 
128 bool
129 QtFont::
131 {
132  return m_flag;
133 }
134 
135 } // namespace hippodraw
136 
137 
138 
void unsetFont()
Sets the font object of this class to be Null.
Definition: QtFont.cxx:123
bool m_flag
Keeps a track if the font is set of not.
Definition: QtFont.h:36
setPointSize(int pointSize)
bool isSet()
Is the font set ?
Definition: QtFont.cxx:130
weight() const
virtual const QFont & font() const
Get the font object held in here.
Definition: QtFont.cxx:108
setWeight(int weight)
virtual int weight() const
Get the weight of the font.
Definition: QtFont.cxx:80
italic() const
virtual void setItalic(bool enable)
Set the font to be italic.
Definition: QtFont.cxx:101
latin1() const
virtual void setWeight(int weight)
Set the weight of the font.
Definition: QtFont.cxx:87
QtFont class interface.
virtual void setPointSize(int pointsize)
Set the pointsize of the font.
Definition: QtFont.cxx:73
virtual int pointSize() const
Get the pointsize of the font.
Definition: QtFont.cxx:66
virtual bool italic() const
Returns true if the font is italic, othwise returns false.
Definition: QtFont.cxx:94
void setFont(const QFont &qfont)
Set the font object of this class to be the one described by qfont.
Definition: QtFont.cxx:115
setItalic(bool enable)
family() const
setFamily(const QString &family)
virtual void setFamily(const std::string &family)
Set the family associated with the font.
Definition: QtFont.cxx:59
virtual ~QtFont()
The destructor.
Definition: QtFont.cxx:44
virtual std::string family() const
Get the family associated with the font.
Definition: QtFont.cxx:50
QFont m_font
The font object.
Definition: QtFont.h:33
QtFont()
The default constructor.
Definition: QtFont.cxx:23
pointSize() const

Generated for HippoDraw Class Library by doxygen