Sie sind auf Seite 1von 6

APRESS.

COM : Foundations of Qt� Development : 9781590598313 8/10/10 8:18 AM

Home
Books
eBookshop
Community
About Apress
Support

Member Login Search

eBook Catalog
firstPress
Alpha Program
Promotions
eBook Licensing
FAQ

Book Details

By Johan Thelin
ISBN13: 978-1-59059-831-3
ISBN10: 1-59059-831-8
528 pp.
Published Aug 2007
Print Book Price: $54.99
eBook Price: $38.49

Buy eBook

Buy Print Book

Book Resources

http://apress.com/book/errata/686 Page 1 of 6
APRESS.COM : Foundations of Qt� Development : 9781590598313 8/10/10 8:18 AM

Table of Contents
Source Code
Ch. 08 - Files, Streams, and XML
Submit/View Errata

My eBook

My Account
Download eBook(s)

Home Book Catalog Foundations of Qt� Development Errata

Errata Submission
If you think that you've found an error in Foundations of Qt� Development, please let us know about it.
You will find any confirmed erratum below, so you can check if your concern has already been addressed.

Submit Errata
Your Name: (optional)

Your Email: (optional)

Book Title:
Foundations of Qt� Development (978-1-59059-831-3)
Error: (Please include chapter number, page number, and a brief description of the issue you've
encountered.)

To prove you are an actual person, and not an automated script, please provide the solution to this
simple arithmetic problem: 3 * 5 = ?

Submit Errata

