ui/qt/container.h

changeset 68
bd9fb6476b80
parent 67
f72c4f01bf4a
child 73
473acef47ddd
equal deleted inserted replaced
67:f72c4f01bf4a 68:bd9fb6476b80
33 #include "window.h" 33 #include "window.h"
34 34
35 #include <string.h> 35 #include <string.h>
36 #include <QBoxLayout> 36 #include <QBoxLayout>
37 #include <QGridLayout> 37 #include <QGridLayout>
38 #include <QTabWidget>
39 #include <QStackedWidget>
38 40
39 #define ui_lb2bool(b) ((b) == UI_LAYOUT_TRUE ? TRUE : FALSE) 41 #define ui_lb2bool(b) ((b) == UI_LAYOUT_TRUE ? TRUE : FALSE)
40 #define ui_bool2lb(b) ((b) ? UI_LAYOUT_TRUE : UI_LAYOUT_FALSE) 42 #define ui_bool2lb(b) ((b) ? UI_LAYOUT_TRUE : UI_LAYOUT_FALSE)
41 #define ui_reset_layout(layout) memset(&(layout), 0, sizeof(UiLayout)) 43 #define ui_reset_layout(layout) memset(&(layout), 0, sizeof(UiLayout))
42 44
50 typedef enum UiLayoutBool UiLayoutBool; 52 typedef enum UiLayoutBool UiLayoutBool;
51 53
52 struct UiLayout { 54 struct UiLayout {
53 UiLayoutBool fill; 55 UiLayoutBool fill;
54 bool newline; 56 bool newline;
57 char *label;
55 }; 58 };
56 59
57 struct UiContainer { 60 struct UiContainer {
58 UiLayout layout; 61 UiLayout layout;
59 62
81 UiGridContainer(QGridLayout *grid); 84 UiGridContainer(QGridLayout *grid);
82 85
83 virtual void add(QWidget *widget, bool fill); 86 virtual void add(QWidget *widget, bool fill);
84 }; 87 };
85 88
89 class UiTabViewContainer : public UiContainer {
90 public:
91 QTabWidget *tabwidget;
92
93 UiTabViewContainer(QTabWidget *tabwidget);
94 virtual void add(QWidget *widget, bool fill);
95 };
96
97 class UiStackContainer : public UiContainer {
98 public:
99 QStackedWidget *stack;
100
101 UiStackContainer(QStackedWidget *stack);
102 virtual void add(QWidget *widget, bool fill);
103 };
104
86 #endif /* CONTAINER_H */ 105 #endif /* CONTAINER_H */
87 106

mercurial