Mercurial > projects > qtd
annotate d2/qt/core/QModelIndex.d @ 397:590dcfc85873
Quick const-correctness fix for QModelIndex.
This probably deserves a more in-depth look later.
author | David Nadlinger <code@klickverbot.at> |
---|---|
date | Mon, 03 Jan 2011 08:30:59 +0100 |
parents | d37abad3def9 |
children |
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 |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
21 public final QModelIndex child(int row, int column) const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
22 return __qtd_QModelIndex_child_int_int(cast(void*)&this, row, column); |
188 | 23 } |
24 | |
190 | 25 public final int column() const { |
26 return __qtd_QModelIndex_column(cast(void*)&this); | |
188 | 27 } |
28 | |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
29 public final QVariant data(int role = 0) const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
30 void* __qt_return_value = __qtd_QModelIndex_data_int(cast(void*)&this, role); |
254 | 31 return new QVariant(__qt_return_value); |
188 | 32 } |
33 | |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
34 public final int flags() const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
35 return __qtd_QModelIndex_flags(cast(void*)&this); |
188 | 36 } |
37 | |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
38 public final long internalId() const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
39 return __qtd_QModelIndex_internalId(cast(void*)&this); |
188 | 40 } |
41 | |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
42 public final const(void*) internalPointer() const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
43 return p; |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
44 } |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
45 |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
46 public final const(Object) object() const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
47 return cast(const(Object)) p; |
188 | 48 } |
49 | |
190 | 50 public final bool isValid() const { |
51 return __qtd_QModelIndex_isValid(cast(void*)&this); | |
188 | 52 } |
389
d37abad3def9
Added missing ?const? to qt.core.QModelIndex.object.
David Nadlinger <code@klickverbot.at>
parents:
344
diff
changeset
|
53 |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
54 public final const(QAbstractItemModel) model() const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
55 void* __qt_return_value = cast(void*)m; |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
56 if (m is null) |
188 | 57 return null; |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
58 void* d_obj = qtd_get_d_qobject(cast(void*)m); |
188 | 59 return cast(QAbstractItemModel) d_obj; |
60 } | |
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
|
61 |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
62 private final bool operator_less(QModelIndex other) const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
63 return __qtd_QModelIndex_operator_less_QModelIndex(cast(void*)&this, other); |
188 | 64 } |
65 | |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
66 private final bool operator_equal(QModelIndex other) const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
67 return __qtd_QModelIndex_operator_equal_QModelIndex(cast(void*)&this, other); |
188 | 68 } |
69 | |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
70 public final QModelIndex parent() const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
71 return __qtd_QModelIndex_parent(cast(void*)&this); |
188 | 72 } |
73 | |
190 | 74 public final int row() const { |
75 return __qtd_QModelIndex_row(cast(void*)&this); | |
188 | 76 } |
77 | |
397
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
78 public final QModelIndex sibling(int row, int column) const { |
590dcfc85873
Quick const-correctness fix for QModelIndex.
David Nadlinger <code@klickverbot.at>
parents:
389
diff
changeset
|
79 return __qtd_QModelIndex_sibling_int_int(cast(void*)&this, row, column); |
188 | 80 } |
389
d37abad3def9
Added missing ?const? to qt.core.QModelIndex.object.
David Nadlinger <code@klickverbot.at>
parents:
344
diff
changeset
|
81 |
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
|
82 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
|
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 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
|
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 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
|
87 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
|
88 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
|
89 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
|
90 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
|
91 } |
188 | 92 |
93 private: | |
94 int r; | |
95 int c; | |
96 void *p; | |
97 void *m; | |
98 } | |
99 | |
100 | |
101 alias QModelIndex QModelIndexAccessor; | |
102 | |
103 | |
104 // C wrappers | |
105 private extern(C) void* __qtd_QModelIndex_QModelIndex_QModelIndex(QModelIndex other0); | |
106 private extern(C) QModelIndex __qtd_QModelIndex_child_int_int(void* __this_nativeId, | |
107 int row0, | |
108 int column1); | |
109 private extern(C) int __qtd_QModelIndex_column(void* __this_nativeId); | |
110 private extern(C) void* __qtd_QModelIndex_data_int(void* __this_nativeId, | |
111 int role0); | |
112 private extern(C) int __qtd_QModelIndex_flags(void* __this_nativeId); | |
113 private extern(C) long __qtd_QModelIndex_internalId(void* __this_nativeId); | |
114 private extern(C) void* __qtd_QModelIndex_internalPointer(void* __this_nativeId); | |
115 private extern(C) bool __qtd_QModelIndex_isValid(void* __this_nativeId); | |
116 private extern(C) void* __qtd_QModelIndex_model(void* __this_nativeId); | |
117 private extern(C) bool __qtd_QModelIndex_operator_less_QModelIndex(void* __this_nativeId, | |
118 QModelIndex other0); | |
119 private extern(C) bool __qtd_QModelIndex_operator_equal_QModelIndex(void* __this_nativeId, | |
120 QModelIndex other0); | |
121 private extern(C) QModelIndex __qtd_QModelIndex_parent(void* __this_nativeId); | |
122 private extern(C) int __qtd_QModelIndex_row(void* __this_nativeId); | |
123 private extern(C) QModelIndex __qtd_QModelIndex_sibling_int_int(void* __this_nativeId, | |
124 int row0, | |
125 int column1); |