コード例 #1
0
 private void SaveModules()
 {
     qtProject = QtProject.Create(project);
     for (int i = 0; i < moduleMap.Count; ++i)
     {
         ModuleMapItem item            = moduleMap[i];
         bool          isModuleChecked = item.checkbox.Checked;
         if (isModuleChecked != item.initialValue)
         {
             if (isModuleChecked)
             {
                 qtProject.AddModule(item.moduleId);
             }
             else
             {
                 qtProject.RemoveModule(item.moduleId);
             }
         }
     }
 }
コード例 #2
0
        /// <summary>
        /// Creates an initializes a new qt library project. Call this function before calling other functions in this class.
        /// </summary>
        /// <param name="app">The DTE object</param>
        /// <param name="proName">Name of the project to create</param>
        /// <param name="proPath">The path to the new project</param>
        /// <param name="slnName">Name of solution to create (If this is empty it will create a solution with
        /// the same name as the project)</param>
        /// <param name="exclusive">true if the project should be opened in a new solution</param>
        /// <param name="staticLib">true if the project should be created as a static library</param>
        public void CreateLibraryProject(EnvDTE.DTE app, string proName,
                                         string proPath, string slnName, bool exclusive, bool staticLib, bool usePrecompiledHeaders)
        {
            FakeFilter[] filters = { Filters.SourceFiles(), Filters.HeaderFiles(),
                                     Filters.FormFiles(),   Filters.ResourceFiles(), Filters.GeneratedFiles() };
            uint         projType;

            if (staticLib)
            {
                projType = TemplateType.StaticLibrary | TemplateType.GUISystem;
            }
            else
            {
                projType = TemplateType.DynamicLibrary | TemplateType.GUISystem;
            }

            CreateProject(app, proName, proPath, slnName, exclusive, filters, null, null);
            qtPro.WriteProjectBasicConfigurations(projType, usePrecompiledHeaders);
            qtPro.AddModule(QtModule.Main);
        }