ui/qt/window.cpp

changeset 66
8d490d97aab8
parent 56
87e3a5dc66dd
child 67
f72c4f01bf4a
equal deleted inserted replaced
65:4697592e24ba 66:8d490d97aab8
32 #include "window.h" 32 #include "window.h"
33 #include "menu.h" 33 #include "menu.h"
34 #include "toolbar.h" 34 #include "toolbar.h"
35 #include "container.h" 35 #include "container.h"
36 36
37 #include <QVBoxLayout>
38
37 UiObject* ui_window(char *title, void *window_data) { 39 UiObject* ui_window(char *title, void *window_data) {
38 UcxMempool *mp = ucx_mempool_new(256); 40 UcxMempool *mp = ucx_mempool_new(256);
39 UiObject *obj = (UiObject*)ucx_mempool_calloc(mp, 1, sizeof(UiObject)); 41 UiObject *obj = (UiObject*)ucx_mempool_calloc(mp, 1, sizeof(UiObject));
40 obj->ctx = uic_context(obj, mp); 42 obj->ctx = uic_context(obj, mp);
41 obj->window = window_data; 43 obj->window = window_data;
47 ui_add_menus(obj, window); 49 ui_add_menus(obj, window);
48 50
49 QToolBar *toolbar = ui_create_toolbar(obj); 51 QToolBar *toolbar = ui_create_toolbar(obj);
50 window->addToolBar(Qt::TopToolBarArea, toolbar); 52 window->addToolBar(Qt::TopToolBarArea, toolbar);
51 53
52 obj->container = new UiWindowContainer(window); 54 //QBoxLayout *box = new QBoxLayout(QBoxLayout::TopToBottom);
55 QBoxLayout *box = new QVBoxLayout();
56 QWidget *boxWidget = new QWidget();
57 boxWidget->setLayout(box);
58 window->setCentralWidget(boxWidget);
59 obj->container = new UiBoxContainer(box);
53 60
54 obj->widget = window; 61 obj->widget = window;
55 return obj; 62 return obj;
56 } 63 }

mercurial