[Qt-interest] Book: C++ GUI Programming with Qt 4 (2nd ed.) online+free+legal
Mark Summerfield
list at qtrac.plus.com
Mon Nov 16 09:03:55 CET 2009
On 2009-11-14, Johannes Kleimola wrote:
> >Hi, The book "C++ GUI Programming with Qt 4 (Second Edition)" by
>
> Jasmin Blanchette and Mark Summerfield is now available online in HTML
> format.
>
> Very kind of you, thank you. Though, I bought the book as well, since
> it's nice to have it around where internet isn't (if you find such a
> place).
I much prefer physical books...
> Anyway, I'm a newbie with Qt and still learning, but did I miss
> something or is there a small error on page 211, regarding member
> function void DiagramWindow::updateActions() ? I had to add
>
> bool isLink = (selectedLink() != 0);
That line is already in there and I can't see that moving it can make
any difference.
> to the top and change propertiesAction to
> propertiesAction->setEnabled(isNode | isLink);
> to make it work as expected.
Again, this line is already there. But using | can't be right since
isNode and isLink are bools so doing bitwise-OR will work only by luck
(or is that a typo and you meant || ?).
However, the code as it stands does not produce a context menu for
links, only for nodes. (You can access link properties for a selected
link via the menu.) This is a known issue and in our notes for fixing in
a future edition.
> Is there an errata somewhere?
Not at the moment.
> And Qt 4.6 seems to have dropped the default flag
> 'ItemSendsGeometryChanges' for performance reasons, but that is another
> story..
Yes, I can see that we rely on that flag and without it the example
doesn't work properly. I'm actually quite surprised at such a backward-
incompatible change being made. But in any case we'll have to wait for
4.6.0-final to be sure:-)
> There are probably other changes from Qt 4.3 as well I haven't
> met yet.
Well I'm programming in C++/Qt every day (4.5 and 4.6-tp1) and the only
thing I've particularly noticed is that graphics/view stuff is a lot
faster in 4.6-tp1. I haven't hit any compatibility problems (apart from
the ItemSendsGeometryChanges that you discovered), but I'm sure people
on this list will notice & mention them:-)
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
"Advanced Qt Programming" - ISBN 0321635906
More information about the Qt-interest-old
mailing list