annotate d2/qt/core/QVariant.d @ 361:beaf4a2974d7

Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
author Max Samukha <maxter@maxter.com>
date Wed, 09 Jun 2010 11:08:56 +0300
parents 96a75b1e5b26
children a032df77b6ab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
1 module qt.core.QVariant;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
2
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
3 public import qt.QGlobal;
344
96a75b1e5b26 project structure changes
Max Samukha <maxter@spambox.com>
parents: 298
diff changeset
4 private import qtd.QtdObject;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
5 private import qt.core.QMetaType;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
6
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
7 // automatic imports-------------
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
8 private import qt.core.QSizeF;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
9 private import qt.core.QPoint;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
10 private import qt.core.QRectF;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
11 public import qt.core.Qt;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
12 private import qt.core.QDateTime;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
13 private import qt.core.QDataStream;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
14 private import qt.core.QTime;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
15 private import qt.core.QUrl;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
16 private import qt.core.QRegExp;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
17 private import qt.core.QBitArray;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
18 private import qt.core.QLine;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
19 private import qt.core.QByteArray;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
20 private import qt.core.QSize;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
21 private import qt.core.QDate;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
22 private import qt.core.QPointF;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
23 private import qt.core.QLineF;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
24 private import qt.core.QRect;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
25 private import qt.core.QLocale;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
26
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
27 import std.string;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
28
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
29
254
maxter
parents: 252
diff changeset
30 public class QVariant : QtdObject
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
31 {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
32 enum Type {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
33 Invalid = 0,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
34
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
35 Bool = 1,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
36 Int = 2,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
37 UInt = 3,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
38 LongLong = 4,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
39 ULongLong = 5,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
40 Double = 6,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
41 Char = 7,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
42 Map = 8,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
43 List = 9,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
44 String = 10,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
45 StringList = 11,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
46 ByteArray = 12,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
47 BitArray = 13,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
48 Date = 14,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
49 Time = 15,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
50 DateTime = 16,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
51 Url = 17,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
52 Locale = 18,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
53 Rect = 19,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
54 RectF = 20,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
55 Size = 21,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
56 SizeF = 22,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
57 Line = 23,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
58 LineF = 24,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
59 Point = 25,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
60 PointF = 26,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
61 RegExp = 27,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
62 LastCoreType = RegExp,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
63
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
64 // value 62 is internally reserved
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
65
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
66 Font = 64,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
67 Pixmap = 65,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
68 Brush = 66,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
69 Color = 67,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
70 Palette = 68,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
71 Icon = 69,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
72 Image = 70,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
73 Polygon = 71,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
74 Region = 72,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
75 Bitmap = 73,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
76 Cursor = 74,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
77 SizePolicy = 75,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
78 KeySequence = 76,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
79 Pen = 77,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
80 TextLength = 78,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
81 TextFormat = 79,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
82 Matrix = 80,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
83 Transform = 81,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
84 LastGuiType = Transform,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
85
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
86 UserType = 127,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
87
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
88 LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
89 }
254
maxter
parents: 252
diff changeset
90
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
91 // Functions
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
92
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
93 private int getMetaId(T)(string name)
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
94 {
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
95 static shared int sharedId;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
96 static int id;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
97 if (id == 0)
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
98 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
99 synchronized(qtdMoLock)
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
100 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
101 if (sharedId == 0)
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
102 sharedId = qRegisterMetaType!T(name);
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
103 }
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
104 id = sharedId;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
105 }
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
106 return id;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
107 }
254
maxter
parents: 252
diff changeset
108
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
109 static public QVariant fromValue(T)(T obj)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
110 {
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
111 QVariant var;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
112 static if (is(T == class) || is(T == interface))
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
113 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
114 string name = obj.classinfo.name;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
115 // TODO: Still hacky. No need to pass name to id getter.
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
116 var = new QVariant(getMetaId!T(name), cast(void*)(obj));
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
117 }
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
118 else static if (isDynamicArrayType!(T) || isStaticArrayType!(T) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
119 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
120 string name = typeid(ElementTypeOfArray!(T)).toString ~ "[]";
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
121 auto darray = new DArrayToC;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
122 darray.array = obj.dup;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
123 var = new QVariant(getMetaId!T(name), cast(void*)(darray));
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
124 }
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
125 else
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
126 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
127 string name = typeid(T).toString;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
128 auto data = new T;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
129 *data = obj;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
130 var = new QVariant(getMetaId!T(name), cast(void*)(data));
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
131 }
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
132 return var;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
133 }
254
maxter
parents: 252
diff changeset
134
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
135 static public QVariant opCall(T)(T obj)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
136 {
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
137 return fromValue(obj);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
138 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
139
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
140 public this() {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
141 void* __qt_return_value = qtd_QVariant_QVariant();
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
142 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
143 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
144
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
145
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
146 public this(QDataStream s) {
254
maxter
parents: 252
diff changeset
147 void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
148 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
149 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
150
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
151
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
152 public this(Qt.GlobalColor color) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
153 void* __qt_return_value = qtd_QVariant_QVariant_GlobalColor(color);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
154 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
155 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
156
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
157
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
158 public this(bool b) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
159 void* __qt_return_value = qtd_QVariant_QVariant_bool(b);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
160 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
161 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
162
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
163
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
164 public this(QBitArray bitarray) {
254
maxter
parents: 252
diff changeset
165 void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
166 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
167 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
168
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
169
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
170 public this(QByteArray bytearray) {
254
maxter
parents: 252
diff changeset
171 void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
172 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
173 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
174
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
175
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
176 public this(QDate date) {
254
maxter
parents: 252
diff changeset
177 void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
178 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
179 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
180
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
181
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
182 public this(QDateTime datetime) {
254
maxter
parents: 252
diff changeset
183 void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
184 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
185 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
186
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
187
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
188 public this(string str) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
189 void* __qt_return_value = qtd_QVariant_QVariant_String(str);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
190 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
191 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
192
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
193
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
194 public this(QLine line) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
195 void* __qt_return_value = qtd_QVariant_QVariant_QLine(&line);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
196 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
197 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
198
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
199
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
200 public this(QLineF line) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
201 void* __qt_return_value = qtd_QVariant_QVariant_QLineF(&line);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
202 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
203 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
204
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
205
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
206 public this(QLocale locale) {
254
maxter
parents: 252
diff changeset
207 void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
208 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
209 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
210
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
211
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
212 public this(QPoint pt) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
213 void* __qt_return_value = qtd_QVariant_QVariant_QPoint(&pt);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
214 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
215 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
216
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
217
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
218 public this(QPointF pt) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
219 void* __qt_return_value = qtd_QVariant_QVariant_QPointF(&pt);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
220 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
221 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
222
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
223
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
224 public this(QRect rect) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
225 void* __qt_return_value = qtd_QVariant_QVariant_QRect(&rect);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
226 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
227 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
228
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
229
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
230 public this(QRectF rect) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
231 void* __qt_return_value = qtd_QVariant_QVariant_QRectF(&rect);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
232 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
233 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
234
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
235
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
236 public this(QRegExp regExp) {
254
maxter
parents: 252
diff changeset
237 void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
238 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
239 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
240
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
241
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
242 public this(QSize size) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
243 void* __qt_return_value = qtd_QVariant_QVariant_QSize(&size);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
244 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
245 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
246
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
247
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
248 public this(QSizeF size) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
249 void* __qt_return_value = qtd_QVariant_QVariant_QSizeF(&size);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
250 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
251 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
252
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
253
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
254 public this(QTime time) {
254
maxter
parents: 252
diff changeset
255 void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
256 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
257 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
258
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
259
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
260 public this(QUrl url) {
254
maxter
parents: 252
diff changeset
261 void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
262 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
263 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
264
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
265
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
266 public this(QVariant other) {
254
maxter
parents: 252
diff changeset
267 void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
268 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
269 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
270
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
271 /*
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
272 public this(char* str) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
273 void* __qt_return_value = qtd_QVariant_QVariant_nativepointerchar(str);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
274 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
275 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
276 */
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
277
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
278 public this(double d) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
279 void* __qt_return_value = qtd_QVariant_QVariant_double(d);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
280 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
281 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
282
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
283
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
284 public this(int i) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
285 void* __qt_return_value = qtd_QVariant_QVariant_int(i);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
286 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
287 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
288
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
289
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
290 public this(int typeOrUserType, void* copy) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
291 void* __qt_return_value = qtd_QVariant_QVariant_int_nativepointervoid(typeOrUserType, copy);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
292 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
293 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
294
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
295
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
296 public this(long ll) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
297 void* __qt_return_value = qtd_QVariant_QVariant_long(ll);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
298 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
299 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
300
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
301
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
302 public this(uint ui) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
303 void* __qt_return_value = qtd_QVariant_QVariant_uint(ui);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
304 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
305 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
306
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
307
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
308 public this(ulong ull) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
309 void* __qt_return_value = qtd_QVariant_QVariant_ulong(ull);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
310 super(__qt_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
311 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
312
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
313 // TODO: No need for run time name. Reimplement.
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
314 private final bool canConvertImpl(string name)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
315 {
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
316 int i = QMetaType.type(toStringz(name));
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
317 assert(i > 0);
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
318 return qtd_QVariant_canConvert(__nativeId, i);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
319 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
320
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
321 // TODO: reimplement
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
322 public final bool canConvert(Type)() {
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
323 static if ( is(Type == QBitArray) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
324 return canConvertImpl("QBitArray");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
325 else static if ( is(Type == bool) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
326 return canConvertImpl("bool");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
327 else static if ( is(Type == QByteArray) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
328 return canConvertImpl("QByteArray");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
329 else static if ( is(Type == QDate) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
330 return canConvertImpl("QDate");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
331 else static if ( is(Type == QDateTime) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
332 return canConvertImpl("QDateTime");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
333 else static if ( is(Type == double) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
334 return canConvertImpl("double");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
335 else static if ( is(Type == int) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
336 return canConvertImpl("int");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
337 else static if ( is(Type == QLine) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
338 return canConvertImpl("QLine");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
339 else static if ( is(Type == QLineF) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
340 return canConvertImpl("QLineF");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
341 else static if ( is(Type == QLocale) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
342 return canConvertImpl("QLocale");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
343 else static if ( is(Type == long) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
344 return canConvertImpl("long");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
345 else static if ( is(Type == QPoint) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
346 return canConvertImpl("QPoint");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
347 else static if ( is(Type == QPointF) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
348 return canConvertImpl("QPointF");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
349 else static if ( is(Type == QRect) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
350 return canConvertImpl("QRect");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
351 else static if ( is(Type == QRectF) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
352 return canConvertImpl("QRectF");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
353 else static if ( is(Type == QRegExp) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
354 return canConvertImpl("QRegExp");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
355 else static if ( is(Type == QSize) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
356 return canConvertImpl("QSize");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
357 else static if ( is(Type == QSizeF) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
358 return canConvertImpl("QSizeF");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
359 else static if ( is(Type == string) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
360 return canConvertImpl("QString");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
361 else static if ( is(Type == QTime) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
362 return canConvertImpl("QTime");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
363 else static if ( is(Type == uint) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
364 return canConvertImpl("unsigned int"); // TODO:
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
365 else static if ( is(Type == ulong) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
366 return canConvertImpl("unsigned long long"); // TODO:
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
367 else static if ( is(Type == QUrl) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
368 return canConvertImpl("QUrl");
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
369 else
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
370 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
371 static if( is( Type == class ) || is( Type == interface ) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
372 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
373 Object object = cast(Object)qtd_QVariant_data(__nativeId);
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
374 if(object)
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
375 return cast(Type)(object) !is null;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
376 return false;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
377 }
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
378 else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) )
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
379 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
380 auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId);
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
381 return cast(Type)(array.array) !is null;
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
382 }
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
383 else
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
384 {
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
385 int i = QMetaType.type(toStringz(typeid(Type).toString));
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
386 return qtd_QVariant_canConvert(__nativeId, i);
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
387 }
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
388 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
389 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
390
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
391 public final Type value(Type)() {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
392 static if ( is(Type == QBitArray) )
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
393 return toBitArray;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
394 else static if ( is(Type == bool) )
254
maxter
parents: 252
diff changeset
395 return toBool;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
396 else static if ( is(Type == QByteArray) )
254
maxter
parents: 252
diff changeset
397 return toByteArray;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
398 else static if ( is(Type == QDate) )
254
maxter
parents: 252
diff changeset
399 return toDate;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
400 else static if ( is(Type == QDateTime) )
254
maxter
parents: 252
diff changeset
401 return toDateTime;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
402 else static if ( is(Type == double) )
254
maxter
parents: 252
diff changeset
403 return toDouble;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
404 else static if ( is(Type == int) )
254
maxter
parents: 252
diff changeset
405 return toInt;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
406 else static if ( is(Type == QLine) )
254
maxter
parents: 252
diff changeset
407 return toLine;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
408 else static if ( is(Type == QLineF) )
254
maxter
parents: 252
diff changeset
409 return toLineF;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
410 else static if ( is(Type == QLocale) )
254
maxter
parents: 252
diff changeset
411 return toLocale;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
412 else static if ( is(Type == long) )
254
maxter
parents: 252
diff changeset
413 return toLongLong;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
414 else static if ( is(Type == QPoint) )
254
maxter
parents: 252
diff changeset
415 return toPoint;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
416 else static if ( is(Type == QPointF) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
417 return toPointF;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
418 else static if ( is(Type == QRect) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
419 return toRect;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
420 else static if ( is(Type == QRectF) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
421 return toRectF;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
422 else static if ( is(Type == QRegExp) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
423 return toRegExp;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
424 else static if ( is(Type == QSize) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
425 return toSize;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
426 else static if ( is(Type == QSizeF) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
427 return toSizeF;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
428 else static if ( is(Type == string) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
429 return toString;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
430 else static if ( is(Type == QTime) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
431 return toTime;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
432 else static if ( is(Type == uint) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
433 return toUInt;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
434 else static if ( is(Type == ulong) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
435 return toULongLong;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
436 else static if ( is(Type == QUrl) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
437 return toUrl;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
438 else static if( is( Type == class ) || is( Type == interface ) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
439 {
254
maxter
parents: 252
diff changeset
440 Object object = cast(Object)qtd_QVariant_data(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
441 if(object)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
442 return cast(Type)(object);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
443 return null;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
444 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
445 else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) )
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
446 {
254
maxter
parents: 252
diff changeset
447 auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
448 return cast(Type)(array.array);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
449 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
450 else
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
451 {
254
maxter
parents: 252
diff changeset
452 return *cast(Type*)qtd_QVariant_data(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
453 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
454 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
455
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
456 public final void clear() {
254
maxter
parents: 252
diff changeset
457 qtd_QVariant_clear(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
458 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
459
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
460 protected final bool cmp(QVariant other) {
254
maxter
parents: 252
diff changeset
461 return qtd_QVariant_cmp_QVariant(__nativeId, other is null ? null : other.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
462 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
463
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
464 protected final void create(int type, void* copy) {
254
maxter
parents: 252
diff changeset
465 qtd_QVariant_create_int_nativepointervoid(__nativeId, type, copy);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
466 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
467
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
468 public final bool isNull() {
254
maxter
parents: 252
diff changeset
469 return qtd_QVariant_isNull(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
470 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
471
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
472 public final bool isValid() {
254
maxter
parents: 252
diff changeset
473 return qtd_QVariant_isValid(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
474 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
475
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
476 public final void load(QDataStream ds) {
254
maxter
parents: 252
diff changeset
477 qtd_QVariant_load_QDataStream(__nativeId, ds is null ? null : ds.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
478 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
479
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
480 public final void writeTo(QDataStream s) {
254
maxter
parents: 252
diff changeset
481 qtd_QVariant_writeTo_QDataStream(__nativeId, s is null ? null : s.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
482 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
483
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
484 public final QVariant operator_assign(QVariant other) {
254
maxter
parents: 252
diff changeset
485 void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(__nativeId, other is null ? null : other.__nativeId);
maxter
parents: 252
diff changeset
486 return new QVariant(__qt_return_value, QtdObjectFlags.nativeOwnership);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
487 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
488
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
489 private final bool operator_equal(QVariant v) {
254
maxter
parents: 252
diff changeset
490 return qtd_QVariant_operator_equal_QVariant(__nativeId, v is null ? null : v.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
491 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
492
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
493 public final void readFrom(QDataStream s) {
254
maxter
parents: 252
diff changeset
494 qtd_QVariant_readFrom_QDataStream(__nativeId, s is null ? null : s.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
495 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
496
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
497 public final void save(QDataStream ds) {
254
maxter
parents: 252
diff changeset
498 qtd_QVariant_save_QDataStream(__nativeId, ds is null ? null : ds.__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
499 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
500
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
501 public final QBitArray toBitArray() {
254
maxter
parents: 252
diff changeset
502 void* __qt_return_value = qtd_QVariant_toBitArray(__nativeId);
maxter
parents: 252
diff changeset
503 return new QBitArray(__qt_return_value);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
504 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
505
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
506 public final bool toBool() {
254
maxter
parents: 252
diff changeset
507 return qtd_QVariant_toBool(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
508 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
509
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
510 public final QByteArray toByteArray() {
254
maxter
parents: 252
diff changeset
511 void* __qt_return_value = qtd_QVariant_toByteArray(__nativeId);
maxter
parents: 252
diff changeset
512 return new QByteArray(__qt_return_value);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
513 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
514
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
515 public final QDate toDate() {
254
maxter
parents: 252
diff changeset
516 void* __qt_return_value = qtd_QVariant_toDate(__nativeId);
maxter
parents: 252
diff changeset
517 return new QDate(__qt_return_value);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
518 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
519
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
520 public final QDateTime toDateTime() {
254
maxter
parents: 252
diff changeset
521 void* __qt_return_value = qtd_QVariant_toDateTime(__nativeId);
maxter
parents: 252
diff changeset
522 return new QDateTime(__qt_return_value);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
523 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
524
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
525 public final double toDouble(bool* ok = null) {
254
maxter
parents: 252
diff changeset
526 return qtd_QVariant_toDouble_nativepointerbool(__nativeId, ok);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
527 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
528
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
529 public final int toInt(bool* ok = null) {
254
maxter
parents: 252
diff changeset
530 return qtd_QVariant_toInt_nativepointerbool(__nativeId, ok);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
531 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
532
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
533 public final QLine toLine() {
254
maxter
parents: 252
diff changeset
534 return qtd_QVariant_toLine(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
535 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
536
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
537 public final QLineF toLineF() {
254
maxter
parents: 252
diff changeset
538 return qtd_QVariant_toLineF(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
539 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
540
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
541 public final QLocale toLocale() {
254
maxter
parents: 252
diff changeset
542 void* __qt_return_value = qtd_QVariant_toLocale(__nativeId);
maxter
parents: 252
diff changeset
543 return new QLocale(__qt_return_value);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
544 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
545
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
546 public final long toLongLong(bool* ok = null) {
254
maxter
parents: 252
diff changeset
547 return qtd_QVariant_toLongLong_nativepointerbool(__nativeId, ok);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
548 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
549
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
550 public final QPoint toPoint() {
254
maxter
parents: 252
diff changeset
551 return qtd_QVariant_toPoint(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
552 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
553
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
554 public final QPointF toPointF() {
254
maxter
parents: 252
diff changeset
555 return qtd_QVariant_toPointF(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
556 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
557
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
558 public final QRect toRect() {
254
maxter
parents: 252
diff changeset
559 return qtd_QVariant_toRect(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
560 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
561
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
562 public final QRectF toRectF() {
254
maxter
parents: 252
diff changeset
563 return qtd_QVariant_toRectF(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
564 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
565
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
566 public final QRegExp toRegExp() {
254
maxter
parents: 252
diff changeset
567 void* __qt_return_value = qtd_QVariant_toRegExp(__nativeId);
maxter
parents: 252
diff changeset
568 return new QRegExp(__qt_return_value);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
569 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
570
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
571 public final QSize toSize() {
254
maxter
parents: 252
diff changeset
572 return qtd_QVariant_toSize(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
573 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
574
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
575 public final QSizeF toSizeF() {
254
maxter
parents: 252
diff changeset
576 return qtd_QVariant_toSizeF(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
577 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
578
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
579 public final string toString() {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
580 string res;
254
maxter
parents: 252
diff changeset
581 qtd_QVariant_toString(__nativeId, &res);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
582 return res;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
583 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
584
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
585 public final QTime toTime() {
254
maxter
parents: 252
diff changeset
586 void* __qt_return_value = qtd_QVariant_toTime(__nativeId);
maxter
parents: 252
diff changeset
587 return new QTime(__qt_return_value);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
588 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
589
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
590 public final uint toUInt(bool* ok = null) {
254
maxter
parents: 252
diff changeset
591 return qtd_QVariant_toUInt_nativepointerbool(__nativeId, ok);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
592 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
593
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
594 public final ulong toULongLong(bool* ok = null) {
254
maxter
parents: 252
diff changeset
595 return qtd_QVariant_toULongLong_nativepointerbool(__nativeId, ok);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
596 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
597
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
598 public final QUrl toUrl() {
254
maxter
parents: 252
diff changeset
599 void* __qt_return_value = qtd_QVariant_toUrl(__nativeId);
maxter
parents: 252
diff changeset
600 return new QUrl(__qt_return_value);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
601 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
602
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
603 public final char* typeName() {
254
maxter
parents: 252
diff changeset
604 return qtd_QVariant_typeName(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
605 }
254
maxter
parents: 252
diff changeset
606
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
607 public final Type type() {
254
maxter
parents: 252
diff changeset
608 return cast(Type)qtd_QVariant_type(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
609 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
610
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
611 public final int userType() {
254
maxter
parents: 252
diff changeset
612 return qtd_QVariant_userType(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
613 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
614 // Field accessors
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
615
254
maxter
parents: 252
diff changeset
616 public this(void* native_id, QtdObjectFlags flags = QtdObjectFlags.none) {
maxter
parents: 252
diff changeset
617 super(native_id, flags);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
618 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
619
254
maxter
parents: 252
diff changeset
620 protected override void __deleteNative() {
maxter
parents: 252
diff changeset
621 qtd_QVariant_destructor(__nativeId);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
622 }
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
623
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: 254
diff changeset
624 public alias void __isValueType;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
625
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: 254
diff changeset
626 public alias void __isQtType_QVariant;
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
627
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: 254
diff changeset
628 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: 254
diff changeset
629 {
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: 254
diff changeset
630 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: 254
diff changeset
631 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: 254
diff changeset
632 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: 254
diff changeset
633 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: 254
diff changeset
634 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: 254
diff changeset
635 }
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
636
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: 254
diff changeset
637 static void* __constructNativeCopy(const void* orig) {
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: 254
diff changeset
638 return qtd_QVariant_QVariant_QVariant(cast(void*)orig);
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: 254
diff changeset
639 }
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: 254
diff changeset
640
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: 254
diff changeset
641 static void* __constructPlacedNativeCopy(const void* orig, void* place) {
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: 254
diff changeset
642 return qtd_QVariant_placed_copy(orig, place);
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: 254
diff changeset
643 }
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
644
298
adae77fdc1ea Native QList implementation is now used throughout QtD
eldar
parents: 295
diff changeset
645 public static void __deleteNativeObject(void* ptr) {
adae77fdc1ea Native QList implementation is now used throughout QtD
eldar
parents: 295
diff changeset
646 qtd_QVariant_destructor(ptr);
adae77fdc1ea Native QList implementation is now used throughout QtD
eldar
parents: 295
diff changeset
647 }
361
beaf4a2974d7 Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
Max Samukha <maxter@maxter.com>
parents: 344
diff changeset
648
298
adae77fdc1ea Native QList implementation is now used throughout QtD
eldar
parents: 295
diff changeset
649 public static void __callNativeDestructor(void* ptr) {
adae77fdc1ea Native QList implementation is now used throughout QtD
eldar
parents: 295
diff changeset
650 qtd_QVariant_call_destructor(ptr);
adae77fdc1ea Native QList implementation is now used throughout QtD
eldar
parents: 295
diff changeset
651 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
652 // Injected code in class
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
653 }
298
adae77fdc1ea Native QList implementation is now used throughout QtD
eldar
parents: 295
diff changeset
654
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
655 extern (C) void qtd_QVariant_destructor(void *ptr);
298
adae77fdc1ea Native QList implementation is now used throughout QtD
eldar
parents: 295
diff changeset
656 extern (C) void qtd_QVariant_call_destructor(void *ptr);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
657
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: 254
diff changeset
658 private extern(C) void* qtd_QVariant_placed_copy(const void* orig, void* place);
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: 254
diff changeset
659
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
660
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
661 // C wrappers
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
662 private extern(C) void* qtd_QVariant_QVariant();
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
663 private extern(C) void* qtd_QVariant_QVariant_QDataStream(void* s0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
664 private extern(C) void* qtd_QVariant_QVariant_GlobalColor(int color0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
665 private extern(C) void* qtd_QVariant_QVariant_bool(bool b0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
666 private extern(C) void* qtd_QVariant_QVariant_QBitArray(void* bitarray0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
667 private extern(C) void* qtd_QVariant_QVariant_QByteArray(void* bytearray0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
668 private extern(C) void* qtd_QVariant_QVariant_QDate(void* date0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
669 private extern(C) void* qtd_QVariant_QVariant_QDateTime(void* datetime0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
670 private extern(C) void* qtd_QVariant_QVariant_String(string string0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
671 private extern(C) void* qtd_QVariant_QVariant_QLine(void* line0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
672 private extern(C) void* qtd_QVariant_QVariant_QLineF(void* line0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
673 private extern(C) void* qtd_QVariant_QVariant_QLocale(void* locale0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
674 private extern(C) void* qtd_QVariant_QVariant_QPoint(void* pt0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
675 private extern(C) void* qtd_QVariant_QVariant_QPointF(void* pt0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
676 private extern(C) void* qtd_QVariant_QVariant_QRect(void* rect0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
677 private extern(C) void* qtd_QVariant_QVariant_QRectF(void* rect0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
678 private extern(C) void* qtd_QVariant_QVariant_QRegExp(void* regExp0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
679 private extern(C) void* qtd_QVariant_QVariant_QSize(void* size0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
680 private extern(C) void* qtd_QVariant_QVariant_QSizeF(void* size0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
681 private extern(C) void* qtd_QVariant_QVariant_QTime(void* time0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
682 private extern(C) void* qtd_QVariant_QVariant_QUrl(void* url0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
683 private extern(C) void* qtd_QVariant_QVariant_QVariant(void* other0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
684 private extern(C) void* qtd_QVariant_QVariant_nativepointerchar(char* str0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
685 private extern(C) void* qtd_QVariant_QVariant_double(double d0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
686 private extern(C) void* qtd_QVariant_QVariant_int(int i0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
687 private extern(C) void* qtd_QVariant_QVariant_int_nativepointervoid(int typeOrUserType0,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
688 void* copy1);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
689 private extern(C) void* qtd_QVariant_QVariant_long(long ll0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
690 private extern(C) void* qtd_QVariant_QVariant_uint(uint ui0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
691 private extern(C) void* qtd_QVariant_QVariant_ulong(ulong ull0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
692 private extern(C) bool qtd_QVariant_canConvert(void* __this_nativeId, int);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
693 private extern(C) void qtd_QVariant_clear(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
694 private extern(C) bool qtd_QVariant_cmp_QVariant(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
695 void* other0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
696 private extern(C) void qtd_QVariant_create_int_nativepointervoid(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
697 int type0,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
698 void* copy1);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
699 private extern(C) bool qtd_QVariant_isNull(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
700 private extern(C) bool qtd_QVariant_isValid(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
701 private extern(C) void qtd_QVariant_load_QDataStream(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
702 void* ds0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
703 private extern(C) void qtd_QVariant_writeTo_QDataStream(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
704 void* s0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
705 private extern(C) void* qtd_QVariant_operator_assign_QVariant(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
706 void* other0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
707 private extern(C) bool qtd_QVariant_operator_equal_QVariant(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
708 void* v0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
709 private extern(C) void qtd_QVariant_readFrom_QDataStream(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
710 void* s0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
711 private extern(C) void qtd_QVariant_save_QDataStream(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
712 void* ds0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
713 private extern(C) void* qtd_QVariant_toBitArray(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
714 private extern(C) bool qtd_QVariant_toBool(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
715 private extern(C) void* qtd_QVariant_toByteArray(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
716 private extern(C) void* qtd_QVariant_toDate(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
717 private extern(C) void* qtd_QVariant_toDateTime(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
718 private extern(C) double qtd_QVariant_toDouble_nativepointerbool(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
719 bool* ok0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
720 private extern(C) int qtd_QVariant_toInt_nativepointerbool(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
721 bool* ok0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
722 private extern(C) QLine qtd_QVariant_toLine(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
723 private extern(C) QLineF qtd_QVariant_toLineF(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
724 private extern(C) void* qtd_QVariant_toLocale(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
725 private extern(C) long qtd_QVariant_toLongLong_nativepointerbool(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
726 bool* ok0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
727 private extern(C) QPoint qtd_QVariant_toPoint(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
728 private extern(C) QPointF qtd_QVariant_toPointF(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
729 private extern(C) QRect qtd_QVariant_toRect(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
730 private extern(C) QRectF qtd_QVariant_toRectF(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
731 private extern(C) void* qtd_QVariant_toRegExp(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
732 private extern(C) QSize qtd_QVariant_toSize(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
733 private extern(C) QSizeF qtd_QVariant_toSizeF(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
734 private extern(C) void qtd_QVariant_toString(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
735 void* __java_return_value);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
736 private extern(C) void* qtd_QVariant_toTime(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
737 private extern(C) uint qtd_QVariant_toUInt_nativepointerbool(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
738 bool* ok0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
739 private extern(C) ulong qtd_QVariant_toULongLong_nativepointerbool(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
740 bool* ok0);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
741 private extern(C) void* qtd_QVariant_toUrl(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
742 private extern(C) char* qtd_QVariant_typeName(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
743 private extern(C) int qtd_QVariant_type(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
744 private extern(C) int qtd_QVariant_userType(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
745 private extern(C) void *qtd_QVariant_data(void* __this_nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
746
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
747 // Just the private functions for abstract functions implemeneted in superclasses
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
748
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
749 // Virtual Dispatch functions