Translate

Jump to: navigation, search
Settings

Information about the group Translation of the wiki page Development/Tutorials/Using Qt Creator.
Development/Tutorials/Using Qt CreatorCurrent message text
...Qt Creator/Page display title/frDéveloppement/Tutoriels/Utiliser Qt Creator
.../Tutorials/Using Qt Creator/1/fr__TOC__
.../Tutorials/Using Qt Creator/2/frQt creator est un IDE développé par Nokia pour Qt. Il contient Qt designer pour le design d'Interfaces Utilisateur. Cet article décrit :
* pourquoi utiliser Qt Creator
* comment créer une nouvelle application
* comment charger une application déjà existante
.../Tutorials/Using Qt Creator/3/fr== Pourquoi utiliser Qt Creator ==
.../Tutorials/Using Qt Creator/4/fr{|align="right" 
|[[image:Snapshot-qtcreator.png|right|thumb|200px|KDE4's ktimetracker loaded as QtCreator project]]
|}
Pour créer votre application C++ vous pourriez utiliser n'importe quel éditeur de texte. Mais les possibilités de Qt Creator vont grandement vous faciliter la vie. Par exemple
* vous pouvez charger un code sauvegardé, compiler et executer en un clic
* vous aurez la completion de code
* vous pouvez retrouver tous les endroits dans votre code ou vous appelez une fonction (e.g. "où est-ce que j'appelle la fonction refresh()")
*vous pouvez retourner à une position de curseur plus récente avec votre éditeur, même dans un autre fichier
* vous pouez checkout et commit vers des dépots Subversion or Git sans même quitter votre environnement
.../Tutorials/Using Qt Creator/5/fr== Créer un nouveau programme ==
.../Tutorials/Using Qt Creator/6/frVoici un exemple simple de création d'un "Hello World".
Pour plus d'informations lire [http://qt.nokia.com/doc/designer-manual.html user documentation].
.../Tutorials/Using Qt Creator/7/fr;Étape 0:
Lancer QtCreator
<syntaxhighlight lang="bash">
qtcreator
</syntaxhighlight>
Puis sélectionnez Nouveau fichier ou projet -> Applications -> Application graphique Qt -> Nom = helloworld -> Suivant -> Suivant -> Terminer
.../Tutorials/Using Qt Creator/8/fr;Step 1:
Select Edit -> Forms -> mainwindow.ui. Add the widgets you want by drag-and-drop:
.../Tutorials/Using Qt Creator/9/fr[[File:Designer-step1.png|200px]]
...Tutorials/Using Qt Creator/10/fr;Step 2: 
Select the mainwindow. This is the one un-intuitive step. To lay out the objects in the mainwindow, you do not select the objects in the mainwindow, but the mainwindow itself.
...Tutorials/Using Qt Creator/11/fr[[File:Designer-step2.png|200px]]
...Tutorials/Using Qt Creator/12/fr;Step 3:
Select Form -> Lay Out in a <u>G</u>rid
...Tutorials/Using Qt Creator/13/fr[[File:Designer-step3.png|200px]]
...Tutorials/Using Qt Creator/14/fr;Résultat:
Vous obtenez un aspect convenable , et si vous redimensionnez la fenêtre, les widgets seront redimensionnés aussi.
...Tutorials/Using Qt Creator/15/fr[[File:Designer-result.png|200px]]
...Tutorials/Using Qt Creator/16/fr=== Utiliser les librairies KDE ===
...Tutorials/Using Qt Creator/17/frTo use KDE classes like KMessageBox, you need to tell QtCreator to use the KDE libraries when building. Go to your home directory, change into ''yourproject'' and modify ''yourproject.pro''. Add the line
<syntaxhighlight lang="make">
LIBS += -lkdeui
</syntaxhighlight>
Then you can start using KDE classes in your code.
...Tutorials/Using Qt Creator/18/fr=== Ajouter une barre d'outils ===
...Tutorials/Using Qt Creator/19/frTo add a toolbar, right-click on the UI and choose "Add Toolbar". Then you can set icons and text in your mainwindow's constructor with code like this:
<syntaxhighlight lang="cpp-qt">
ui->toolBar->addAction(QIcon("/usr/share/icons/oxygen/22x22/apps/ktip.png"),"hello world");
</syntaxhighlight>
[[Development/Tutorials/Using_Qt_Designer|More Info...]]
...Tutorials/Using Qt Creator/20/fr== Charger un projet existant ==
...Tutorials/Using Qt Creator/21/frThis describes how to use QtCreator to integrate existing KDE 4 applications. It has been tested with QtCreator 1.2.80 and SUSE Linux 11.1 but should work same or similar with every combination. As an example KDE application we use [http://userbase.kde.org/ktimetracker ktimetracker] from the kdepim module, other applications should work likewise.
...Tutorials/Using Qt Creator/22/frYou can either work with code on your disk or have QtCreator do the repository checkout.
...Tutorials/Using Qt Creator/23/fr=== Utiliser un code local ===
...Tutorials/Using Qt Creator/24/fr* import the CMakeLists.txt file (File -> Open -> kdepim/CMakeLists.txt)
* as build directory choose kdepim
* you will automatically come to a screen where you can run CMake
* continue with the step "Run cmake"
...Tutorials/Using Qt Creator/27/fr=== Utiliser QtCreator pour faire un checkout d'un dépôt Git ===
...Tutorials/Using Qt Creator/28/fr* choose File -> New File or Project -> Project from Version Control -> Git Repository Clone.
* enter a Git URL like git@git.kde.org:/kdepim
* accept kdepim as checkout directory
* type finish, see how the checkout starts
{{Note|1= If the checkout fails with the message "remote host hung up unexpectedly" do a checkout from konsole. You may have to accept git.kde.org's fingerprint.}}
* you will automatically come to a screen where you can run CMake
* continue with the step "Run cmake"
...Tutorials/Using Qt Creator/25/fr=== Utiliser QtCreator pour faire un checkout d'un dépôt subversion ===
...Tutorials/Using Qt Creator/26/fr* choose File -> New File or Project -> Version Control -> Subversion Checkout.
* enter a Subversion URL like svn://anonsvn.kde.org/home/kde/trunk/KDE/kdepim
* enter a checkout directory, i.e. the local directory where the code will be checked-out to
* type finish, see how the checkout starts
* you will automatically come to a screen where you can run CMake
* continue with the step "Run cmake"
...Tutorials/Using Qt Creator/29/fr=== Lancer cmake ===
...Tutorials/Using Qt Creator/30/fr* enter arguments for CMake like 
<syntaxhighlight lang="bash">
/root/kdepim -DCMAKE_INSTALL_PREFIX=/usr/local -DLIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=debugfull
</syntaxhighlight>
<tt>DLIB_SUFFIX=64</tt> means that you want to install your libraries into directories named <tt>lib64</tt>, not <tt>lib</tt>. ''/root/kdepim'' is where your source code is.
* click "Run cmake"
* note: a .cbp file is created containing many information about the build
* click "Finish"
...Tutorials/Using Qt Creator/31/fr=== Build it ===
...Tutorials/Using Qt Creator/32/fr* configure QtCreator to build only ktimetracker:
Projects -> Active run configuration=ktimetracker -> build settings -> build steps -> make -> show details -> activate ktimetracker.
* configure QtCreator to use 8 logical processors:
Projects -> Active run configuration=ktimetracker -> build settings -> build steps -> make -> show details -> addtional Arguments = -j8
* choose Build -> Build All
...Tutorials/Using Qt Creator/33/fr== Voir aussi ==
...Tutorials/Using Qt Creator/34/fr* [[Development/Tutorials/Using Qt Designer]]
* [[Getting_Started/Using_an_IDE_with_KDE4#QtCreator]]
NavigationShowing 35 messages.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal