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  · 

Introducing Qt Creator

Qt Creator is an integrated development environment (IDE) that provides you with tools to design and develop applications with the Qt application framework. Qt is designed for developing applications and user interfaces once and deploying them across several desktop and mobile operating systems. Qt Creator provides you with tools for accomplishing your tasks throughout the whole application development life-cycle, from creating a project to deploying the application on the target platforms.

"Qt Creator overview"

Cross-platform Development

One of the major advantages of Qt Creator is that it allows a team of developers to share a project across different development platforms with a common tool for development and debugging.

The recommended way to build a project is to use a version control system. Store and edit only project source files and the .pro and .pri files (for qmake) or CMakeLists.txt and *.cmake files (for CMake). Do not store files generated by the build system or Qt Creator, such as makefiles, .pro.user, and object files. Other approaches are possible, but we recommend that you do not use network resources, for example.

Qt Creator allows you to specify separate build settings for each development platform. By default, shadow builds are used to keep the build specific files separate from the source.

You can create separate versions of project files to keep platform-dependent code separate. You can use qmake scopes to select the file to process depending on which platform qmake is run on.

Items such as open files, breakpoints, and evaluated expressions are stored in sessions. They are not considered to be part of the information shared across platforms.

Creating Projects

But why do you need projects? To be able to build and run applications, Qt Creator needs the same information as a compiler would need. This information is specified in the project build and run settings.

Creating a project allows you to:

  • Group files together
  • Add custom build steps
  • Include forms and resource files
  • Specify settings for running applications

Setting up a new project in Qt Creator is aided by a wizard that guides you step-by-step through the project creation process. In the first step, you select the type of the project from the categories: Qt Quick project, Qt widget project, or other project. Next, you select a location for the project and specify settings for it.

When you have completed the steps, Qt Creator automatically generates the project with required headers, source files, user interface descriptions and project files, as defined by the wizard. For example, if you choose to create a Qt Quick application, Qt Creator generates a QML file that you can modify with the integrated Qt Quick Designer.

Adding Libraries

In addition to Qt libraries, you can link your application to other libraries, such as system libraries or your own libraries. Further, your own libraries might link to other libraries. To be able to compile your project, you must add the libraries to your project. This also enables code completion and syntax highlighting for the libraries. The procedure of adding a library to a project depends on the build system that you use.

Version Control Systems

Qt Creator uses the version control system's command line clients to access your repositories. The following version control systems are supported:

  • Git
  • Subversion
  • Perforce
  • CVS
  • Mercurial
  • Bazaar

The functions available to you in Qt Creator depend on the version control system. Basic functions are available for all the supported systems. They include comparing files with the latest versions stored in the repository and displaying the differences, viewing versioning history and change details, annotating files, and committing and reverting changes.

Designing User Interfaces

Qt Creator provides two integrated visual editors, Qt Quick Designer and Qt Designer.

"Qt Quick Designer and Qt Designer"

Large high-resolution screens, touch input, and significant graphics power are becoming common in portable consumer devices, such as mobile phones, media players, set-top boxes, and netbooks. To fully benefit from these features and to create intuitive, modern-looking, fluid user interfaces, you can use Qt Quick.

Qt Quick consists of a rich set of user interface elements, a declarative language for describing user interfaces, and a language runtime. A collection of C++ APIs is used to integrate these high level features with classic Qt applications.

You can edit QML code in the code editor or in the integrated Qt Quick Designer. The integration includes project management and code completion.

If you need a traditional user interface that is clearly structured and enforces a platform look and feel, you can use the integrated Qt Designer. You can compose and customize your widgets or dialogs and test them using different styles and resolutions.

Code Editor

As an IDE, Qt Creator differs from a text editor in that it knows how to build and run applications. It understands the C++ and QML languages as code, not just as plain text. This allows it to:

  • Enable you to write well formatted code
  • Anticipate what you are going to write and complete the code
  • Display inline error and warning messages
  • Enable you to semantically navigate to classes, functions, and symbols
  • Provide you with context-sensitive help on classes, functions, and symbols
  • Rename symbols in an intelligent way, so that other symbols with the same name that belong to other scopes are not renamed
  • Show you the locations in code where a function is declared or called

You can use the code editor to write code in Qt C++ or in the QML declarative programming language. QML is an extension to JavaScript, that provides a mechanism to declaratively build an object tree of QML elements. QML improves the integration between JavaScript and Qt's existing QObject based type system, adds support for automatic property bindings and provides network transparency at the language level.

Building

Qt Creator is integrated with cross-platform systems for build automation: qmake and CMake. In addition, you can import generic projects that do not use qmake or CMake, and specify that Qt Creator ignores your build system.

Qt Creator provides support for building and running Qt applications for desktop environment (Windows, Linux, and Mac OS) and mobile devices (Symbian, Maemo, and MeeGo Harmattan). Build settings allow you to quickly switch between build targets.

