diff options
Diffstat (limited to 'src/qtwizard/DesignerWizard.cs')
-rw-r--r-- | src/qtwizard/DesignerWizard.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qtwizard/DesignerWizard.cs b/src/qtwizard/DesignerWizard.cs index 7b4dfdd1..24a06817 100644 --- a/src/qtwizard/DesignerWizard.cs +++ b/src/qtwizard/DesignerWizard.cs @@ -39,6 +39,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using System.Text.RegularExpressions; using System.Windows.Controls; using System.Windows.Forms; @@ -111,6 +112,7 @@ namespace QtProjectWizard public void RunStarted(object automation, Dictionary<string, string> replacements, WizardRunKind runKind, object[] customParams) { + var qtMoc = new StringBuilder(); var serviceProvider = new ServiceProvider(automation as IServiceProvider); var iVsUIShell = VsServiceProvider.GetService<SVsUIShell, IVsUIShell>(); @@ -233,6 +235,7 @@ namespace QtProjectWizard strHeaderInclude = "stdafx.h\"\r\n#include \"" + data.ClassHeaderFile; replacements["$precompiledheader$"] = "<None Include=\"stdafx.h\" />"; replacements["$precompiledsource$"] = "<None Include=\"stdafx.cpp\" />"; + qtMoc.Append("<PrependInclude>stdafx.h</PrependInclude>"); } replacements["$include$"] = strHeaderInclude; @@ -242,6 +245,11 @@ namespace QtProjectWizard replacements["$WindowsTargetPlatformVersion$"] = versionWin10SDK; replacements["$isSet_WindowsTargetPlatformVersion$"] = "true"; } + + if (qtMoc.Length > 0) + replacements["$QtMoc$"] = string.Format("<QtMoc>{0}</QtMoc>", qtMoc); + else + replacements["$QtMoc$"] = string.Empty; #endif } catch { try { |