2 @SuppressWarnings public class QTreeWidget : QTreeView{
4 public static const int
10 ItemIsUserCheckable = 16,
12 ItemIsAutoTristate = 64,
13 ItemIsTristate = ItemIsAutoTristate,
14 ItemNeverHasChildren = 128,
15 ItemIsUserTristate = 256;
26 nativehandle = QtXnl.createQObject(QType.qtTreeWidget,
this, 0);
27 if (nativehandle == 0){
33 public bool create(@NotNilptr QWidget parent)
override {
34 nativehandle = QtXnl.createQObject(QType.qtTreeWidget,
this, parent.nativehandle);
35 if (nativehandle == 0){
42 return QtXnl.long_string2(nativehandle, Constant.TREEWIDGETADD, icon, Text);
45 return QtXnl.long_object_string(nativehandle, Constant.TREEWIDGETADD, Texts, icon);
48 return QtXnl.long_longstring(nativehandle, Constant.TREEWIDGETADD, icon.nativehandle, Text);
51 return QtXnl.long_long_string2(nativehandle, Constant.TREEWIDGETINST, parent, icon, Text);
54 QtXnl.widget_set_native_value(nativehandle, Constant.TREEWIDGETREM, item);
57 QtXnl.widget_set_native_value(nativehandle, Constant.TREESETCURITEM, item);
60 QtXnl.widget_set_intlongstring_value(nativehandle, Constant.SETITEMTEXT, item, row, text);
63 QtXnl.widget_set_intlongstring_value(nativehandle, Constant.SETITEMICON, item, row, file);
66 QtXnl.widget_set_intlongint_value(nativehandle, Constant.SETITEMCOLOR, item, row, color);
69 QtXnl.widget_set_intlongint_value(nativehandle, Constant.SETITEMFONTSIZEPX, item, row, size);
72 QtXnl.widget_set_intlongint_value(nativehandle, Constant.SETITEMFONTSIZEPT, item, row, size);
75 QtXnl.widget_set_intlongint_value(nativehandle, Constant.SETITEMFONTBOLD, item, row, b ? 1 : 0);
78 QtXnl.widget_set_intlongint_value(nativehandle, Constant.SETITEMFONTITALIC, item, row, b ? 1 : 0);
81 QtXnl.widget_set_intlongint_value(nativehandle, Constant.SETBACKCOLOR, item, row, color);
83 public void setItemData(
long item ,
int column, ItemDataRole role,
double value){
84 QtXnl.widget_set_v2int_double_value(item, Constant.QABSTREEITEMSETDATA, column , value, role);
86 public void setItemData(
long item ,
int column, ItemDataRole role,
long value){
87 QtXnl.object_set_long_int_long(role, Constant.SETTREEITEMDATAL, item, column , value);
90 QtXnl.widget_set_intlongint_value(item, Constant.TRSETFOREBR, brush.nativehandle, row, 0);
93 QtXnl.widget_set_int2_object_value(item, Constant.TREEITEM_SETDATA, column, ItemDataRole.DisplayRole, data);
96 QtXnl.widget_set_intlongint_value(item, Constant.TRSETBACKBR, brush.nativehandle, row, 0);
100 QtXnl.widget_set_object_value(nativehandle, Constant.SETCOLUMNS, columns);
104 QtXnl.object_set_long_int_long(nativehandle, Constant.SETTAG, item, row, tag);
108 return QtXnl.object_get_long_int(nativehandle, Constant.GETTAG, item ,row);
111 QtXnl.widget_set_v2int_value(nativehandle, Constant.SETCOLUMBWIDTH, column, width);
114 for (
int i = 0; i < widths.length; i++){
115 QtXnl.widget_set_v2int_value(nativehandle, Constant.SETCOLUMBWIDTH, i, widths[i]);
119 String __txt = (
String)QtXnl.core_getStringlongint(nativehandle, Constant.TRGETITEMTEXT, item, row);
120 __nilptr_safe(__txt);
124 return QtXnl.long_get(nativehandle, Constant.TREEWIDGETGETSEL);
127 QtXnl.object_get_long_int(nativehandle, Constant.TREEITEMSELED, item ,select ? 1 : 0);
130 QtXnl.widget_get_bool_value(nativehandle, Constant.TREEWIDGETCLEAR);
133 return (QWidget)QtXnl.widget_get_object(nativehandle, Constant.GETVIEWPORT);
136 return (QHeaderView)QtXnl.widget_get_object(nativehandle, Constant.GETHEADERVIEW);
139 QtXnl.widget_set_bool_value(nativehandle, Constant.TRCOLUMNSHOW, b);
142 QtXnl.widget_slot(nativehandle, Constant.TRSCROLLBOTTOM);
145 QtXnl.widget_set_bool_value(nativehandle, Constant.TRSORTENABLE, b);
148 QtXnl.widget_set_bool_value(nativehandle, Constant.TRSELECTMODE, b);
151 return QtXnl.widget_get_int_value(nativehandle, Constant.TRHEADERWIDTH);
154 QtXnl.widget_set_bool_value(nativehandle, Constant.TRAUTORESIZE, b);
157 QtXnl.widget_set_vint_value(nativehandle, Constant.TRELIDMODE, mode);
160 QtXnl.widget_set_vint_value(nativehandle, Constant.TREL_SETINDENTATION, v);
163 return QtXnl.widget_get_int_value(nativehandle, Constant.TREEGETCURROW);
166 return QtXnl.widget_get_int_value(nativehandle, Constant.TREEGETCURCOL);
169 QtXnl.widget_set_v2int_value(nativehandle, Constant.TREESETCURROW, row, column);
172 QtXnl.widget_set_v2int_value(item, Constant.TREEWIDGETITEM_SETALIGN, row, align);
175 QtXnl.widget_set_vint_value(nativehandle, Constant.TREESETCURROW, row);
179 QtXnl.widget_set_vint_value(nativehandle, Constant.TREESETCURCOL, column);
183 QtXnl.widget_slot(item, Constant.TRIEMCLEARCHILD);
187 return QtXnl.core_getintlong(nativehandle, Constant.QTREEWIDGETITEMTOINDEX, item);
191 QtXnl.widget_set_bool_value(item, Constant.TRIEMSETEXPAND, bExp);
195 QtXnl.widget_set_bool_value(item, Constant.TRIEMSETHIDDEN, !bVisible);
199 return QtXnl.widget_get_int_value(nativehandle, Constant.TREEGETCOUNT);
203 return QtXnl.object_get_long_int(nativehandle, Constant.GETTOPITEM,
id, 0);
207 return (
long[])QtXnl.widget_get_object(nativehandle, Constant.TREEGETSELITEM);
211 return (
long[])QtXnl.widget_get_object(nativehandle, Constant.TREEGETTOPITEMS);
215 return (
long[])QtXnl.widget_get_object(item, Constant.TREEGETCHILDREN);
219 QtXnl.widget_set_v2int_value(item, Constant.TREEITEMFLAG, add,
remove);
223 return QtXnl.widget_get_int_value(item, Constant.TREEITEMGETFLAG);
227 return QtXnl.long_get(item, Constant.TREEITEMPARENT);
231 QtXnl.widget_set_int_bool_value(item, Constant.TRITEMSETCHECK, column, checked);
235 return QtXnl.widget_get_int_bool(item, Constant.TRITEMGETCHECK, column);
239 return QtXnl.long_intlong(nativehandle, Constant.TRISITEMSELECTED, item) != 0;
243 return QtXnl.widget_get_int_bool(item, Constant.TREEITEMISEXPAND, 0);