View Full Version : Ideas for implementation of a little mouse window

23rd October 2009, 18:10
I want to know your thoughts/ideas on how I can implement this:
I have a QGraphicsView/Scene project for designing.
I want to implement a little window following the mouse and showing/prompting for input from the user.
Look at the example in an autocad 8 environment:
A little box saying "Specify Oposite Corner:" is following the mouse giving info and wanting input from the user.

I first thought to implement a QWidget with my litle dialog (QLabels, and QLineInputs) and use QGraphicsProxyWidget ... but this doesn't work well because the QWidget follows View scale,size. I want to remain the same size despite panning/zooming on the view.

Any ideas?

24th October 2009, 08:20
Maybe I could use drawForeGround() and my mousebox will be drawen by hand by simple painter elements without the use of a qwidget?

Better ideas?

25th October 2009, 17:36
Anyway, I had no answer to this post, so I chose an implementation myshelf.

I used paintEvent of my QGraphicsView to paint over the QGV and it works great.

I have to think now a way to use lineinput inside this QWidget overlay to key input one value.
Maybe QLineInput over the widget or full new implementation of an input in the overlaying widget If I not make it.

Here is the screenshot of what I made: