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
eldar@188 1 module qt.core.QModelIndex;
eldar@188 2
eldar@188 3 public import qt.QGlobal;
maxter@254 4 private import qt.core.QObject;
eldar@188 5
eldar@188 6 // automatic imports-------------
eldar@288 7 //private import qt.core.QVariant;
eldar@295 8 private import qt.core.QAbstractItemModel;
eldar@188 9 public import qt.core.Qt;
eldar@188 10
eldar@188 11
eldar@188 12 public struct QModelIndex
eldar@188 13 {
eldar@188 14 public static QModelIndex opCall() {
eldar@188 15 QModelIndex mi;
eldar@188 16 mi.r = mi.c = -1;
eldar@188 17 mi.p = mi.m = null;
eldar@188 18 return mi;
eldar@188 19 }
maxter@254 20
code@397 21 public final QModelIndex child(int row, int column) const {
code@397 22 return __qtd_QModelIndex_child_int_int(cast(void*)&this, row, column);
eldar@188 23 }
eldar@188 24
eldar@190 25 public final int column() const {
eldar@190 26 return __qtd_QModelIndex_column(cast(void*)&this);
eldar@188 27 }
eldar@188 28
code@397 29 public final QVariant data(int role = 0) const {
code@397 30 void* __qt_return_value = __qtd_QModelIndex_data_int(cast(void*)&this, role);
maxter@254 31 return new QVariant(__qt_return_value);
eldar@188 32 }
eldar@188 33
code@397 34 public final int flags() const {
code@397 35 return __qtd_QModelIndex_flags(cast(void*)&this);
eldar@188 36 }
eldar@188 37
code@397 38 public final long internalId() const {
code@397 39 return __qtd_QModelIndex_internalId(cast(void*)&this);
eldar@188 40 }
eldar@188 41
code@397 42 public final const(void*) internalPointer() const {
code@397 43 return p;
eldar@188 44 }
eldar@188 45
code@397 46 public final const(Object) object() const {
code@397 47 return cast(const(Object)) p;
eldar@188 48 }
eldar@188 49
eldar@190 50 public final bool isValid() const {
eldar@190 51 return __qtd_QModelIndex_isValid(cast(void*)&this);
eldar@188 52 }
code@389 53
code@397 54 public final const(QAbstractItemModel) model() const {
code@397 55 void* __qt_return_value = cast(void*)m;
code@397 56 if (m is null)
eldar@188 57 return null;
code@397 58 void* d_obj = qtd_get_d_qobject(cast(void*)m);
eldar@188 59 return cast(QAbstractItemModel) d_obj;
eldar@188 60 }
eldar@295 61
code@397 62 private final bool operator_less(QModelIndex other) const {
code@397 63 return __qtd_QModelIndex_operator_less_QModelIndex(cast(void*)&this, other);
eldar@188 64 }
eldar@188 65
code@397 66 private final bool operator_equal(QModelIndex other) const {
code@397 67 return __qtd_QModelIndex_operator_equal_QModelIndex(cast(void*)&this, other);
eldar@188 68 }
eldar@188 69
code@397 70 public final QModelIndex parent() const {
code@397 71 return __qtd_QModelIndex_parent(cast(void*)&this);
eldar@188 72 }
eldar@188 73
eldar@190 74 public final int row() const {
eldar@190 75 return __qtd_QModelIndex_row(cast(void*)&this);
eldar@188 76 }
eldar@188 77
code@397 78 public final QModelIndex sibling(int row, int column) const {
code@397 79 return __qtd_QModelIndex_sibling_int_int(cast(void*)&this, row, column);
eldar@188 80 }
code@389 81
eldar@295 82 public alias void __isNativeValueType;
eldar@295 83
eldar@295 84 struct QTypeInfo
eldar@295 85 {
eldar@295 86 enum bool isComplex = true;
eldar@295 87 enum bool isStatic = false;
eldar@295 88 enum bool isLarge = true;
eldar@295 89 enum bool isPointer = false;
eldar@295 90 enum bool isDummy = false;
eldar@295 91 }
eldar@188 92
eldar@188 93 private:
eldar@188 94 int r;
eldar@188 95 int c;
eldar@188 96 void *p;
eldar@188 97 void *m;
eldar@188 98 }
eldar@188 99
eldar@188 100
eldar@188 101 alias QModelIndex QModelIndexAccessor;
eldar@188 102
eldar@188 103
eldar@188 104 // C wrappers
eldar@188 105 private extern(C) void* __qtd_QModelIndex_QModelIndex_QModelIndex(QModelIndex other0);
eldar@188 106 private extern(C) QModelIndex __qtd_QModelIndex_child_int_int(void* __this_nativeId,
eldar@188 107 int row0,
eldar@188 108 int column1);
eldar@188 109 private extern(C) int __qtd_QModelIndex_column(void* __this_nativeId);
eldar@188 110 private extern(C) void* __qtd_QModelIndex_data_int(void* __this_nativeId,
eldar@188 111 int role0);
eldar@188 112 private extern(C) int __qtd_QModelIndex_flags(void* __this_nativeId);
eldar@188 113 private extern(C) long __qtd_QModelIndex_internalId(void* __this_nativeId);
eldar@188 114 private extern(C) void* __qtd_QModelIndex_internalPointer(void* __this_nativeId);
eldar@188 115 private extern(C) bool __qtd_QModelIndex_isValid(void* __this_nativeId);
eldar@188 116 private extern(C) void* __qtd_QModelIndex_model(void* __this_nativeId);
eldar@188 117 private extern(C) bool __qtd_QModelIndex_operator_less_QModelIndex(void* __this_nativeId,
eldar@188 118 QModelIndex other0);
eldar@188 119 private extern(C) bool __qtd_QModelIndex_operator_equal_QModelIndex(void* __this_nativeId,
eldar@188 120 QModelIndex other0);
eldar@188 121 private extern(C) QModelIndex __qtd_QModelIndex_parent(void* __this_nativeId);
eldar@188 122 private extern(C) int __qtd_QModelIndex_row(void* __this_nativeId);
eldar@188 123 private extern(C) QModelIndex __qtd_QModelIndex_sibling_int_int(void* __this_nativeId,
eldar@188 124 int row0,
eldar@188 125 int column1);