Mercurial > projects > qtd
comparison qt/core/QList.d @ 299:87db643519a4 signals
missing bits prior to getting it compiled on windows
author | eldar |
---|---|
date | Sun, 06 Dec 2009 22:20:23 +0000 |
parents | adae77fdc1ea |
children | 55ee4603365d |
comparison
equal
deleted
inserted
replaced
298:adae77fdc1ea | 299:87db643519a4 |
---|---|
425 node_copy(cast(Node*)(p.begin()), cast(Node*)(p.end()), n); | 425 node_copy(cast(Node*)(p.begin()), cast(Node*)(p.end()), n); |
426 if (!x.ref_.decrement()) | 426 if (!x.ref_.decrement()) |
427 free(x); | 427 free(x); |
428 } | 428 } |
429 | 429 |
430 | |
431 void append(const T t) // fix to const ref for complex types TODO | 430 void append(const T t) // fix to const ref for complex types TODO |
432 { | 431 { |
433 detach(); | 432 detach(); |
434 static if (isQObjectType!T || isObjectType!T || isValueType!T) | 433 static if (isQObjectType!T || isObjectType!T || isValueType!T) |
435 { | 434 { |
455 return (cast(Node*)(p.at(i))).t(); | 454 return (cast(Node*)(p.at(i))).t(); |
456 } | 455 } |
457 } | 456 } |
458 else | 457 else |
459 { | 458 { |
460 const (T) at(int i) const | 459 const (T) at(int i) const // DMD BUG |
461 { | 460 { |
462 assert(i >= 0 && i < p.size(), "QList!T.at(): index out of range"); | 461 assert(i >= 0 && i < p.size(), "QList!T.at(): index out of range"); |
463 return (cast(Node*)(p.at(i))).t(); | 462 return (cast(Node*)(p.at(i))).t(); |
464 } | 463 } |
465 ref T opIndex(int i) | 464 ref T opIndex(int i) |
599 } | 598 } |
600 return result; | 599 return result; |
601 } | 600 } |
602 } | 601 } |
603 | 602 |
603 alias QList!string QStringList; | |
604 | |
605 QList!T toQList(T)(T[] src) | |
606 { | |
607 auto res = QList!T.opCall(); | |
608 foreach(elem; src) | |
609 res.append(elem); | |
610 return res; | |
611 } | |
612 | |
613 QList!T qList(T)() | |
614 { | |
615 return QList!T.opCall(); | |
616 } | |
617 | |
604 extern(C) void qtd_create_QList(void *nativeId); | 618 extern(C) void qtd_create_QList(void *nativeId); |
605 extern(C) void qtd_create_QList_double(void *nativeId); | 619 extern(C) void qtd_create_QList_double(void *nativeId); |
606 | 620 |
607 extern(C) void qtd_create_QList_QObject(void *nativeId); | 621 extern(C) void qtd_create_QList_QObject(void *nativeId); |