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  · 

Quick Tour

The figure below shows some of the components of Qt Creator in Edit mode.

Qt Creator has been localized into several languages. If the system language is one of the supported languages, it is automatically selected. To change the language, select Tools > Options > Environment and select a language in the Language field. The change takes effect after you restart Qt Creator.

Qt Creator Modes

The mode selector allows you to quickly switch between tasks such as editing project and source files, designing application UIs, configuring how projects are built and executed, and debugging your applications. To change modes, click the icons, or use the corresponding keyboard shortcut.

  • Welcome mode for opening recent sessions and projects.
  • Edit mode for editing project and source files.
  • Design mode for designing and developing application user interfaces.
  • Debug mode for inspecting the state of your program while debugging.
  • Projects mode for configuring project building and execution.
  • Help mode for viewing Qt documentation.

Certain actions in Qt Creator trigger a mode change. Clicking on Debug > Start debugging > Start debugging automatically switches to Debug mode.

Browsing Project Contents

Use the sidebar to browse files, projects and bookmarks.

You can select the content of the sidebar in the sidebar menu:

  • Projects shows a list of projects open in the current session.
  • File System shows the content of the currently selected directory.
  • Bookmarks shows all bookmarks for the current session.
  • Open Documents shows currently open files.

You can change the view of the sidebar in the following ways:

  • To toggle the sidebar, click or press Alt+0 (Cmd+0 on Mac OS X).
  • To split the sidebar, click . Select new content to view in the split view.
  • To close a sidebar view, click .

Viewing Project Files

The sidebar displays projects in a project tree. The project tree contains a list of all projects open in the current session. The files for each project are grouped according to their file type.

You can use the project tree in the following ways:

  • To bring up a context menu containing the actions most commonly needed right-click an item in the project tree. For example, through the menu of the project root directory you can, among other actions, build, re-build, clean and run the project.
  • To list all files in a project, click and select Simplify tree.
  • To hide source files which are automatically generated by the build system, during a build, click and select Hide generated files.
  • To toggle the synchronization of your project tree with the file opened in the editor, click .
  • To see the absolute path of a file, move the mouse pointer over the file name.

Viewing Output

The task pane in Qt Creator can display one of the following panes:

  • Build Issues
  • Search Results
  • Application Output
  • Compile Output
  • General Messages
  • Version Control

Output panes are available in all modes. Click the name of an output pane to open the pane. To maximize an open output pane, click the Maximize Output Pane button or press Alt+9.

To open the General Messages and Version Control panes, select Window > Output Panes.

Build Issues

The Build Issues pane provides a list of errors and warnings encountered during a build. The pane filters out irrelevant output from the build tools and presents the issues in an organized way.

Right-clicking on a line brings up a context menu with options to copy the contents and to show a version control annotation view of the line that causes the error message.

Search Results

The Search Results pane displays the results for global searches, for example, searching within a current document, files on disk, or all projects.

The figure below shows an example search result for all occurrences of textfinder within the "/TextFinder" directory.

Application Output

The Application Output pane displays the status of a program when it is executed, and the debug output.

The figure below shows an example output from qDebug().

Compile Output

The Compile Output pane provides all output from the compiler. The Compile Output is a more detailed version of information displayed in the Build Issues pane.

Getting Help

Qt Creator comes fully integrated with Qt documentation and examples using the Qt Help plugin.

  • To view documentation, switch to Help mode.
  • To obtain context sensitive help, move the text cursor to a Qt class or function and press F1. The documentation is displayed in a pane next to the code editor, or, if there is not enough vertical space, in the fullscreen Help mode.

  • To select and configure how the documentation is displayed in the Help mode, select Tools > Options... > Help.

Adding External Documentation

You can display external documentation in the Help mode. To augment or replace the documentation that ships with Qt Creator and Qt:

  1. Create a .qch file from your documentation.

    For information on how to prepare your documentation and create a .qch file, see The Qt Help Framework.

  2. To add the .qch file to Qt Creator, select Tools > Options... > Help > Documentation > Add.

Using Documentation Filters

You can filter the documents displayed in the Help mode to find relevant information faster. Select from a list of filters in the Filtered by field. The contents of the Index and Contents pane in the sidebar change accordingly.

"Help filters"

You can modify the filters to include external documentation, for example, or you can define your own filters. To construct filters, you can use the filter attributes that are specified in the documentation. Each document contains at least one filter attribute. If several documents contain the same filter attribute, such as tools, you can use that attribute to include all those documents.

To add filters:

  1. Select Tools > Options... > Help > Filters > Add.
  2. Enter a name for the filter and press OK.
  3. In Attributes, select the documents that you want to include in the filter.

    "Help filter attributes"

  4. Click OK.
  5. In the Help mode, select the filter in the Filtered by field to see the filtered documentation in the sidebar.

To modify filters, select a filter in Filters, select the attributes, and then click Apply.

To remove filters, select them in Filters, and click Remove.

Navigating with Keyboard

Qt Creator caters not only to developers who are used to using the mouse, but also to developers who are more comfortable with the keyboard. A wide range of keyboard and navigation shortcuts are available to help speed up the process of developing your application.

Using Qt Designer

Qt Creator automatically opens all .ui files in Qt Designer.

To change the layout of Qt Designer user interface elements:

  1. Select Tools > Form Editor > Views > Locked.

    When this option is unchecked, you can change the layout.

  2. Click the header of an element and drag the element to a new position.

To change Qt Designer properties, select Tools > Options... > Designer.

  • Set the class properties and code generation preferences in Class Generation.
  • Set an additional folder for saving templates in Template Paths.
  • Set the grid settings and preview preferences in Forms. To preview your form with skins, enable Print/Preview Configuration and select your skin. Otherwise default preview settings are used.

    To preview the settings, select Tools > Form Editor > Preview, or press Ctrl+Alt+R.

  • To specify embedded device profiles, such as style, font, and screen resolution, select Embedded Design.

For more information on Qt Designer, see Qt Designer Manual.

X

rc="scripts/functions.js" type="text/javascript">
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. 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.0
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