Mercurial > projects > qtd
comparison qt/qtd/MOC.d @ 323:7a3c43424dca signals
make all examples compile with new signals/slots
author | eldar_ins@eldar-laptop |
---|---|
date | Mon, 28 Dec 2009 16:28:55 +0500 |
parents | 7c2cf27391c4 |
children | c97e5d15bf95 |
comparison
equal
deleted
inserted
replaced
322:7c2cf27391c4 | 323:7a3c43424dca |
---|---|
2 | 2 |
3 import qt.qtd.ctfe.Format; | 3 import qt.qtd.ctfe.Format; |
4 | 4 |
5 import std.typetuple; | 5 import std.typetuple; |
6 | 6 |
7 import qt.QGlobal; | |
7 import qt.Signal; | 8 import qt.Signal; |
8 import qt.qtd.MetaMarshall; | 9 import qt.qtd.MetaMarshall; |
9 import qt.qtd.Meta; | 10 import qt.qtd.Meta; |
10 | 11 |
11 public import qt.core.QString; | 12 public import qt.core.QString; |
12 | 13 |
13 public import std.traits; | 14 public import std.traits; |
14 /** | 15 /** |
15 Utils. | 16 Utils. |
16 */ | 17 */ |
17 | |
18 T qMin(T)(T a,T b) { if (a < b) return a; return b; } | |
19 T qMax(T)(T a, T b) { if (a < b) return b; return a; } | |
20 T qBound(T)(T min, T val,T max) { return qMax(min, qMin(max, val)); } | |
21 | 18 |
22 bool is_digit_char(const char s) | 19 bool is_digit_char(const char s) |
23 { | 20 { |
24 return (s >= '0' && s <= '9'); | 21 return (s >= '0' && s <= '9'); |
25 } | 22 } |
459 | 456 |
460 string generateQMetaObject(string className) | 457 string generateQMetaObject(string className) |
461 { | 458 { |
462 string res; | 459 string res; |
463 res ~= " | 460 res ~= " |
464 QMetaObject metaObject() { return staticMetaObject; } | 461 public QMetaObject metaObject() { return staticMetaObject; } |
465 private static QMetaObject _staticMetaObject; | 462 private static QMetaObject _staticMetaObject; |
466 private static QMetaObjectNative _nativeStaticMetaObject; | 463 private static QMetaObjectNative _nativeStaticMetaObject; |
467 public static QMetaObject staticMetaObject() { return _staticMetaObject; } | 464 public static QMetaObject staticMetaObject() { return _staticMetaObject; } |
468 protected static void createStaticMetaObject() { | 465 protected static void createStaticMetaObject() { |
469 assert(!_staticMetaObject); | 466 assert(!_staticMetaObject); |
556 alias toMetaEntries!(SignalFuncs) SignalMetaEntries; | 553 alias toMetaEntries!(SignalFuncs) SignalMetaEntries; |
557 alias findSlots!(typeof(this)) SlotFuncs; | 554 alias findSlots!(typeof(this)) SlotFuncs; |
558 alias toMetaEntries!(SlotFuncs) SlotMetaEntries; | 555 alias toMetaEntries!(SlotFuncs) SlotMetaEntries; |
559 | 556 |
560 mixin(generateMetaInfo!(typeof(this), SignalMetaEntries, SlotMetaEntries)()); | 557 mixin(generateMetaInfo!(typeof(this), SignalMetaEntries, SlotMetaEntries)()); |
561 pragma(msg, generateMetaInfo!(typeof(this), SignalMetaEntries, SlotMetaEntries)()); | 558 // debug output |
562 } | 559 // pragma(msg, generateMetaInfo!(typeof(this), SignalMetaEntries, SlotMetaEntries)()); |
560 } |