00001 #ifndef _QDBTSECTION_H 00002 #define _QDBTSECTION_H 00003 00004 #include <qpushbutton.h> 00005 00006 #include <qdbt/qdbtglobal.h> 00007 00008 class QdbtBaseTabular; 00009 class QdbtPImpl; 00010 00011 class QDBT_EXPORT QdbtSection : public QPushButton 00012 { 00013 Q_OBJECT 00014 00015 public: 00016 QdbtSection( QdbtBaseTabular *parent = 0, const char *name = 0 ); 00017 QdbtSection( QString text, QdbtBaseTabular *parent = 0, 00018 const char *name = 0 ); 00019 ~QdbtSection(); 00020 virtual int widthHint() const; 00021 virtual int heightHint() const; 00022 void setAlignment( int alignment ); 00023 int alignment() const; 00024 void setResizable( bool enable ); 00025 bool isResizable() const; 00026 00027 protected: 00028 virtual void resizeEvent( QResizeEvent * ); 00029 virtual void drawButton( QPainter *p ); 00030 virtual void drawButtonLabel( QPainter *p ); 00031 virtual void mousePressEvent( QMouseEvent * ); 00032 virtual void mouseReleaseEvent( QMouseEvent * ); 00033 virtual void mouseMoveEvent( QMouseEvent * ); 00034 virtual void keyPressEvent( QKeyEvent * ); 00035 00036 signals: 00037 void clicked( QdbtSection * ); 00038 void setResizable( QdbtSection *, bool ); 00039 00040 private: 00041 const int colSpacing; 00042 int align; 00043 bool resizable; 00044 QdbtPImpl * _pimpl; 00045 }; 00046 00047 #endif