ui/qt/window.cpp

changeset 55
9076eb40454d
parent 54
97bafeca1c7c
child 56
87e3a5dc66dd
equal deleted inserted replaced
54:97bafeca1c7c 55:9076eb40454d
29 #include "../../ucx/mempool.h" 29 #include "../../ucx/mempool.h"
30 #include "../common/context.h" 30 #include "../common/context.h"
31 31
32 #include "window.h" 32 #include "window.h"
33 #include "menu.h" 33 #include "menu.h"
34 #include "toolbar.h"
34 35
35 UiObject* ui_window(char *title, void *window_data) { 36 UiObject* ui_window(char *title, void *window_data) {
36 UcxMempool *mp = ucx_mempool_new(256); 37 UcxMempool *mp = ucx_mempool_new(256);
37 UiObject *obj = (UiObject*)ucx_mempool_calloc(mp, 1, sizeof(UiObject)); 38 UiObject *obj = (UiObject*)ucx_mempool_calloc(mp, 1, sizeof(UiObject));
38 obj->ctx = uic_context(obj, mp); 39 obj->ctx = uic_context(obj, mp);
42 QMainWindow *window = new QMainWindow(); 43 QMainWindow *window = new QMainWindow();
43 obj->widget = window; 44 obj->widget = window;
44 45
45 ui_add_menus(obj, window); 46 ui_add_menus(obj, window);
46 47
48 QToolBar *toolbar = ui_create_toolbar(obj);
49 window->addToolBar(Qt::TopToolBarArea, toolbar);
50
47 obj->widget = window; 51 obj->widget = window;
48 return obj; 52 return obj;
49 } 53 }

mercurial