Errata
Issue Author's Response
Chapter 4 You are right, the
Pages 96,97 QString("%1[*] -
%2") should read
In the book doesn't appear the tr( tr("%1[*] - %2").
This applies to the
SdiWindow::SdiWindow( QWidget *parent ) : QMainWindow( parent ) text at the bottom of

http://apress.com/book/errata/686 Page 2 of 6
APRESS.COM : Foundations of Qt� Development : 9781590598313 8/10/10 8:18 AM

{ page 97 as well.
setAttribute( Qt::WA_DeleteOnClose );
setWindowTitle( tr("%1[*] - %2" ).arg(tr("unnamed")).arg(tr("SDI")) );

docWidget = new QTextEdit( this );


setCentralWidget( docWidget );

connect( docWidget->document(), SIGNAL(modificationChanged(bool)), this,


SLOT(setWindowModified(bool)) );

createActions();
createMenus();
createToolbars();
statusBar()->showMessage( tr("Done") );
}
I was trying out the editdelegate example from chapter I would recommend
five, but whenever I double click a bar to edit it I geta text typing with a number trying a later version
and not a slider as the example suggests. As far as I can see the of Qt.
BarDelegate::createEditor
method is never called. Any clues as to why I am using Qt version 4.2.1
Chapter #2, page #51: Trimmed does no
change the string
EditDialog dlg( this ); (parts[n]), it returns
dlg.setName( parts[0].trimmed() ); the changed string.
dlg.setNumber( parts[1].trimmed() ); You can see this
from the function
The code above does not work because [I guess] parts[0] and parts[1] return a definition QString
const (!) QString which cannot be modified with trimmed(). trimmed() const; (the
const part tells you
I fixed this in my code by replacing the 3 lines above with the following: that it does not affect
the QString it is
QStringList parts = ui.list->currentItem()->text().split("--"); called from/on).
QString _name = parts[0];
QString _number = parts[0]; Conclusion: there is
EditDialog dlg(this); no need to update
dlg.setName(_name.trimmed()); the code as you
dlg.setNumber(_number.trimmed()); have.

Now, I have code completion for "_name."... (using QtCreator Beta 1 - from
December 18, 2008).
I think that there is an error on page 27 in the last 5 lines. If the ".value" method The value method
is recommended due to not filling up the memory, then why does it also say that and [] operator have
the [] operator prevent the map from creating a new item? been mixed up. Use
the value method to
Also the swedish word "ingenting" is used. It is probably better with the word avoid creating new
"nothing", as this book is in english. items.

http://apress.com/book/errata/686 Page 3 of 6
APRESS.COM : Foundations of Qt� Development : 9781590598313 8/10/10 8:18 AM

Chapter: Apendix B: Containers, Types, and Macros Correct


Page: 512

In the last sentence reads. "The foreach macro is available as Q_FOREVER." It


should read, "The forever macro is available as Q_FOREVER."
Chapter 2, Page 50-51, listings 2-4 and 2-6 The correct enums
are
Qt::Accept is referenced in the code (in the conditionals near the ends of the QDialog::Accepted
functions). When compilation is attempted on the code as presented in the book, and
this causes an error ("Accepted is not a member of Qt"). QDialog::Rejected.

Compilation of book code was successful.

A diff between the files shows that the only differences are my comments and
the fact that in the code downloaded from this site, Qt::Accepted is simply
Accepted.

The bug, apparently, is that Accepted isn't in the Qt namespace; it's somewhere
else. You simply need to drop "Qt::" from the references to Accepted and it'll
work fine.
Ch3, Pg87-88 Listing 3.22 does not include the code segment being explained.
Please download the
source code package
Ch3, Pg92 Listing 3.25 does not include the code segment being explained. for the book to get
the needed source
code.
Chapter 2 Begin The correct enums
=========================================================\ are
------------------------------------ QDialog::Accepted
Errata: and
Qt::Accepted page 50, 51, 52 QDialog::Rejected.

Corrige:
Accepted
------------------------------------
Errata:
Qt::Rejected page 50, 52

Corrige:
Rejected
------------------------------------
Reference: Qt 4.4.0, QDialog Class Reference
[QtGui module]
The QDialog class is the base class of dialog windows. More...
#include <QDialog>
Inherits QWidget.
.....

http://apress.com/book/errata/686 Page 4 of 6
APRESS.COM : Foundations of Qt� Development : 9781590598313 8/10/10 8:18 AM

Public Types
enum DialogCode { Accepted, Rejected }
.....
Member Type Documentation
enum QDialog::DialogCode
The value returned by a modal dialog.
------------------------------------
Constant Value
QDialog::Accepted 1
QDialog::Rejected 0

Chapter 2 End
==========================================================/
Chapter 1, page 12. The tip says that Windows users need to add the line Are you sure that
CONFIG += console to get a console output from the qDebug object but this you have written
doesn't work. I even downloaded the source code from the book website and "+=" and not only
though it compiles fine there is no output on Windows XP with Qt 4.4. The "=" when assigning
correction to this problem is to add the line CONFIG += qt. This makes the CONFIG
everything work like it was supposed to. variable. Also,
debugging output is
muted when you
build a release
version. Make sure
to build your
debugging libraries
(you can do that
from the start menu)
if you use the Open
Source edition of Qt
under Windows.
In Chapter 15, on page 457, the section title "Managing a Simple Application Correct
with QMake", should read '...with CMake".
Chapter 4 Correct
Page 96
Listing 4-1

There should be a tr( ) call around the string "unnamed" in the lase code line on
the page. This is referenced on the second last line of page 97.
Chapter 3 Please download the
Page 92 source code
Listing 3-25 accompanying the
book to get the full
The code showing how to attach a QRegExpValidator to a QLineEdit is missing. source.
It is in the source code.
Chapter 3 Download the
Page 88 accompanying

http://apress.com/book/errata/686 Page 5 of 6
APRESS.COM : Foundations of Qt� Development : 9781590598313 8/10/10 8:18 AM

Listing 3-22 source code to get


the full source code.
The code showing how to attach validators to the QLineEdit widgets is missing.
It is in the source code, however.
Chapter 3 Correct
Page 74
Last paragraph
Second sentence

Reads: ...connected to each slider through...

Should read: ...connected to each progress bar through...


Chapter 2 The correct enum is
Page 50, 51 QDialog::Accepted.
Listing 2-4 and 2-6

You show the code item 'Qt::Accepted' but this does not work. Your source code
which does work just chows the item 'Accepted'.
Chapter 2, page 50: The correct enum is
QDialog::Accepted
The code examples and text talk about Qt::Accepted and Qt::Rejected; however, and
if you use Qt::Accepted it will generate errors when compiling(at least on my QDialog::Rejected.
openSUSE Linux). It should just be Accepted or Rejected, even your source
code has it this way.

Site Map | Privacy Policy | Contact Apress

http://apress.com/book/errata/686 Page 6 of 6

Das könnte Ihnen auch gefallen