Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef EXPANDTABTITLE_H
00029 #define EXPANDTABTITLE_H
00030
00031 #include <QtGui>
00032 #include <QGpCoreTools.h>
00033
00034 #include "QGpGuiToolsDLLExport.h"
00035
00036 namespace QGpGuiTools {
00037
00038 class QGPGUITOOLS_EXPORT ExpandTabTitle : public QWidget
00039 {
00040 Q_OBJECT
00041 Q_PROPERTY(QString title READ title WRITE setTitle)
00042 Q_PROPERTY(bool expanded READ expanded WRITE setExpanded)
00043 public:
00044 ExpandTabTitle(QWidget * parent=0);
00045 ~ExpandTabTitle();
00046
00047 void setTitle(QString t) {_title=t;}
00048 QString title() const {return _title;}
00049
00050 void setContent(QWidget * w) {_content=w;}
00051 QWidget * content() const {return _content;}
00052
00053 bool expanded() const {return _expanded;}
00054 void setExpanded(bool e);
00055
00056 bool docked() const {return _docked;}
00057 void setDocked(bool d) {_docked=d;}
00058 signals:
00059 void moveUp();
00060 void moveDown();
00061 void dock();
00062 void addActions(QMenu * );
00063 void resize(int dy);
00064 protected:
00065 virtual void contextMenuEvent(QContextMenuEvent * e);
00066 virtual void paintEvent(QPaintEvent * e);
00067 virtual void mousePressEvent(QMouseEvent * e);
00068 virtual void mouseReleaseEvent(QMouseEvent * e);
00069 virtual void mouseMoveEvent(QMouseEvent * e);
00070 virtual QSize minimumSizeHint() const;
00071 private:
00072 QString _title;
00073 QWidget * _content;
00074 int _resizeStart;
00075 uint _expanded:1;
00076 uint _docked:1;
00077 uint _expandPress:1;
00078 uint _moveUpPress:1;
00079 uint _moveDownPress:1;
00080 uint _dockPress:1;
00081 uint _expandHover:1;
00082 uint _moveUpHover:1;
00083 uint _moveDownHover:1;
00084 uint _dockHover:1;
00085
00086 inline QRect expandRect() const;
00087 inline QRect moveUpRect() const;
00088 inline QRect moveDownRect() const;
00089 inline QRect dockRect() const;
00090 static const int _spacing;
00091 static const int _expandSize;
00092 static const int _upDownSize;
00093 };
00094
00095 }
00096
00097 #endif // EXPANDTABTITLE_H