1
1
/****************************************************************************
3
3
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4
** All rights reserved.
4
5
** Contact: Nokia Corporation (qt-info@nokia.com)
6
7
** This file is part of the documentation of the Qt Toolkit.
8
9
** $QT_BEGIN_LICENSE:LGPL$
10
** Licensees holding valid Qt Commercial licenses may use this file in
11
** accordance with the Qt Commercial License Agreement provided with the
12
** Software or, alternatively, in accordance with the terms contained in
13
** a written agreement between you and Nokia.
10
** No Commercial Usage
11
** This file contains pre-release code and may not be distributed.
12
** You may use this file in accordance with the terms and conditions
13
** contained in the Technology Preview License Agreement accompanying
15
16
** GNU Lesser General Public License Usage
16
17
** Alternatively, this file may be used under the terms of the GNU Lesser
20
21
** ensure the GNU Lesser General Public License version 2.1 requirements
21
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23
** In addition, as a special exception, Nokia gives you certain
24
** additional rights. These rights are described in the Nokia Qt LGPL
25
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
28
** GNU General Public License Usage
29
** Alternatively, this file may be used under the terms of the GNU
30
** General Public License version 3.0 as published by the Free Software
31
** Foundation and appearing in the file LICENSE.GPL included in the
32
** packaging of this file. Please review the following information to
33
** ensure the GNU General Public License version 3.0 requirements will be
34
** met: http://www.gnu.org/copyleft/gpl.html.
36
** If you are unsure which license is appropriate for your use, please
37
** contact the sales department at http://www.qtsoftware.com/contact.
24
** In addition, as a special exception, Nokia gives you certain additional
25
** rights. These rights are described in the Nokia Qt LGPL Exception
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
** If you have questions regarding the use of this file, please contact
29
** Nokia at qt-info@nokia.com.
38
38
** $QT_END_LICENSE$
40
40
****************************************************************************/
43
43
\page tutorials-addressbook-fr.html
45
45
\startpage {index.html}{Qt Reference Documentation}
46
\contentspage Tutorials
46
47
\nextpage {tutorials/addressbook-fr/part1}{Chapitre 1}
48
49
\title Tutoriel "Carnet d'adresses"
51
50
\brief Une introduction � la programation d'interface graphique montrant comment construire une application simple avec Qt.
53
52
Ce tutoriel est une introduction � la programmation de GUI (interface utilisateur)
220
219
On remarque que le label \c AddressLabel est positionn� en utilisant Qt::AlignTop
221
220
comme argument optionnel. Ceci est destin� � assurer qu'il ne sera pas centr�
222
221
verticalement dans la cellule (1,0). Pour un aper�u rapide des layouts de Qt,
223
consultez la section \l{Layout Classes}.
222
consultez la section \l{Layout Management}.
225
224
Afin d'installer l'objet layout dans un widget, il faut appeler la m�thode
226
225
\l{QWidget::setLayout()}{setLayout()} du widget en question:
240
239
\snippet tutorials/addressbook/part1/main.cpp main function
242
On construit un nouveau widget \c AddressBook sur le tas en utilisant le mot-cl�
243
\c new et en invoquant sa m�thode \l{QWidget::show()}{show()} pour l'afficher.
241
On construit un nouveau widget \c AddressBook sur la pile et on invoque
242
sa m�thode \l{QWidget::show()}{show()} pour l'afficher.
244
243
Cependant, le widget ne sera pas visible tant que la boucle d'�v�nements
245
244
n'aura pas �t� lanc�e. On d�marre la boucle d'�v�nements en appelant la
246
245
m�thode \l{QApplication::}{exec()} de l'application; le r�sultat renvoy�
247
246
par cette m�thode est lui m�me utilis� comme valeur de retour pour la m�thode
248
On comprend maintenant pourquoi \c AddressBook a �t� cr�� sur la pile: � la fin
249
du programme, l'objet sort du scope de la fonction \c main() et tous ses widgets enfants
250
sont supprim�s, assurant ainsi qu'il n'y aura pas de fuites de m�moire.