Mercurial > projects > qtd
comparison qt/d2/qt/core/QModelIndex.d @ 188:7dd099050621
initial commit for D2 support
author | eldar |
---|---|
date | Sun, 12 Jul 2009 18:58:03 +0000 |
parents | |
children | a1b48a630f73 |
comparison
equal
deleted
inserted
replaced
187:34fe79a9915b | 188:7dd099050621 |
---|---|
1 module qt.core.QModelIndex; | |
2 | |
3 public import qt.QGlobal; | |
4 private import qt.QtDObject; | |
5 | |
6 // automatic imports------------- | |
7 private import qt.core.QVariant; | |
8 private import qt.core.QAbstractItemModel; | |
9 public import qt.core.Qt; | |
10 | |
11 | |
12 public struct QModelIndex | |
13 { | |
14 public static QModelIndex opCall() { | |
15 QModelIndex mi; | |
16 mi.r = mi.c = -1; | |
17 mi.p = mi.m = null; | |
18 return mi; | |
19 } | |
20 | |
21 public final QModelIndex child(int row, int column) { | |
22 return __qtd_QModelIndex_child_int_int(&this, row, column); | |
23 } | |
24 | |
25 public final int column() { | |
26 return __qtd_QModelIndex_column(&this); | |
27 } | |
28 | |
29 public final QVariant data(int role = 0) { | |
30 void* __qt_return_value = __qtd_QModelIndex_data_int(&this, role); | |
31 return new QVariant(__qt_return_value, false); | |
32 } | |
33 | |
34 public final int flags() { | |
35 return __qtd_QModelIndex_flags(&this); | |
36 } | |
37 | |
38 public final long internalId() { | |
39 return __qtd_QModelIndex_internalId(&this); | |
40 } | |
41 | |
42 public final void* internalPointer() { | |
43 //return __qtd_QModelIndex_internalPointer(&this); | |
44 return p; | |
45 } | |
46 | |
47 public final Object object() { | |
48 return cast(Object) p; | |
49 } | |
50 | |
51 public final bool isValid() { | |
52 return __qtd_QModelIndex_isValid(&this); | |
53 } | |
54 | |
55 public final QAbstractItemModel model() { | |
56 // void* __qt_return_value = __qtd_QModelIndex_model(&this); | |
57 void* __qt_return_value = m; | |
58 if (__qt_return_value is null) | |
59 return null; | |
60 void* d_obj = __QObject_entity(__qt_return_value); | |
61 return cast(QAbstractItemModel) d_obj; | |
62 } | |
63 | |
64 private final bool operator_less(QModelIndex other) { | |
65 return __qtd_QModelIndex_operator_less_QModelIndex(&this, other); | |
66 } | |
67 | |
68 private final bool operator_equal(QModelIndex other) { | |
69 return __qtd_QModelIndex_operator_equal_QModelIndex(&this, other); | |
70 } | |
71 | |
72 public final QModelIndex parent() { | |
73 return __qtd_QModelIndex_parent(&this); | |
74 } | |
75 | |
76 public final int row() { | |
77 return __qtd_QModelIndex_row(&this); | |
78 } | |
79 | |
80 public final QModelIndex sibling(int row, int column) { | |
81 return __qtd_QModelIndex_sibling_int_int(&this, row, column); | |
82 } | |
83 | |
84 private: | |
85 int r; | |
86 int c; | |
87 void *p; | |
88 void *m; | |
89 } | |
90 | |
91 | |
92 alias QModelIndex QModelIndexAccessor; | |
93 | |
94 | |
95 // C wrappers | |
96 private extern(C) void* __qtd_QModelIndex_QModelIndex_QModelIndex(QModelIndex other0); | |
97 private extern(C) QModelIndex __qtd_QModelIndex_child_int_int(void* __this_nativeId, | |
98 int row0, | |
99 int column1); | |
100 private extern(C) int __qtd_QModelIndex_column(void* __this_nativeId); | |
101 private extern(C) void* __qtd_QModelIndex_data_int(void* __this_nativeId, | |
102 int role0); | |
103 private extern(C) int __qtd_QModelIndex_flags(void* __this_nativeId); | |
104 private extern(C) long __qtd_QModelIndex_internalId(void* __this_nativeId); | |
105 private extern(C) void* __qtd_QModelIndex_internalPointer(void* __this_nativeId); | |
106 private extern(C) bool __qtd_QModelIndex_isValid(void* __this_nativeId); | |
107 private extern(C) void* __qtd_QModelIndex_model(void* __this_nativeId); | |
108 private extern(C) bool __qtd_QModelIndex_operator_less_QModelIndex(void* __this_nativeId, | |
109 QModelIndex other0); | |
110 private extern(C) bool __qtd_QModelIndex_operator_equal_QModelIndex(void* __this_nativeId, | |
111 QModelIndex other0); | |
112 private extern(C) QModelIndex __qtd_QModelIndex_parent(void* __this_nativeId); | |
113 private extern(C) int __qtd_QModelIndex_row(void* __this_nativeId); | |
114 private extern(C) QModelIndex __qtd_QModelIndex_sibling_int_int(void* __this_nativeId, | |
115 int row0, | |
116 int column1); | |
117 // Just the private functions for abstract functions implemeneted in superclasses | |
118 | |
119 | |
120 | |
121 // Virtual Dispatch functions |