00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00023 
00024 #ifndef _vtkQtChartTitle_h
00025 #define _vtkQtChartTitle_h
00026 
00027 
00028 #include "vtkQtChartExport.h"
00029 #include <QWidget>
00030 #include <QString> 
00031 
00032 class QPainter;
00033 
00034 
00041 class VTKQTCHART_EXPORT vtkQtChartTitle : public QWidget
00042 {
00043   Q_OBJECT
00044 
00045 public:
00050   vtkQtChartTitle(Qt::Orientation orient=Qt::Horizontal, QWidget *parent=0);
00051   virtual ~vtkQtChartTitle() {}
00052 
00057   Qt::Orientation getOrientation() const {return this->Orient;}
00058 
00062   void setOrientation(Qt::Orientation orient);
00063 
00068   QString getText() const {return this->Text;}
00069 
00073   void setText(const QString &text);
00074 
00079   int getTextAlignment() const {return this->Align;}
00080 
00084   void setTextAlignment(int flags) {this->Align = flags;}
00085 
00090   virtual QSize sizeHint() const {return this->Bounds;}
00091 
00095   void drawTitle(QPainter &painter);
00096 
00097 signals:
00099   void orientationChanged();
00100 
00101 protected:
00107   virtual bool event(QEvent *e);
00108 
00112   virtual void paintEvent(QPaintEvent *e);
00113 
00114 private:
00116   void calculateSize();
00117 
00118 private:
00119   QString Text;           
00120   QSize Bounds;           
00121   Qt::Orientation Orient; 
00122   int Align;              
00123 };
00124 
00125 #endif