Mercurial > projects > qtd
annotate d2/qt/core/QModelIndex.d @ 386:7dddafad5a20
shared stor fix
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Mon, 19 Jul 2010 13:29:57 +0300 |
parents | 96a75b1e5b26 |
children | d37abad3def9 |
rev | line source |
---|---|
188 | 1 module qt.core.QModelIndex; |
2 | |
3 public import qt.QGlobal; | |
254 | 4 private import qt.core.QObject; |
188 | 5 |
6 // automatic imports------------- | |
288 | 7 //private import qt.core.QVariant; |
295
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
8 private import qt.core.QAbstractItemModel; |
188 | 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 } | |
254 | 20 |
188 | 21 public final QModelIndex child(int row, int column) { |
22 return __qtd_QModelIndex_child_int_int(&this, row, column); | |
23 } | |
24 | |
190 | 25 public final int column() const { |
26 return __qtd_QModelIndex_column(cast(void*)&this); | |
188 | 27 } |
28 | |
29 public final QVariant data(int role = 0) { | |
30 void* __qt_return_value = __qtd_QModelIndex_data_int(&this, role); | |
254 | 31 return new QVariant(__qt_return_value); |
188 | 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 | |
200 | 42 public final void* internalPointer() const { |
188 | 43 //return __qtd_QModelIndex_internalPointer(&this); |
200 | 44 return cast(void*)p; |
188 | 45 } |
46 | |
47 public final Object object() { | |
48 return cast(Object) p; | |
49 } | |
50 | |
190 | 51 public final bool isValid() const { |
52 return __qtd_QModelIndex_isValid(cast(void*)&this); | |
188 | 53 } |
295
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
54 |
188 | 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; | |
254 | 60 void* d_obj = qtd_get_d_qobject(__qt_return_value); |
188 | 61 return cast(QAbstractItemModel) d_obj; |
62 } | |
295
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
63 |
188 | 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 | |
190 | 76 public final int row() const { |
77 return __qtd_QModelIndex_row(cast(void*)&this); | |
188 | 78 } |
79 | |
80 public final QModelIndex sibling(int row, int column) { | |
81 return __qtd_QModelIndex_sibling_int_int(&this, row, column); | |
82 } | |
295
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
83 |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
84 public alias void __isNativeValueType; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
85 |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
86 struct QTypeInfo |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
87 { |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
88 enum bool isComplex = true; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
89 enum bool isStatic = false; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
90 enum bool isLarge = true; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
91 enum bool isPointer = false; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
92 enum bool isDummy = false; |
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
93 } |
188 | 94 |
95 private: | |
96 int r; | |
97 int c; | |
98 void *p; | |
99 void *m; | |
100 } | |
101 | |
102 | |
103 alias QModelIndex QModelIndexAccessor; | |
104 | |
105 | |
106 // C wrappers | |
107 private extern(C) void* __qtd_QModelIndex_QModelIndex_QModelIndex(QModelIndex other0); | |
108 private extern(C) QModelIndex __qtd_QModelIndex_child_int_int(void* __this_nativeId, | |
109 int row0, | |
110 int column1); | |
111 private extern(C) int __qtd_QModelIndex_column(void* __this_nativeId); | |
112 private extern(C) void* __qtd_QModelIndex_data_int(void* __this_nativeId, | |
113 int role0); | |
114 private extern(C) int __qtd_QModelIndex_flags(void* __this_nativeId); | |
115 private extern(C) long __qtd_QModelIndex_internalId(void* __this_nativeId); | |
116 private extern(C) void* __qtd_QModelIndex_internalPointer(void* __this_nativeId); | |
117 private extern(C) bool __qtd_QModelIndex_isValid(void* __this_nativeId); | |
118 private extern(C) void* __qtd_QModelIndex_model(void* __this_nativeId); | |
119 private extern(C) bool __qtd_QModelIndex_operator_less_QModelIndex(void* __this_nativeId, | |
120 QModelIndex other0); | |
121 private extern(C) bool __qtd_QModelIndex_operator_equal_QModelIndex(void* __this_nativeId, | |
122 QModelIndex other0); | |
123 private extern(C) QModelIndex __qtd_QModelIndex_parent(void* __this_nativeId); | |
124 private extern(C) int __qtd_QModelIndex_row(void* __this_nativeId); | |
125 private extern(C) QModelIndex __qtd_QModelIndex_sibling_int_int(void* __this_nativeId, | |
126 int row0, | |
127 int column1); | |
295
463563fc9e17
more of QList. const functions in C++ are now const in D too. Drop of the store result feature, which was incompatible with const functions and introduced too much of the bloat in the generator.
eldar
parents:
288
diff
changeset
|
128 |