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 

Generated for HippoDraw Class Library by doxygen