I have some questions I collected when I was offline and doing the Qt tutorials. Please read patiently and answer. Thank you very much.
1. Is there any effective practical difference between presence and absence of setFocusProxy in lcdrange.cpp of tutorial 08? I tried doing without it and did not see any change.
2. In tut 08 it says:
"It is important to only emit the angleChanged() signal when the angle really has changed."
Why? is it just good programming practice leading to efficiency or what?
3. In tut 09 line 56 we have:
painter.translate(0, rect().height());
painter.translate(0, rect().height());
To copy to clipboard, switch view to plain text mode
But in tut 10 line 68:
painter.translate(0, height());
painter.translate(0, height());
To copy to clipboard, switch view to plain text mode
The rect() is unnecessary, right? Shouldn't it cause any inefficiency? I found that after compiling there is no difference even in the binaries!
4. In tut 10 we have:
include <QPaintEvent>
include <QPaintEvent>
To copy to clipboard, switch view to plain text mode
whereas in 09 we do not. Is there not a difference?
5. What are the historical reasons mentioned in the QRect class reference of bottomLeft() and bottomRight() ?
6. In tut 10 what is the effective difference between update() and update(cannonRect())? I see no problem with just update(). Then the cannonRect function is unnecessary.
7. In tut 08 cannonfield.cpp line 49 why is "event" within /**/ ?
8. In tut 08, I used:
connect ( angle, SIGNAL ( valueChange ( int ) ), cannonField, SLOT ( setAngle ( int ) ) ) ;
connect ( angle, SIGNAL ( valueChange ( int ) ), cannonField, SLOT ( setAngle ( int ) ) ) ;
To copy to clipboard, switch view to plain text mode
instead of
connect ( angle, SIGNAL ( valueChanged ( int ) ), cannonField, SLOT ( setAngle ( int ) ) ) ;
connect ( angle, SIGNAL ( valueChanged ( int ) ), cannonField, SLOT ( setAngle ( int ) ) ) ;
To copy to clipboard, switch view to plain text mode
but got no compile-time error saying that there is no such signal called "valueChange ( int )". How come?
Thanks for your patience.
Bookmarks