Skip to content
Snippets Groups Projects
Commit 313cb44e authored by Kavindra Devi Palaraja's avatar Kavindra Devi Palaraja
Browse files

Fixes: Doc - more of the tutorial, part 2

RevBy:    TrustMe
parent f7afe3ee
No related branches found
No related tags found
No related merge requests found
......@@ -346,12 +346,22 @@
\snippet examples/addressbook-sdk/part2/addressbook.cpp signal slot
We connect the push buttons' \l{QAbstractButton::clicked()}{clicked()}
signal to their respective slots. The figure below illustrates this.
We connect the push buttons' \l{QAbstractButton::}{clicked()} signal to
their respective slots. The figure below illustrates this.
#image
Finally, we set the window title to "Simple Address Book" using the
\l{QWidget::}{setWindowTitle()} function.
\snippet examples/addressbook-sdk/part2/addressbook.cpp window title
\section2 The \c{addContact()} Function
In this function, we begin by storing the last displayed contact details
in \c oldName and \c oldAddress. Then we clear these input fields and turn
off the read-only mode. The focus is set on \c nameLine and we display
\c submitButton and \c cancelButton; but we disable \c addButton.
\snippet examples/addressbook-sdk/part2/addressbook.cpp addContact
*/
......@@ -36,7 +36,9 @@ AddressBook::AddressBook(QWidget *parent)
SLOT(cancel()));
//! [signal slot]
//! [window title]
setWindowTitle(tr("Simple Address Book"));
//! [window title]
}
AddressBook::~AddressBook()
......@@ -44,9 +46,24 @@ AddressBook::~AddressBook()
delete ui;
}
//! [addContact]
void AddressBook::addContact()
{
oldName = nameLine->text();
oldAddress = addressTExt->toPlainText();
nameLine->clear();
addressText->clear();
nameLine->setReadOnly(false);
nameLine->setFocus(Qt::OtherFocusReason);
addressText->setReadOnly(false);
addButton->setEnabled(false);
submitButton->show();
cancelButton->show();
}
//! [addContact]
void AddressBook::submitContact()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment