Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Creating a Project

You can use wizards to create following types of projects:

  • Qt Quick Project

    Use QML elements or Qt Quick Components to define the user interface and, optionally, C++ or JavaScript to define the application logic.

  • Qt Widget Project

    Use Qt Designer forms to define a Qt widget based user interface and C++ to define the application logic

  • Other Project
    • HTML5 based applications
    • Qt console applications
    • Shared or static C++ libraries
    • Qt unit tests
    • Qt Custom Designer Widgets
    • Subprojects
  • Project from Version Control

    Import a project from a supported version control system. For more information on how version control systems are integrated in Qt Creator, see Using Version Control Systems.

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 Projects

You can use wizards also to add individual files to your projects. You can create the following types of files:

  • Qt resource files, which allow you to store binary files in the application executable
  • Qt Designer forms and Qt Designer form classes, which specify parts of user interfaces in Qt widget based projects
  • QML files, which specify elements in Qt Quick projects
  • GLSL files that define fragment and vertex shaders in both Qt Quick projects and Qt widget based projects
  • C++ class, source, or header files that you can use to write the application logic in both Qt Quick projects and Qt widget based projects
  • JavaScript files that you can use to write the application logic in Qt Quick projects
  • Text files

Creating C++ Classes

The 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.

"Enter Class Name dialog"

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 Shaders

Qt 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.

"New OpenGL file wizard"

Displaying Additional File Types in Projects Pane

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:

 OTHER_FILES += *.txt

This also makes the files available in the Locator.

Adding Subprojects to Projects

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

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtcreator-2.3
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web


Warning: mysql_connect() [function.mysql-connect]: [2002] Connection refused (trying to connect via tcp://developpez.net:3306) in /home/developpez/www/developpez-com/template/connexion.php on line 7

Warning: mysql_connect() [function.mysql-connect]: Connection refused in /home/developpez/www/developpez-com/template/connexion.php on line 7

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/developpez/www/developpez-com/template/pied.php on line 12