diff options
author | Kavindra Devi Palaraja <kavindra.palaraja@nokia.com> | 2009-06-02 17:42:27 +0200 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2009-06-03 12:10:01 +0200 |
commit | 0b90329427742da68d33a403afc62d40932f4702 (patch) | |
tree | c1cd89fb1f0f4032d7ca935e78ac0097dfb04053 /doc/addressbook-sdk.qdoc | |
parent | de8dcb7b23b83c650a7aef78dfef62e980883e9e (diff) | |
download | qt-creator-0b90329427742da68d33a403afc62d40932f4702.tar.gz |
Fixes: Doc - more of the tutorial
RevBy: TrustMe
Diffstat (limited to 'doc/addressbook-sdk.qdoc')
-rw-r--r-- | doc/addressbook-sdk.qdoc | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/doc/addressbook-sdk.qdoc b/doc/addressbook-sdk.qdoc index c60ad27ee0..6aeff092a6 100644 --- a/doc/addressbook-sdk.qdoc +++ b/doc/addressbook-sdk.qdoc @@ -269,7 +269,6 @@ \section1 Placing Widgets on the Form - Now that we have the labels and input fields set up, we add push buttons to complete the process of adding a contact. So, we begin by breaking the existing layouts. Then, we add three push buttons. Double-click on each of @@ -292,6 +291,34 @@ on the widget and selecting \gui{Lay out Horizontally} or \gui{Lay out Vertically}. + The final design of the form is shown in the screenshot below: + + ## image + + + \section1 The AddressBook Class + + To ensure that the Address Book reacts to user interaction, we need to + write slots for each push button that we added earlier. A slot is a + function that responds to a particular signal. We will discuss this + concept in further detail below. However, for an overview of Qt's signals + and slots concept, you can refer to the \l{Signals and Slots} document. + + In the \l{examples/addressbook-sdk/part2/addressbook.h}{\c addressbook.h} + file, we add the following code: + + \snippet examples/addressbook-sdk/part2/addressbook.h slot definition + + Next, we have to provide private members for the \c AddressBook class so + that we can access these members freely throughout the application. + + \note The names, e.g., \c addButton etc., correspond to the name of the + actual object. You can modify them by double-clicking on their names within + \QD's \gui{Object Inspector}. + We need a container to store our address book contacts, so that we can + traverse and display them. A QMap object, \c contacts, is used for this + purpose as it holds a key-value pair: the contact's name as the \e key, and + the contact's address as the \e value. */ |