# HG changeset patch # User eldar_ins@eldar-laptop # Date 1261613980 -18000 # Node ID ce07227f00c1724a911dec67f505073ba76062b2 # Parent 8a0cf14e3419bc7e56cee777168d99a2c279a73f more signals and QList diff -r 8a0cf14e3419 -r ce07227f00c1 qt/core/QList.d --- a/qt/core/QList.d Wed Dec 23 04:48:11 2009 +0500 +++ b/qt/core/QList.d Thu Dec 24 05:19:40 2009 +0500 @@ -440,7 +440,9 @@ node_construct(cast(Node*)(p.append()), cpy); } } - + + alias append opCatAssign; + static if (isQObjectType!T || isObjectType!T || isValueType!T || is(T == string)) { T at(int i) const diff -r 8a0cf14e3419 -r ce07227f00c1 qt/d2/qt/Signal.d --- a/qt/d2/qt/Signal.d Wed Dec 23 04:48:11 2009 +0500 +++ b/qt/d2/qt/Signal.d Thu Dec 24 05:19:40 2009 +0500 @@ -323,7 +323,7 @@ res ~= "void*[" ~ __toString(Args.length+1) ~ "] _a = [null"; foreach(i, _; Args) - res ~= ", " ~ "cast(void*) &" ~ convertSignalArgument!(Args[i])("_t" ~ __toString(i)); + res ~= ", " ~ "cast(void*) " ~ convertSignalArgument!(Args[i])("_t" ~ __toString(i)); res ~= "];\n"; return res; } diff -r 8a0cf14e3419 -r ce07227f00c1 qt/qtd/MetaMarshall.d --- 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...)()