Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
a5ad58de
Commit
a5ad58de
authored
15 years ago
by
Kavindra Devi Palaraja
Browse files
Options
Downloads
Patches
Plain Diff
Doc - fixing up Part 4 and some doc changes
RevBy: TrustMe
parent
ff5765bb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/addressbook-sdk.qdoc
+6
-0
6 additions, 0 deletions
doc/addressbook-sdk.qdoc
doc/examples/addressbook-sdk/part4/addressbook.cpp
+8
-22
8 additions, 22 deletions
doc/examples/addressbook-sdk/part4/addressbook.cpp
with
14 additions
and
22 deletions
doc/addressbook-sdk.qdoc
+
6
−
0
View file @
a5ad58de
...
...
@@ -696,6 +696,12 @@
in the same function, we avoid the possibility of the user interface
getting "out of sync" with the internal state of the application.
To maintain consistency, we need to modify our \c addContact() and
\c cancel() functions respectively. Below is the code:
\snippet examples/addressbook-sdk/part4/addressbook.cpp addContact
\dots
\snippet examples/addressbook-sdk/part4/addressbook.cpp cancel
*/
/*!
...
...
This diff is collapsed.
Click to expand it.
doc/examples/addressbook-sdk/part4/addressbook.cpp
+
8
−
22
View file @
a5ad58de
...
...
@@ -68,6 +68,7 @@ AddressBook::~AddressBook()
delete
ui
;
}
//! [addContact]
void
AddressBook
::
addContact
()
{
oldName
=
nameLine
->
text
();
...
...
@@ -76,16 +77,9 @@ void AddressBook::addContact()
nameLine
->
clear
();
addressText
->
clear
();
nameLine
->
setReadOnly
(
false
);
nameLine
->
setFocus
(
Qt
::
OtherFocusReason
);
addressText
->
setReadOnly
(
false
);
addButton
->
setEnabled
(
false
);
nextButton
->
setEnabled
(
false
);
previousButton
->
setEnabled
(
false
);
submitButton
->
show
();
cancelButton
->
show
();
updateInterface
(
AddingMode
);
}
//! [addContact]
//! [submitContact part1]
void
AddressBook
::
submitContact
()
...
...
@@ -130,28 +124,20 @@ void AddressBook::submitContact()
tr
(
"
\"
%1
\"
has been edited in your address book."
).
arg
(
name
));
contacts
[
name
]
=
address
;
}
updateInterface
(
NavigationMode
);
}
updateInterface
(
NavigationMode
);
}
//! [submitContact part3]
//! [cancel]
void
AddressBook
::
cancel
()
{
nameLine
->
setText
(
oldName
);
nameLine
->
setReadOnly
(
true
);
addressText
->
setText
(
oldAddress
);
addressText
->
setReadOnly
(
true
);
addButton
->
setEnabled
(
true
);
int
number
=
contacts
.
size
();
nextButton
->
setEnabled
(
number
>
1
);
previousButton
->
setEnabled
(
number
>
1
);
submitButton
->
hide
();
cancelButton
->
hide
();
updateInterface
(
NavigationMode
);
}
//! [cancel]
void
AddressBook
::
next
()
{
...
...
@@ -233,7 +219,7 @@ void AddressBook::updateInterface(Mode mode)
nameLine
->
setReadOnly
(
false
);
nameLine
->
setFocus
(
Qt
::
OtherFocusReason
);
addressT
E
xt
->
setReadOnly
(
false
);
addressT
e
xt
->
setReadOnly
(
false
);
addButton
->
setEnabled
(
false
);
editButton
->
setEnabled
(
false
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment