QSint Library  0.2.2
actiongroup.h
1 #ifndef ACTIONGROUP_H
2 #define ACTIONGROUP_H
3 
4 #include <QTimer>
5 #include <QWidget>
6 #include <QBoxLayout>
7 
8 
9 namespace QSint
10 {
11 
12 
13 class ActionLabel;
14 class ActionPanelScheme;
15 
16 
27 class ActionGroup : public QWidget
28 {
29  Q_OBJECT
30 
31  Q_PROPERTY(bool expandable READ isExpandable WRITE setExpandable)
32  Q_PROPERTY(bool header READ hasHeader WRITE setHeader)
33  Q_PROPERTY(QString headerText READ headerText WRITE setHeaderText)
34 
35 public:
38  explicit ActionGroup(QWidget *parent = 0);
39 
45  explicit ActionGroup(const QString& title,
46  bool expandable = true,
47  QWidget *parent = 0);
48 
54  explicit ActionGroup(const QPixmap& icon,
55  const QString& title,
56  bool expandable = true,
57  QWidget *parent = 0);
58 
73  ActionLabel* addAction(QAction *action, bool addToLayout = true, bool addStretch = true);
74 
79  ActionLabel* addActionLabel(ActionLabel *label, bool addToLayout = true, bool addStretch = true);
80 
85  bool addWidget(QWidget *widget, bool addToLayout = true, bool addStretch = true);
86 
89  QBoxLayout* groupLayout();
90 
95  void setScheme(ActionPanelScheme *pointer);
96 
101  bool isExpandable() const;
102 
107  bool hasHeader() const;
108 
114  QString headerText() const;
115 
116  QSize minimumSizeHint() const;
117 
118 public slots:
122  void showHide();
123 
128  void setExpandable(bool expandable = true);
129 
134  void setHeader(bool enable = true);
135 
141  void setHeaderText(const QString & title);
142 
143 protected slots:
144  void processHide();
145  void processShow();
146 
147 protected:
148  void init(bool header);
149 
150  virtual void paintEvent ( QPaintEvent * event );
151 
152  double m_foldStep, m_foldDelta, m_fullHeight, m_tempHeight;
153  int m_foldDirection;
154 
155  QPixmap m_foldPixmap;
156 
157  class TaskHeader *myHeader;
158  class TaskGroup *myGroup;
159  QWidget *myDummy;
160 
161  ActionPanelScheme *myScheme;
162 };
163 
164 
165 } // namespace
166 
167 #endif // ACTIONGROUP_H
void setScheme(ActionPanelScheme *pointer)
Definition: actiongroup.cpp:59
bool isExpandable() const
Definition: actiongroup.cpp:213
void setHeader(bool enable=true)
Definition: actiongroup.cpp:228
ActionLabel * addActionLabel(ActionLabel *label, bool addToLayout=true, bool addStretch=true)
Definition: actiongroup.cpp:83
void showHide()
Definition: actiongroup.cpp:98
QBoxLayout * groupLayout()
Definition: actiongroup.cpp:67
void setExpandable(bool expandable=true)
Definition: actiongroup.cpp:218
ActionLabel * addAction(QAction *action, bool addToLayout=true, bool addStretch=true)
Definition: actiongroup.cpp:72
Class representing a single group of actions similar to Windows XP task panels.
Definition: actiongroup.h:27
ActionGroup(QWidget *parent=0)
Definition: actiongroup.cpp:14
QString headerText() const
Class representing an action similar to Windows Vista/7 control panel item.
Definition: actionlabel.h:60
void setHeaderText(const QString &title)
Definition: actiongroup.cpp:238
bool addWidget(QWidget *widget, bool addToLayout=true, bool addStretch=true)
Definition: actiongroup.cpp:93
bool hasHeader() const
Definition: actiongroup.cpp:223
Class representing color scheme for ActionPanel and ActionGroup.
Definition: actionpanelscheme.h:20

© Sintegrial Technologies 2011-2014
http://www.sintegrial.com