[Qt-interest] Advice on QGraphicsScene, View, ...

Martin Hofius Martin at hofius-online.com
Mon Jul 12 14:18:35 CEST 2010


Hi Christian,

Am Montag, 12. Juli 2010 schrieb Christian Gagneraud:
> Hi all,
>
> I'm currently working on a kind of diagram editor. For now I'm
> focusing only on the basics: background, grid and zoom.
>
> What I would like to do is to add a "mouse position marker" which will
> snap on the grid, typically it should be made of one vertical line,
> spreading all the height of the display area and one horizontal line
> that spread all the width of the display area. But I don't want to
> replace the mouse cursor, which will still be used to reflect the
> current operating mode (selection, move, ...).
...
> 2 - The position marker moves only when the mouse move *and* a mouse
> button is pressed. What I would like to do is make the marker follow
> the mouse pointer, all the time, but I didn't find any MouseHover event.

maybe You are looking for:

void QWidget::grabMouse ()

and

void QWidget::releaseMouse ()

to get all mouse movement events. But be careful: You can block Your whole 
screen with this function...

Greetings
Martin



More information about the Qt-interest-old mailing list