comparison qt/d2/qt/core/QVariant.d @ 248:7664de4a55e5

Fixed #23. QtD_QObjectEntity is not created dynamically for shell classes any more. Class initialization is now performed by static constructors. When wrapping QObjects returned from functions, their run-time types are now taken into account. QObjects are allocated on GC heap, a doubly-linked list is used to prevent them from been collected (arguably a better solution than allocating on C heap and adding GC ranges) Minor changes (including unnecessary).
author maxter
date Thu, 20 Aug 2009 14:47:17 +0000
parents 7dd099050621
children 37eed70de029
comparison
equal deleted inserted replaced
247:27497bbe62a1 248:7664de4a55e5
1 module qt.core.QVariant; 1 module qt.core.QVariant;
2 2
3 public import qt.QGlobal; 3 public import qt.QGlobal;
4 private import qt.QtDObject; 4 private import qt.QtdObject;
5 private import qt.core.QMetaType; 5 private import qt.core.QMetaType;
6 6
7 // automatic imports------------- 7 // automatic imports-------------
8 private import qt.core.QSizeF; 8 private import qt.core.QSizeF;
9 private import qt.core.QPoint; 9 private import qt.core.QPoint;
25 private import qt.core.QLocale; 25 private import qt.core.QLocale;
26 26
27 import std.string; 27 import std.string;
28 28
29 29
30 public class QVariant : QtDObject 30 public class QVariant : QtdObject
31 { 31 {
32 enum Type { 32 enum Type {
33 Invalid = 0, 33 Invalid = 0,
34 34
35 Bool = 1, 35 Bool = 1,
85 85
86 UserType = 127, 86 UserType = 127,
87 87
88 LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type 88 LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
89 } 89 }
90 90
91 // Functions 91 // Functions
92 92
93 private template getMetaId() 93 private template getMetaId()
94 { 94 {
95 const char[] getMetaId = " 95 const char[] getMetaId = "
96 int i = qtd_MetatypeId(toStringz(name)); 96 int i = qtd_MetatypeId(toStringz(name));
97 if(i <= 0) 97 if(i <= 0)
98 i = qRegisterMetaType!(T)(name);"; 98 i = qRegisterMetaType!(T)(name);";
99 } 99 }
100 100
101 static public QVariant fromValue(T)(T obj) 101 static public QVariant fromValue(T)(T obj)
102 { 102 {
103 QVariant var; 103 QVariant var;
104 static if (is(T == class) || is(T == interface)) 104 static if (is(T == class) || is(T == interface))
105 { 105 {
123 *data = obj; 123 *data = obj;
124 var = new QVariant(i, cast(void*)(data)); 124 var = new QVariant(i, cast(void*)(data));
125 } 125 }
126 return var; 126 return var;
127 } 127 }
128 128
129 static public QVariant opCall(T)(T obj) 129 static public QVariant opCall(T)(T obj)
130 { 130 {
131 return fromValue(obj); 131 return fromValue(obj);
132 } 132 }
133 133
136 super(__qt_return_value); 136 super(__qt_return_value);
137 } 137 }
138 138
139 139
140 public this(QDataStream s) { 140 public this(QDataStream s) {
141 void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.nativeId); 141 void* __qt_return_value = qtd_QVariant_QVariant_QDataStream(s is null ? null : s.__nativeId);
142 super(__qt_return_value); 142 super(__qt_return_value);
143 } 143 }
144 144
145 145
146 public this(Qt.GlobalColor color) { 146 public this(Qt.GlobalColor color) {
154 super(__qt_return_value); 154 super(__qt_return_value);
155 } 155 }
156 156
157 157
158 public this(QBitArray bitarray) { 158 public this(QBitArray bitarray) {
159 void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.nativeId); 159 void* __qt_return_value = qtd_QVariant_QVariant_QBitArray(bitarray is null ? null : bitarray.__nativeId);
160 super(__qt_return_value); 160 super(__qt_return_value);
161 } 161 }
162 162
163 163
164 public this(QByteArray bytearray) { 164 public this(QByteArray bytearray) {
165 void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.nativeId); 165 void* __qt_return_value = qtd_QVariant_QVariant_QByteArray(bytearray is null ? null : bytearray.__nativeId);
166 super(__qt_return_value); 166 super(__qt_return_value);
167 } 167 }
168 168
169 169
170 public this(QDate date) { 170 public this(QDate date) {
171 void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.nativeId); 171 void* __qt_return_value = qtd_QVariant_QVariant_QDate(date is null ? null : date.__nativeId);
172 super(__qt_return_value); 172 super(__qt_return_value);
173 } 173 }
174 174
175 175
176 public this(QDateTime datetime) { 176 public this(QDateTime datetime) {
177 void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.nativeId); 177 void* __qt_return_value = qtd_QVariant_QVariant_QDateTime(datetime is null ? null : datetime.__nativeId);
178 super(__qt_return_value); 178 super(__qt_return_value);
179 } 179 }
180 180
181 181
182 public this(string str) { 182 public this(string str) {
196 super(__qt_return_value); 196 super(__qt_return_value);
197 } 197 }
198 198
199 199
200 public this(QLocale locale) { 200 public this(QLocale locale) {
201 void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.nativeId); 201 void* __qt_return_value = qtd_QVariant_QVariant_QLocale(locale is null ? null : locale.__nativeId);
202 super(__qt_return_value); 202 super(__qt_return_value);
203 } 203 }
204 204
205 205
206 public this(QPoint pt) { 206 public this(QPoint pt) {
226 super(__qt_return_value); 226 super(__qt_return_value);
227 } 227 }
228 228
229 229
230 public this(QRegExp regExp) { 230 public this(QRegExp regExp) {
231 void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.nativeId); 231 void* __qt_return_value = qtd_QVariant_QVariant_QRegExp(regExp is null ? null : regExp.__nativeId);
232 super(__qt_return_value); 232 super(__qt_return_value);
233 } 233 }
234 234
235 235
236 public this(QSize size) { 236 public this(QSize size) {
244 super(__qt_return_value); 244 super(__qt_return_value);
245 } 245 }
246 246
247 247
248 public this(QTime time) { 248 public this(QTime time) {
249 void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.nativeId); 249 void* __qt_return_value = qtd_QVariant_QVariant_QTime(time is null ? null : time.__nativeId);
250 super(__qt_return_value); 250 super(__qt_return_value);
251 } 251 }
252 252
253 253
254 public this(QUrl url) { 254 public this(QUrl url) {
255 void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.nativeId); 255 void* __qt_return_value = qtd_QVariant_QVariant_QUrl(url is null ? null : url.__nativeId);
256 super(__qt_return_value); 256 super(__qt_return_value);
257 } 257 }
258 258
259 259
260 public this(QVariant other) { 260 public this(QVariant other) {
261 void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.nativeId); 261 void* __qt_return_value = qtd_QVariant_QVariant_QVariant(other is null ? null : other.__nativeId);
262 super(__qt_return_value); 262 super(__qt_return_value);
263 } 263 }
264 264
265 /* 265 /*
266 public this(char* str) { 266 public this(char* str) {
306 306
307 private final bool canConvertImpl(string name) 307 private final bool canConvertImpl(string name)
308 { 308 {
309 int i = qtd_MetatypeId(toStringz(name)); 309 int i = qtd_MetatypeId(toStringz(name));
310 assert(i > 0); 310 assert(i > 0);
311 return qtd_QVariant_canConvert(nativeId, i); 311 return qtd_QVariant_canConvert(__nativeId, i);
312 } 312 }
313 313
314 public final bool canConvert(Type)() { 314 public final bool canConvert(Type)() {
315 static if ( is(Type == QBitArray) ) 315 static if ( is(Type == QBitArray) )
316 return canConvertImpl("QBitArray"); 316 return canConvertImpl("QBitArray");
351 else static if ( is(Type == string) ) 351 else static if ( is(Type == string) )
352 return canConvertImpl("QString"); 352 return canConvertImpl("QString");
353 else static if ( is(Type == QTime) ) 353 else static if ( is(Type == QTime) )
354 return canConvertImpl("QTime"); 354 return canConvertImpl("QTime");
355 else static if ( is(Type == uint) ) 355 else static if ( is(Type == uint) )
356 return canConvertImpl("unsigned int"); // TODO: 356 return canConvertImpl("unsigned int"); // TODO:
357 else static if ( is(Type == ulong) ) 357 else static if ( is(Type == ulong) )
358 return canConvertImpl("unsigned long long"); // TODO: 358 return canConvertImpl("unsigned long long"); // TODO:
359 else static if ( is(Type == QUrl) ) 359 else static if ( is(Type == QUrl) )
360 return canConvertImpl("QUrl"); 360 return canConvertImpl("QUrl");
361 else 361 else
362 { 362 {
363 static if( is( Type == class ) || is( Type == interface ) ) 363 static if( is( Type == class ) || is( Type == interface ) )
364 { 364 {
365 Object object = cast(Object)qtd_QVariant_data(nativeId); 365 Object object = cast(Object)qtd_QVariant_data(__nativeId);
366 if(object) 366 if(object)
367 return cast(Type)(object) !is null; 367 return cast(Type)(object) !is null;
368 return false; 368 return false;
369 } 369 }
370 else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) ) 370 else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) )
371 { 371 {
372 auto array = cast(DArrayToC*)qtd_QVariant_data(nativeId); 372 auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId);
373 return cast(Type)(array.array) !is null; 373 return cast(Type)(array.array) !is null;
374 } 374 }
375 else 375 else
376 { 376 {
377 int i = qtd_MetatypeId(toStringz(typeid(Type).toString)); 377 int i = qtd_MetatypeId(toStringz(typeid(Type).toString));
378 return qtd_QVariant_canConvert(nativeId, i); 378 return qtd_QVariant_canConvert(__nativeId, i);
379 } 379 }
380 } 380 }
381 } 381 }
382 382
383 public final Type value(Type)() { 383 public final Type value(Type)() {
384 static if ( is(Type == QBitArray) ) 384 static if ( is(Type == QBitArray) )
385 return toBitArra; 385 return toBitArra;
386 else static if ( is(Type == bool) ) 386 else static if ( is(Type == bool) )
387 return toBool; 387 return toBool;
388 else static if ( is(Type == QByteArray) ) 388 else static if ( is(Type == QByteArray) )
389 return toByteArray; 389 return toByteArray;
390 else static if ( is(Type == QDate) ) 390 else static if ( is(Type == QDate) )
391 return toDate; 391 return toDate;
392 else static if ( is(Type == QDateTime) ) 392 else static if ( is(Type == QDateTime) )
393 return toDateTime; 393 return toDateTime;
394 else static if ( is(Type == double) ) 394 else static if ( is(Type == double) )
395 return toDouble; 395 return toDouble;
396 else static if ( is(Type == int) ) 396 else static if ( is(Type == int) )
397 return toInt; 397 return toInt;
398 else static if ( is(Type == QLine) ) 398 else static if ( is(Type == QLine) )
399 return toLine; 399 return toLine;
400 else static if ( is(Type == QLineF) ) 400 else static if ( is(Type == QLineF) )
401 return toLineF; 401 return toLineF;
402 else static if ( is(Type == QLocale) ) 402 else static if ( is(Type == QLocale) )
403 return toLocale; 403 return toLocale;
404 else static if ( is(Type == long) ) 404 else static if ( is(Type == long) )
405 return toLongLong; 405 return toLongLong;
406 else static if ( is(Type == QPoint) ) 406 else static if ( is(Type == QPoint) )
407 return toPoint; 407 return toPoint;
408 else static if ( is(Type == QPointF) ) 408 else static if ( is(Type == QPointF) )
409 return toPointF; 409 return toPointF;
410 else static if ( is(Type == QRect) ) 410 else static if ( is(Type == QRect) )
411 return toRect; 411 return toRect;
412 else static if ( is(Type == QRectF) ) 412 else static if ( is(Type == QRectF) )
427 return toULongLong; 427 return toULongLong;
428 else static if ( is(Type == QUrl) ) 428 else static if ( is(Type == QUrl) )
429 return toUrl; 429 return toUrl;
430 else static if( is( Type == class ) || is( Type == interface ) ) 430 else static if( is( Type == class ) || is( Type == interface ) )
431 { 431 {
432 Object object = cast(Object)qtd_QVariant_data(nativeId); 432 Object object = cast(Object)qtd_QVariant_data(__nativeId);
433 if(object) 433 if(object)
434 return cast(Type)(object); 434 return cast(Type)(object);
435 return null; 435 return null;
436 } 436 }
437 else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) ) 437 else static if (isDynamicArrayType!(Type) || isStaticArrayType!(Type) )
438 { 438 {
439 auto array = cast(DArrayToC*)qtd_QVariant_data(nativeId); 439 auto array = cast(DArrayToC*)qtd_QVariant_data(__nativeId);
440 return cast(Type)(array.array); 440 return cast(Type)(array.array);
441 } 441 }
442 else 442 else
443 { 443 {
444 return *cast(Type*)qtd_QVariant_data(nativeId); 444 return *cast(Type*)qtd_QVariant_data(__nativeId);
445 } 445 }
446 } 446 }
447 447
448 public final void clear() { 448 public final void clear() {
449 qtd_QVariant_clear(nativeId); 449 qtd_QVariant_clear(__nativeId);
450 } 450 }
451 451
452 protected final bool cmp(QVariant other) { 452 protected final bool cmp(QVariant other) {
453 return qtd_QVariant_cmp_QVariant(nativeId, other is null ? null : other.nativeId); 453 return qtd_QVariant_cmp_QVariant(__nativeId, other is null ? null : other.__nativeId);
454 } 454 }
455 455
456 protected final void create(int type, void* copy) { 456 protected final void create(int type, void* copy) {
457 qtd_QVariant_create_int_nativepointervoid(nativeId, type, copy); 457 qtd_QVariant_create_int_nativepointervoid(__nativeId, type, copy);
458 } 458 }
459 459
460 public final bool isNull() { 460 public final bool isNull() {
461 return qtd_QVariant_isNull(nativeId); 461 return qtd_QVariant_isNull(__nativeId);
462 } 462 }
463 463
464 public final bool isValid() { 464 public final bool isValid() {
465 return qtd_QVariant_isValid(nativeId); 465 return qtd_QVariant_isValid(__nativeId);
466 } 466 }
467 467
468 public final void load(QDataStream ds) { 468 public final void load(QDataStream ds) {
469 qtd_QVariant_load_QDataStream(nativeId, ds is null ? null : ds.nativeId); 469 qtd_QVariant_load_QDataStream(__nativeId, ds is null ? null : ds.__nativeId);
470 } 470 }
471 471
472 public final void writeTo(QDataStream s) { 472 public final void writeTo(QDataStream s) {
473 qtd_QVariant_writeTo_QDataStream(nativeId, s is null ? null : s.nativeId); 473 qtd_QVariant_writeTo_QDataStream(__nativeId, s is null ? null : s.__nativeId);
474 } 474 }
475 475
476 public final QVariant operator_assign(QVariant other) { 476 public final QVariant operator_assign(QVariant other) {
477 void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(nativeId, other is null ? null : other.nativeId); 477 void* __qt_return_value = qtd_QVariant_operator_assign_QVariant(__nativeId, other is null ? null : other.__nativeId);
478 return new QVariant(__qt_return_value, true); 478 return new QVariant(__qt_return_value, QtdObjectFlags.nativeOwnership);
479 } 479 }
480 480
481 private final bool operator_equal(QVariant v) { 481 private final bool operator_equal(QVariant v) {
482 return qtd_QVariant_operator_equal_QVariant(nativeId, v is null ? null : v.nativeId); 482 return qtd_QVariant_operator_equal_QVariant(__nativeId, v is null ? null : v.__nativeId);
483 } 483 }
484 484
485 public final void readFrom(QDataStream s) { 485 public final void readFrom(QDataStream s) {
486 qtd_QVariant_readFrom_QDataStream(nativeId, s is null ? null : s.nativeId); 486 qtd_QVariant_readFrom_QDataStream(__nativeId, s is null ? null : s.__nativeId);
487 } 487 }
488 488
489 public final void save(QDataStream ds) { 489 public final void save(QDataStream ds) {
490 qtd_QVariant_save_QDataStream(nativeId, ds is null ? null : ds.nativeId); 490 qtd_QVariant_save_QDataStream(__nativeId, ds is null ? null : ds.__nativeId);
491 } 491 }
492 492
493 public final QBitArray toBitArray() { 493 public final QBitArray toBitArray() {
494 void* __qt_return_value = qtd_QVariant_toBitArray(nativeId); 494 void* __qt_return_value = qtd_QVariant_toBitArray(__nativeId);
495 return new QBitArray(__qt_return_value, false); 495 return new QBitArray(__qt_return_value);
496 } 496 }
497 497
498 public final bool toBool() { 498 public final bool toBool() {
499 return qtd_QVariant_toBool(nativeId); 499 return qtd_QVariant_toBool(__nativeId);
500 } 500 }
501 501
502 public final QByteArray toByteArray() { 502 public final QByteArray toByteArray() {
503 void* __qt_return_value = qtd_QVariant_toByteArray(nativeId); 503 void* __qt_return_value = qtd_QVariant_toByteArray(__nativeId);
504 return new QByteArray(__qt_return_value, false); 504 return new QByteArray(__qt_return_value);
505 } 505 }
506 506
507 public final QDate toDate() { 507 public final QDate toDate() {
508 void* __qt_return_value = qtd_QVariant_toDate(nativeId); 508 void* __qt_return_value = qtd_QVariant_toDate(__nativeId);
509 return new QDate(__qt_return_value, false); 509 return new QDate(__qt_return_value);
510 } 510 }
511 511
512 public final QDateTime toDateTime() { 512 public final QDateTime toDateTime() {
513 void* __qt_return_value = qtd_QVariant_toDateTime(nativeId); 513 void* __qt_return_value = qtd_QVariant_toDateTime(__nativeId);
514 return new QDateTime(__qt_return_value, false); 514 return new QDateTime(__qt_return_value);
515 } 515 }
516 516
517 public final double toDouble(bool* ok = null) { 517 public final double toDouble(bool* ok = null) {
518 return qtd_QVariant_toDouble_nativepointerbool(nativeId, ok); 518 return qtd_QVariant_toDouble_nativepointerbool(__nativeId, ok);
519 } 519 }
520 520
521 public final int toInt(bool* ok = null) { 521 public final int toInt(bool* ok = null) {
522 return qtd_QVariant_toInt_nativepointerbool(nativeId, ok); 522 return qtd_QVariant_toInt_nativepointerbool(__nativeId, ok);
523 } 523 }
524 524
525 public final QLine toLine() { 525 public final QLine toLine() {
526 return qtd_QVariant_toLine(nativeId); 526 return qtd_QVariant_toLine(__nativeId);
527 } 527 }
528 528
529 public final QLineF toLineF() { 529 public final QLineF toLineF() {
530 return qtd_QVariant_toLineF(nativeId); 530 return qtd_QVariant_toLineF(__nativeId);
531 } 531 }
532 532
533 public final QLocale toLocale() { 533 public final QLocale toLocale() {
534 void* __qt_return_value = qtd_QVariant_toLocale(nativeId); 534 void* __qt_return_value = qtd_QVariant_toLocale(__nativeId);
535 return new QLocale(__qt_return_value, false); 535 return new QLocale(__qt_return_value);
536 } 536 }
537 537
538 public final long toLongLong(bool* ok = null) { 538 public final long toLongLong(bool* ok = null) {
539 return qtd_QVariant_toLongLong_nativepointerbool(nativeId, ok); 539 return qtd_QVariant_toLongLong_nativepointerbool(__nativeId, ok);
540 } 540 }
541 541
542 public final QPoint toPoint() { 542 public final QPoint toPoint() {
543 return qtd_QVariant_toPoint(nativeId); 543 return qtd_QVariant_toPoint(__nativeId);
544 } 544 }
545 545
546 public final QPointF toPointF() { 546 public final QPointF toPointF() {
547 return qtd_QVariant_toPointF(nativeId); 547 return qtd_QVariant_toPointF(__nativeId);
548 } 548 }
549 549
550 public final QRect toRect() { 550 public final QRect toRect() {
551 return qtd_QVariant_toRect(nativeId); 551 return qtd_QVariant_toRect(__nativeId);
552 } 552 }
553 553
554 public final QRectF toRectF() { 554 public final QRectF toRectF() {
555 return qtd_QVariant_toRectF(nativeId); 555 return qtd_QVariant_toRectF(__nativeId);
556 } 556 }
557 557
558 public final QRegExp toRegExp() { 558 public final QRegExp toRegExp() {
559 void* __qt_return_value = qtd_QVariant_toRegExp(nativeId); 559 void* __qt_return_value = qtd_QVariant_toRegExp(__nativeId);
560 return new QRegExp(__qt_return_value, false); 560 return new QRegExp(__qt_return_value);
561 } 561 }
562 562
563 public final QSize toSize() { 563 public final QSize toSize() {
564 return qtd_QVariant_toSize(nativeId); 564 return qtd_QVariant_toSize(__nativeId);
565 } 565 }
566 566
567 public final QSizeF toSizeF() { 567 public final QSizeF toSizeF() {
568 return qtd_QVariant_toSizeF(nativeId); 568 return qtd_QVariant_toSizeF(__nativeId);
569 } 569 }
570 570
571 public final string toString() { 571 public final string toString() {
572 string res; 572 string res;
573 qtd_QVariant_toString(nativeId, &res); 573 qtd_QVariant_toString(__nativeId, &res);
574 return res; 574 return res;
575 } 575 }
576 576
577 public final QTime toTime() { 577 public final QTime toTime() {
578 void* __qt_return_value = qtd_QVariant_toTime(nativeId); 578 void* __qt_return_value = qtd_QVariant_toTime(__nativeId);
579 return new QTime(__qt_return_value, false); 579 return new QTime(__qt_return_value);
580 } 580 }
581 581
582 public final uint toUInt(bool* ok = null) { 582 public final uint toUInt(bool* ok = null) {
583 return qtd_QVariant_toUInt_nativepointerbool(nativeId, ok); 583 return qtd_QVariant_toUInt_nativepointerbool(__nativeId, ok);
584 } 584 }
585 585
586 public final ulong toULongLong(bool* ok = null) { 586 public final ulong toULongLong(bool* ok = null) {
587 return qtd_QVariant_toULongLong_nativepointerbool(nativeId, ok); 587 return qtd_QVariant_toULongLong_nativepointerbool(__nativeId, ok);
588 } 588 }
589 589
590 public final QUrl toUrl() { 590 public final QUrl toUrl() {
591 void* __qt_return_value = qtd_QVariant_toUrl(nativeId); 591 void* __qt_return_value = qtd_QVariant_toUrl(__nativeId);
592 return new QUrl(__qt_return_value, false); 592 return new QUrl(__qt_return_value);
593 } 593 }
594 594
595 public final char* typeName() { 595 public final char* typeName() {
596 return qtd_QVariant_typeName(nativeId); 596 return qtd_QVariant_typeName(__nativeId);
597 } 597 }
598 598
599 public final Type type() { 599 public final Type type() {
600 return cast(Type)qtd_QVariant_type(nativeId); 600 return cast(Type)qtd_QVariant_type(__nativeId);
601 } 601 }
602 602
603 public final int userType() { 603 public final int userType() {
604 return qtd_QVariant_userType(nativeId); 604 return qtd_QVariant_userType(__nativeId);
605 } 605 }
606 // Field accessors 606 // Field accessors
607 607
608 public this(void* native_id, bool no_real_delete = false) { 608 public this(void* native_id, QtdObjectFlags flags = QtdObjectFlags.none) {
609 super(native_id, no_real_delete); 609 super(native_id, flags);
610 } 610 }
611 611
612 612 protected override void __deleteNative() {
613 ~this() { 613 qtd_QVariant_destructor(__nativeId);
614 if(!__no_real_delete)
615 __free_native_resources();
616 }
617
618 protected void __free_native_resources() {
619 qtd_QVariant_destructor(nativeId());
620 } 614 }
621 615
622 // Injected code in class 616 // Injected code in class
623 } 617 }
624 extern (C) void qtd_QVariant_destructor(void *ptr); 618 extern (C) void qtd_QVariant_destructor(void *ptr);