VTK
dox/GUISupport/Qt/Chart/vtkQtChartTitle.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkQtChartTitle.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00020 
00023 
00024 #ifndef _vtkQtChartTitle_h
00025 #define _vtkQtChartTitle_h
00026 
00027 
00028 #include "vtkQtChartExport.h"
00029 #include <QWidget>
00030 #include <QString> // Needed for return type
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