diff --git a/QtSharp.CLI/Program.cs b/QtSharp.CLI/Program.cs index 5df32cd2..369f5a9a 100644 --- a/QtSharp.CLI/Program.cs +++ b/QtSharp.CLI/Program.cs @@ -95,7 +95,7 @@ public static int Main(string[] args) dependencies[libFile] = Enumerable.Empty(); } } - var modules = new List { "Qt5Core", "Qt5Gui", "Qt5Widgets", "Qt5Xml", "Qt5Designer", "Qt5Network" }; + var modules = new List { "Qt5Core", "Qt5Gui", "Qt5Widgets", "Qt5Xml", "Qt5Designer", "Qt5Network", "Qt5Qml" }; if (debug) { for (var i = 0; i < modules.Count; i++) diff --git a/QtSharp/QString.cs b/QtSharp/QString.cs index 665b5a4b..5d902b32 100644 --- a/QtSharp/QString.cs +++ b/QtSharp/QString.cs @@ -13,11 +13,7 @@ public override string CSharpSignature(CSharpTypePrinterContext ctx) { if (ctx.CSharpKind == CSharpTypePrinterContextKind.Native) { - if (ctx.Type.IsAddress()) - { - return "QtCore.QString.Internal*"; - } - return "QtCore.QString.Internal"; + return ctx.Type.IsAddress() ? "QtCore.QString.Internal*" : "QtCore.QString.Internal"; } return "string"; } @@ -28,7 +24,7 @@ public override void CSharpMarshalToNative(MarshalContext ctx) ctx.ParameterIndex, ctx.Parameter.Name); ctx.SupportBefore.WriteLine("var __qstring{0} = QtCore.QString.FromUtf16(ref *__stringPtr{0}, {1}.Length);", ctx.ParameterIndex, ctx.Parameter.Name); - Type type = ctx.Parameter.Type.Desugar(); + var type = ctx.Parameter.Type.Desugar(); if (type.IsAddress()) { ctx.Return.Write("ReferenceEquals(__qstring{0}, null) ? global::System.IntPtr.Zero : __qstring{0}.{1}", @@ -39,10 +35,10 @@ public override void CSharpMarshalToNative(MarshalContext ctx) type.TryGetClass(out @class); if (@class == null) { - Type.TryGetClass(out @class); + this.Type.TryGetClass(out @class); } - typePrinter = typePrinter ?? (typePrinter = new CSharpTypePrinter(ctx.Driver)); - var qualifiedIdentifier = (@class.OriginalClass ?? @class).Visit(typePrinter); + this.typePrinter = this.typePrinter ?? (this.typePrinter = new CSharpTypePrinter(ctx.Driver)); + var qualifiedIdentifier = (@class.OriginalClass ?? @class).Visit(this.typePrinter); ctx.Return.Write("ReferenceEquals(__qstring{0}, null) ? new {1}.Internal() : *({1}.Internal*) (__qstring{0}.{2})", ctx.ParameterIndex, qualifiedIdentifier, Helpers.InstanceIdentifier); } @@ -53,6 +49,6 @@ public override void CSharpMarshalToManaged(MarshalContext ctx) Helpers.CreateInstanceIdentifier, ctx.ReturnVarName); } - CSharpTypePrinter typePrinter; + private CSharpTypePrinter typePrinter; } }