5 @SuppressWarnings public class QTableWidget : QAbstractItemView{
10 public QTableWidget(long handle){
15 nativehandle = QtXnl.createQObject(QType.qtTableWidget,
this, 0);
16 if (nativehandle == 0){
22 public bool create(@NotNilptr QWidget parent)
override {
23 nativehandle = QtXnl.createQObject(QType.qtTableWidget,
this, parent.nativehandle);
24 if (nativehandle == 0){
31 return QtXnl.long_long_string2(nativehandle, Constant.TABLESETITEM, ((
long)row) << 32 | column, icon, text);
35 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESETCOLUMNCNT, c);
39 return QtXnl.widget_get_int_value(nativehandle, Constant.QTABLEWIDGET_COLCOUNT);
44 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESETROWCNT, c);
48 return QtXnl.widget_get_int_value(nativehandle, Constant.QTABLEWIDGET_ROWCOUNT);
52 return QtXnl.widget_get_int_value(nativehandle, Constant.QTABLEWIDGET_CURROW);
56 return QtXnl.widget_get_int_value(nativehandle, Constant.QTABLEWIDGET_CURCOL);
60 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLEREMOVEROW, n);
64 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLEREMOVECOLUMN, n);
68 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESELECTROW, n);
72 QtXnl.widget_set_v2int_value(item, Constant.TABLEITEMFLAG, add,
remove);
76 QtXnl.object_set_long_int_long(nativehandle, Constant.TABLESETTAG, item, 0, tag);
80 return QtXnl.object_get_long_int(0,Constant. TABLEGETTAG, item, 0);
84 QtXnl.widget_set_bool_value(nativehandle, Constant.TABLESETHHLS, b);
87 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESETVHRM, b);
90 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESETVHDSS, b);
93 QtXnl.widget_set_bool_value(nativehandle, Constant.TABLESETSG, s);
96 QtXnl.widget_set_bool_value(nativehandle, Constant.TABLESETVHV, bv);
99 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESETSM, sm);
102 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESETSB, sb);
105 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESETET, et);
108 QtXnl.widget_set_v2int_value(nativehandle, Constant.TABLESETHHRS, row, size);
111 QtXnl.widget_set_vint_value(nativehandle, Constant.TABLESETHHFH, h);
114 QtXnl.widget_set_object_value(nativehandle, Constant.SETTABHHCOLUMNS, columns);
117 QtXnl.widget_set_object_value(nativehandle, Constant.SETTABVHCOLUMNS, columns);
120 return (
String)QtXnl.core_getStringlongint(nativehandle, Constant.TABLEGETTEXTBYRC, x, y);
123 return (
String)QtXnl.core_getStringlongint(item, Constant.TABLEGETTEXTBYITEM, 0, 0);
126 QtXnl.widget_slot(nativehandle, Constant.TABLECLEAR);
129 QtXnl.widget_slot(nativehandle,Constant. TABLECLEARCONTENT);
132 return (
long[])QtXnl.widget_get_object(nativehandle, Constant.TABLEGETSELITEM);
135 return QtXnl.object_get_long_int(nativehandle,Constant. TABLEGETITEM, row, column);
138 long [] rs = (
long[])QtXnl.widget_get_object(nativehandle, Constant.TABLEGETSELRANGE);
140 QRect []rgs =
new QRect[rs.length / 2];
142 for (
long i =0, c = rgs.length; i < c; i++){
143 QRect r =
new QRect((
int)(rs[i * 2] >> 32) & 0xffffffff, (
int)(rs[i * 2 + 1] >> 32) & 0xffffffff, (
int)rs[i * 2] & 0xffffffff, (
int)rs[i * 2 + 1] & 0xffffffff);
152 QtXnl.widget_set_intlongstring_value(0, Constant.SETTABLEITEMTEXT, item, 0, text);
155 QtXnl.widget_set_intlongstring_value(0, Constant.SETTABLEITEMICON, item, 0, iconFile);
158 QtXnl.widget_set_intlongint_value(nativehandle, Constant.SETTABLEITEMCOLOR, item, 0, color);
161 QtXnl.widget_set_intlongint_value(nativehandle, Constant.SETTABLEITEMBACKCOLOR, item, 0, color);
164 QtXnl.widget_set_int_bool_value(item, Constant.TABITEMSETCHECK, 0, checked);
168 return QtXnl.widget_get_int_bool(item, Constant.TABITEMGETCHECK, 0);
172 return QtXnl.widget_get_int_value(item, Constant.TABITEMGETFLAG);
176 QtXnl.widget_set_intlongint_value(nativehandle, Constant.TABLESETCELLWIDGET, w.nativehandle, x, y);
180 return (QWidget)QtXnl.object_get_handle2(nativehandle, Constant.TABLEGETCELLWIDGET, x, y);
184 return (QHeaderView)QtXnl.widget_get_object(nativehandle, Constant.QTW_VERTICALHEADER);
188 return (QHeaderView)QtXnl.widget_get_object(nativehandle, Constant.QTW_HORIZONTALHEADER);
195 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_ROWVIEWPORTPOSITION, row, 0);
198 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_ROWAT, y, 0);
201 QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_SETROWHEIGHT, row, height);
204 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_ROWHEIGHT, row, 0);
207 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_COLUMNVIEWPORTPOSITION, column, 0);
210 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_COLUMNAT, x, 0);
213 QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_SETCOLUMNWIDTH, column, width);
216 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_COLUMNWIDTH, column, 0);
219 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_ISROWHIDDEN, row, 0) != 0;
222 QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_SETROWHIDDEN, row, hide ? 1 : 0);
225 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_ISCOLUMNHIDDEN, column, 0) != 0;
228 QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_SETCOLUMNHIDDEN, column, hide ? 1 : 0);
231 QtXnl.widget_set_bool_value(nativehandle, Constant.QTV_SETSORTINGENABLED, enable);
234 return QtXnl.widget_get_bool_value(nativehandle, Constant.QTV_ISSORTINGENABLED);
237 return QtXnl.widget_get_bool_value(nativehandle, Constant.QTV_SHOWGRID);
240 return (PenStyle)QtXnl.widget_get_int_value(nativehandle, Constant.QTV_GRIDSTYLE);
243 QtXnl.widget_set_vint_value(nativehandle, Constant.QTV_SETGRIDSTYLE, style);
246 QtXnl.widget_set_bool_value(nativehandle, Constant.QTV_SETWORDWRAP, on);
249 return QtXnl.widget_get_bool_value(nativehandle, Constant.QTV_WORDWRAP);
252 QtXnl.widget_set_bool_value(nativehandle, Constant.QTV_SETCORNERBUTTONENABLED, enable);
255 return QtXnl.widget_get_bool_value(nativehandle, Constant.QTV_ISCORNERBUTTONENABLED);
257 public void setSpan(
int row,
int column,
int rowSpan,
int columnSpan){
258 QtXnl.native_int4(nativehandle, Constant.QTV_SETSPAN, row, column, rowSpan, columnSpan);
261 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_ROWSPAN, row, column);
264 return QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_COLUMNSPAN, row, column);
267 QtXnl.widget_slot(nativehandle, Constant.QTV_CLEARSPANS);
270 QtXnl.widget_set_v2int_value(nativehandle, Constant.QTV_SORTBYCOLUMN, column, order);