rock_widget_collection  0.1
MultiViewWidget.h
Go to the documentation of this file.
1 /*
2  * File: MuliViewWidget.h
3  * Author: blueck
4  *
5  * Created on 10. Februar 2011, 14:14
6  */
7 
8 #ifndef MULIVIEWWIDGET_H
9 #define MULIVIEWWIDGET_H
10 
11 #include <QWidget>
12 #include <QHash>
13 #include <QVBoxLayout>
14 #include <QHBoxLayout>
15 #include <QGridLayout>
16 #include <QTimer>
17 #include <QtDesigner/QDesignerExportWidget>
18 
19 #include <iostream>
20 
21 
22 #include "WidgetButton.h"
23 
45 class QDESIGNER_WIDGET_EXPORT MultiViewWidget : public QWidget
46 {
47 
48 
49  Q_OBJECT
50  Q_CLASSINFO("Author", "Bjoern Lueck")
51 
52 public:
57  MultiViewWidget(QWidget* parent);
58 
63  virtual ~MultiViewWidget();
64 
77  void childEvent(QChildEvent* event);
78 
79  bool event(QEvent* event);
80 
81 public slots:
82 
83  void updateView();
84 
92  void addWidget(const QString &name, QWidget* widget, const QIcon &icon=QIcon(), bool useOnlyIcon=false, int position = 0);
93 
100  QWidget* getWidget(const QString &name);
101 
107  void deleteWidget(const QString &name);
108 
112  void widgetClicked();
113 
120  void setThumbnailSize(int width=150, int height=150);
121 
127  WidgetButton* getButtonForWidget(QWidget* widget);
128 
133  QList<WidgetButton*> getAllWidgetButtons();
134 
140  void setDesignerMode(bool designerMode) { this->designerMode = designerMode; };
141 
146  bool isDesignerMode() { return designerMode; };
147 
148 
153  void fixStatus();
154 
155 
156  signals:
161  void widgetButtonAdded(QWidget* widget);
162 
163 
164 protected:
165 
172  QHash<QString, WidgetButton*> widgets;
174  QGridLayout layout;
175 
176  QHBoxLayout *top, *bottom;
177  QVBoxLayout *left,*mid,*right;
178 
181 
187  QWidget* pseudoWidget;
188 
194  bool clicking;
197 
199  QTimer timer;
200 };
201 
202 #endif /* MULIVIEWWIDGET_H */
203 
QHash< QString, WidgetButton * > widgets
void setDesignerMode(bool designerMode)
QVBoxLayout * right
QHBoxLayout * top
QWidget * pseudoWidget
QGridLayout layout
WidgetButton * currentWidget