[Qt-interest] Qt/C++ working with graphicsview
Ross Driedger
ross at earz.ca
Sun Jan 24 18:34:48 CET 2010
On 24-Jan-10, at 11:32 AM, qt-interest-request at trolltech.com wrote:
> Message: 2
> Date: Sun, 24 Jan 2010 09:30:28 -0600
> From: "Stephen Deetz" <stephendeetz at chibardun.net>
> Subject: [Qt-interest] Qt/C++ working with graphicsview.
> To: <qt-interest at trolltech.com>
> Message-ID: <005a01ca9d0a$28b477b0$7a1d6710$@net>
> Content-Type: text/plain; charset="us-ascii"
>
> Trying to get used to Qt/C++ by working with graphicsview.
>
>
>
> Main question: How does a scene connect to an item for mouse events?
Until you fix the C++ issues, it is pointless to sweat the Qt details.
> Other questions:
>
> 1) Am I using the inherited stuff correctly?
No. There is no point in deriving a new class unless you add
something new to it. The coordinates are stored in the subclass.
> a. Calling the super classes.
No. Look up 'initiation lists' in a good C++ reference.
> b. Virtual keyword needed for subclass only if planning on making
> descendents?
No. Look up 'late binding' in a good C++ reference. I gather from
your terminology that you have some Java experience. Java does not
have this issue.
> 2) I think I know what bounding rect is, but why is it needed if
> shape is
> used for collisions?
??
I don't understand your question. I do some fairly intricate graphics
(music notation) and need to check for more than collisions
> 3) Qreal to int conversion. Is this a problem?
Everything to the right of the decimal will be lost. A good compiler
will warn you of this if you have the warnings on -- which you should.
Ross
"Sometimes I think the surest sign that intelligent life exists
elsewhere in the universe is that none of it has tried to contact us."
Bill Waterson (Calvin & Hobbes)
Ross Driedger
ross_at_earz.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100124/76eac789/attachment.html
More information about the Qt-interest-old
mailing list