QtFont.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
15 #ifndef _QtFont_H_
16 #define _QtFont_H_
17 
18 #include <qfont.h>
19 
20 #include "graphics/FontBase.h"
21 
22 namespace hippodraw {
23 
28 class QtFont : public FontBase
29 {
30 private:
31 
34 
36  bool m_flag;
37 
38 public:
39 
41  QtFont();
42 
44  QtFont( const std::string & family, int pointsize = 12,
45  int weight = QFont::Normal, bool italic = false );
46 
47 
49  QtFont( const QFont& qfont );
50 
52  virtual ~QtFont();
53 
55  virtual std::string family() const;
56 
58  virtual void setFamily( const std::string & family );
59 
61  virtual int pointSize () const;
62 
64  virtual void setPointSize( int pointsize );
65 
67  virtual int weight () const;
68 
70  virtual void setWeight( int weight );
71 
72  virtual bool italic () const;
73 
75  virtual void setItalic( bool enable );
76 
78  virtual const QFont & font() const;
79 
83  void unsetFont();
84 
86  void setFont( const QFont & qfont );
87 
89  bool isSet();
90 
91 };
92 
93 } // namespace hippodraw
94 
95 #endif //_QtFont_H_
96 
97 
98 
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
bool isSet()
Is the font set ?
Definition: QtFont.cxx:130
An implementation of FontBase that uses a Qt QFont as implementation.
Definition: QtFont.h:28
virtual const QFont & font() const
Get the font object held in here.
Definition: QtFont.cxx:108
virtual int weight() const
Get the weight of the font.
Definition: QtFont.cxx:80
virtual void setItalic(bool enable)
Set the font to be italic.
Definition: QtFont.cxx:101
A abstract base class for font handling.
Definition: FontBase.h:32
virtual void setWeight(int weight)
Set the weight of the font.
Definition: QtFont.cxx:87
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
FontBase class interface.
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

Generated for HippoDraw Class Library by doxygen