diff options
Diffstat (limited to 'src/qtwizard/GuiWizard.cs')
-rw-r--r-- | src/qtwizard/GuiWizard.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qtwizard/GuiWizard.cs b/src/qtwizard/GuiWizard.cs index 6ed7d11c..314bbee3 100644 --- a/src/qtwizard/GuiWizard.cs +++ b/src/qtwizard/GuiWizard.cs @@ -38,6 +38,7 @@ using QtVsTools.VisualStudio; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using System.Text.RegularExpressions; using System.Windows.Controls; @@ -48,6 +49,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>(); @@ -151,6 +153,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; @@ -218,6 +221,11 @@ namespace QtProjectWizard replacements["$isSet_WindowsTargetPlatformVersion$"] = "true"; } } + + if (qtMoc.Length > 0) + replacements["$QtMoc$"] = string.Format("<QtMoc>{0}</QtMoc>", qtMoc); + else + replacements["$QtMoc$"] = string.Empty; #endif } catch { try { |