Creating a ProjectYou can use wizards to create following types of projects:
To create a new project, select File > New File or Project and select the type of your project. The contents of the wizard dialogs depend on the project type and the build targets that you select in the Target Setup dialog. Follow the instructions of the wizard. For examples of creating different types of projects, see Getting Started. For more information about creating Qt Quick projects, see Creating Qt Quick Projects. To change the location of the project directory, and to specify settings for building and running projects, select Tools > Options... > Projects > General. To specify build and run settings for different target platforms, select Projects. Adding Files to ProjectsYou can use wizards also to add individual files to your projects. You can create the following types of files:
Creating C++ ClassesThe C++ Class Wizard allows you to create a C++ header and source file for a new class that you can add to a C++ project. Specify the class name, base class, and header and source files for the class. The wizard supports namespaces. To use a namespace, enter a qualified class name in the Class name field. For example: MyNamespace::MySubNamespace::MyClass. The names of the header and source file are based on the class name. To change the default suffix of a file, click Configure. You can create your own project and class wizards. For more information, see Adding New Custom Wizards. Creating OpenGL Fragment and Vertex ShadersQt provides support for integration with OpenGL implementations on all platforms, which allows you to display hardware accelerated 3D graphics alongside a more conventional user interface. For more information, see QtOpenGL Module. You can use the QGLShader class to compile OpenGL shaders written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES). QGLShader and QGLShaderProgram shelter you from the details of compiling and linking vertex and fragment shaders. You can use Qt Creator code editor to write fragment and vertex shaders in GLSL or GLSL/ES. The code editor provides syntax highlighting and code completion for the files. Qt Creator determines whether to display files from the project folder in the Projects pane depending on the file type (.pro, .pri, .cpp, .h, .ui, .qrc, and so on). To display other types of files, edit the project file. Add filenames as values of the OTHER_FILES variable. You can also use wildcards. For example, the following code specifies that text files are displayed in the Projects pane: This also makes the files available in the Locator. When you create a new project, you can add it to another project as a subproject in the Project Management dialog. However, the root project must specify that qmake uses the subdirs template to build the project. To create a root project, select File > New File or Project... > Other Project > Subdirs Project > Choose. On the Summary page, select Finish & Add Subproject to create the root project and to add another project, such as a C++ library. The wizard creates a project file (.pro) that defines a subdirs template and the subproject that you add as a value of the SUBDIRS variable. It also adds all the necessary files for the subproject. To add more subprojects, right-click the project name in the Projects pane, and select New Subproject in the context menu. To remove subprojects, right-click the project name in the Projects pane, and select Remove Subproject in the context menu. To specify dependencies, use the Add Library wizard. For more information, see Adding Libraries to Projects. X
|