xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
QStandardModel.x
浏览该文件的文档.
1//xlang Source, Name:QStandardModel.x
2//Date: Sun Feb 16:51:39 2022
3package Qt{
4 public static class ItemIndex{
5 int _row = -1, _column = -1;
6 public ItemIndex(){}
7 public ItemIndex(int row, int col){
8 _row = row;
9 _column = col;
10 }
11 public ItemIndex(long id){
12 _row = (id >> 32) & 0xffffffff;
13 _column = id & 0xffffffff;
14 }
15 public int row(){
16 return _row;
17 }
18 public int column(){
19 return _column;
20 }
21 public long id(){
22 long _id = _row;
23 return _id << 32 | _column;
24 }
25 public bool isValid(){
26 return _row == -1;
27 }
28 };
29
30 @SuppressWarnings public class QStandardModel{
31 private long _index(int row, int col, long parent){
32 return index(row, col, new ItemIndex(parent)).id();
33 }
34 private long _parent(long child){
35 return parent(new ItemIndex(child)).id();
36 }
37 private int _rowCount(long parent){
38 return rowCount(new ItemIndex(parent));
39 }
40 private int _columnCount(long parent){
41 return columnCount(new ItemIndex(parent));
42 }
43 private Object _data(long index, int role){
44 return data(new ItemIndex(index), (ItemDataRole)role);
45 }
46 private int _flags(long index){
47 return flags(new ItemIndex(index));
48 }
49 private Object _headerdata(int section, int orientation, int role){
50 return headerdata(section, (Orientation)orientation, (ItemDataRole)role);
51 }
52 public ItemIndex index(int row, int col, ItemIndex parent);
53 public ItemIndex parent(ItemIndex child);
54 public int rowCount(ItemIndex parent);
55 public int columnCount(ItemIndex parent);
56 public Object data(ItemIndex index, ItemDataRole role);
57 public Object headerdata(int section, Orientation orientation, int role);
58 public ItemFlag flags(ItemIndex index);
59
60
61 };
62};
ItemIndex(long id)
ItemIndex(int row, int col)
long _index(int row, int col, long parent)
Object _data(long index, int role)
int rowCount(ItemIndex parent)
int _rowCount(long parent)
int _flags(long index)
ItemIndex index(int row, int col, ItemIndex parent)
long _parent(long child)
ItemIndex parent(ItemIndex child)
int columnCount(ItemIndex parent)
Object data(ItemIndex index, ItemDataRole role)
int _columnCount(long parent)
Object _headerdata(int section, int orientation, int role)
Object headerdata(int section, Orientation orientation, int role)
ItemFlag flags(ItemIndex index)