ui/qt/list.cpp

changeset 112
c3f2f16fa4b8
parent 109
c3dfcb8f0be7
equal deleted inserted replaced
111:81c4f73236a4 112:c3f2f16fa4b8
46 return NULL; 46 return NULL;
47 } 47 }
48 48
49 UIWIDGET ui_listview_create(UiObject* obj, UiListArgs *args) { 49 UIWIDGET ui_listview_create(UiObject* obj, UiListArgs *args) {
50 UiContainerPrivate *ctn = ui_obj_container(obj); 50 UiContainerPrivate *ctn = ui_obj_container(obj);
51 UI_APPLY_LAYOUT(ctn->layout, args);
52 51
53 QListView *view = new QListView(); 52 QListView *view = new QListView();
54 ui_getvaluefunc2 getvalue = nullptr; 53 ui_getvaluefunc2 getvalue = nullptr;
55 void *getvaluedata = nullptr; 54 void *getvaluedata = nullptr;
56 if(args->getvalue2) { 55 if(args->getvalue2) {
85 s, 84 s,
86 SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), 85 SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
87 model, 86 model,
88 SLOT(selectionChanged(const QItemSelection &, const QItemSelection &))); 87 SLOT(selectionChanged(const QItemSelection &, const QItemSelection &)));
89 88
90 89 UiLayout layout = UI_ARGS2LAYOUT(args);
91 ctn->add(view); 90 ctn->add(view, layout);
92 91
93 return view; 92 return view;
94 } 93 }
95 94
96 UIWIDGET ui_table_create(UiObject* obj, UiListArgs *args) { 95 UIWIDGET ui_table_create(UiObject* obj, UiListArgs *args) {
97 UiContainerPrivate *ctn = ui_obj_container(obj); 96 UiContainerPrivate *ctn = ui_obj_container(obj);
98 UI_APPLY_LAYOUT(ctn->layout, args);
99 97
100 QTreeView *view = new QTreeView(); 98 QTreeView *view = new QTreeView();
101 view->setItemsExpandable(false); 99 view->setItemsExpandable(false);
102 view->setRootIsDecorated(false); 100 view->setRootIsDecorated(false);
103 if(args->multiselection) { 101 if(args->multiselection) {
136 SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), 134 SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
137 model, 135 model,
138 SLOT(selectionChanged(const QItemSelection &, const QItemSelection &))); 136 SLOT(selectionChanged(const QItemSelection &, const QItemSelection &)));
139 137
140 138
141 ctn->add(view); 139 UiLayout layout = UI_ARGS2LAYOUT(args);
140 ctn->add(view, layout);
142 141
143 return view; 142 return view;
144 } 143 }

mercurial