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
313cb44e
Commit
313cb44e
authored
15 years ago
by
Kavindra Devi Palaraja
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/addressbook-sdk.qdoc
+12
-2
12 additions, 2 deletions
doc/addressbook-sdk.qdoc
doc/examples/addressbook-sdk/part2/addressbook.cpp
+17
-0
17 additions, 0 deletions
doc/examples/addressbook-sdk/part2/addressbook.cpp
with
29 additions
and
2 deletions
doc/addressbook-sdk.qdoc
+
12
−
2
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
*/
This diff is collapsed.
Click to expand it.
doc/examples/addressbook-sdk/part2/addressbook.cpp
+
17
−
0
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
()
{
...
...
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