When you install the Qt SDK, the build and run settings for the Harmattan, Maemo, and Symbian targets are set up automatically. However, you need to install and configure some additional software on the devices to be able to connect to them from the development PC.

Note: The only supported build system for mobile applications in Qt Creator is qmake.

Testing

If you install Qt Creator as part of Qt SDK, the GNU Symbolic Debugger is installed automatically and you should be ready to start debugging after you create a new project. However, you can change the setup to use debugging tools for Windows, for example. You can connect mobile devices to your development PC and debug processes running on the devices.

You can use code analysis tools to detect memory leaks, profile cache usage, and profile Qt Quick applications.

You can test applications that are intended for mobile devices in the Qt Simulator and Maemo or MeeGo Harmattan emulator, but you also need to test the applications on real devices.

Debuggers

Qt Creator is integrated to several external native debuggers:

  • GNU Symbolic Debugger (GDB)
  • Microsoft Console Debugger (CDB)
  • internal JavaScript debugger

You can use the Qt Creator Debug mode to inspect the state of your application while debugging. You can interact with the debugger in several ways, including the following:

  • Go through a program line-by-line or instruction-by-instruction.
  • Interrupt running programs.
  • Set breakpoints.
  • Examine the contents of the call stack.
  • Examine and modify registers and memory contents of the debugged program.
  • Examine and modify registers and memory contents of local and global variables.
  • Examine the list of loaded shared libraries.
  • Create snapshots of the current state of the debugged program and re-examine them later.

Qt Creator displays the raw information provided by the native debuggers in a clear and concise manner with the goal to simplify the debugging process as much as possible without losing the power of the native debuggers.

In addition to the generic IDE functionality provided by stack view, views for locals and expressions, registers, and so on, Qt Creator includes features to make debugging Qt-based applications easy. The debugger plugin understands the internal layout of several Qt classes, for example, QString, the Qt containers, and most importantly QObject (and classes derived from it), as well as most containers of the C++ Standard Library and some GCC and Symbian extensions. This deeper understanding is used to present objects of such classes in a useful way.

QML Script Console

You can use the Qt Creator Debug mode to inspect the state of the application while debugging JavaScript functions. You can set breakpoints, view call stack trace, and examine locals and expressions.

When the application is interrupted by a breakpoint, you can use the QML Script Console to execute JavaScript expressions in the current context. You can type JavaScript expressions and use them to get information about the state of the application, such as property values.

If you change property values or add properties in the code editor, the changes are updated in the running application when they are saved.

QML Inspector

While the application is running, you can use the QML Inspector view to explore the object structure, debug animations, and inspect colors. When debugging complex applications, you can use the inspection mode to jump to the position in code where an element is defined.

Code Analysis Tools

The memory available on devices is limited and you should use it carefully. Qt Creator integrates Valgrind code analysis tools for detecting memory leaks and profiling function execution. These tools are only supported on Linux and Mac OS, but you can run them remotely from Windows. You must download and install them separately to use them from Qt Creator.

The QML Profiler is installed as part of Qt Creator. It allows you to profile your Qt Quick applications and is available on all supported development platforms.

Qt Simulator

You can use the Qt Simulator to test Qt applications that are intended for mobile devices in an environment similar to that of the device. You can change the information that the device has about its configuration and environment.

Qt Simulator does not support any device specific APIs by design. Therefore, applications that run well on Qt Simulator also run on any device that hosts the Qt and Qt Mobility libraries. However, this means that you cannot use Qt Simulator to test applications that use device specific libraries, such as Symbian C++ APIs. To test such applications, use the device emulators or real devices.

The Qt Simulator is installed as part of the Qt SDK. After it is installed, you can select it as a build target in Qt Creator.

Maemo and MeeGo Harmattan Emulator

The Maemo 5 (Fremantle) and MeeGo Harmattan emulator are installed as part of the Qt SDK. After they are installed, you can start them from Qt Creator.

The Maemo 5 emulator emulates the Nokia N900 device environment. You can test applications in conditions practically identical to running the application on a Nokia N900 device with the software update release 1.3 (V20.2010.36-2).

The Harmattan emulator emulates the Nokia N9 device environment.

With the emulators, you can test how your application reacts to hardware controls, such as the power button, and to the touch screen. Usually, it is faster to test on a real device connected to the development PC than to use the emulators.

Deploying

Qt Creator deploy configurations handle the packaging of the application as an executable and copying it to a location developers want to run the executable at. The files can be copied to a location in the file system of the development PC or to a mobile device.

Qt Creator allows you to create installation packages for Symbian, Maemo, and MeeGo Harmattan devices that are suitable for publishing on Ovi Store and other channels.

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
  1. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 17
  4. RIM : « 13 % des développeurs ont gagné plus de 100 000 $ sur l'AppWord », Qt et open-source au menu du BlackBerry DevCon Europe 0
  5. 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
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
Page suivante

Le Qt Labs au hasard

Logo

QMake et au-delà

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. 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