Mercurial > projects > qtd
diff qt/qtd/MetaMarshall.d @ 318:ce07227f00c1 signals
more signals and QList
author | eldar_ins@eldar-laptop |
---|---|
date | Thu, 24 Dec 2009 05:19:40 +0500 |
parents | 8a0cf14e3419 |
children | 894d40eb89b6 |
line wrap: on
line diff
--- a/qt/qtd/MetaMarshall.d Wed Dec 23 04:48:11 2009 +0500 +++ b/qt/qtd/MetaMarshall.d Thu Dec 24 05:19:40 2009 +0500 @@ -81,6 +81,8 @@ { static if (isQObjectType!T || isObjectType!T) return T.stringof ~ ".__getObject(*cast(void**)(" ~ ptr ~ "))"; + else static if (isValueType!T) + return "new " ~ T.stringof ~ "(" ~ T.stringof ~ ".__constructNativeCopy(" ~ ptr ~ "))"; else static if (isNativeType!T) return "*(cast(" ~ T.stringof ~ "*)" ~ ptr ~ ")"; else static if (isStringType!T) @@ -95,10 +97,18 @@ { static if (isQObjectType!T || isObjectType!T) return T.stringof ~ "*"; + else static if (isValueType!T) + return T.stringof; else static if (isStringType!T) return "QString"; else static if (isQList!T) - return "QList<" ~ qtDeclArg!(templateParam!T)() ~ ">"; + { + alias templateParam!T ElementType; + static if (is(ElementType == string)) + return "QStringList"; + else + return "QList<" ~ qtDeclArg!(templateParam!T)() ~ ">"; + } else static if (isNativeType!T) return Unqual!T.stringof; else @@ -109,13 +119,15 @@ string convertSignalArgument(T)(string arg) { static if (isQObjectType!T || isObjectType!T) + return "&" ~ arg ~ ".__nativeId"; + else static if (isValueType!T) return arg ~ ".__nativeId"; else static if (isStringType!T) - return "_qt" ~ arg; + return "&_qt" ~ arg; else static if (isNativeType!T) - return arg; + return "&" ~ arg; else - return arg; + return "&" ~ arg; } string prepareSignalArguments(Args...)()