Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
313cb44e
Commit
313cb44e
authored
Jun 03, 2009
by
Kavindra Devi Palaraja
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes: Doc - more of the tutorial, part 2
RevBy: TrustMe
parent
f7afe3ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
doc/addressbook-sdk.qdoc
doc/addressbook-sdk.qdoc
+12
-2
doc/examples/addressbook-sdk/part2/addressbook.cpp
doc/examples/addressbook-sdk/part2/addressbook.cpp
+17
-0
No files found.
doc/addressbook-sdk.qdoc
View file @
313cb44e
...
...
@@ -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
*/
doc/examples/addressbook-sdk/part2/addressbook.cpp
View file @
313cb44e
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment