PDA

View Full Version : Qt Designer How to make Button work with webwiev and a Label shows Mouse Position?



heavy.is.happy
6th July 2011, 19:17
Hi!
I have 2 problems. Im have made a tiny web browser with a button, lineEdit and a webwiev. Im also have a basic label who i want to show the mouse cursor position.

First one it's the button problem. I want to make so the webwiev choose a site after what URL their is inside in the lineEdit. First i press the button and make it clicked() then i drag the red cursor to the lineEdit and choose then slectAll(). Then after that i drag a line from lineEdit and choose returnPressed(), and the red line ends at the webwiev with show().

But it dosen't work for me. Whats the problem?

The second is that i want to make a label just show the mouse position. You know the X,Y axis?

// Heavy.is.Happy
Thanks :)

Santosh Reddy
7th July 2011, 05:01
First
Sorry, I don't understand you. Are you trying to animate things or trying to use Qt Designer :confused:

Sceond
You can install a event filter on QWebView, and get the mouse position from the mouse move event (QMouseEvent:: pos())

heavy.is.happy
7th July 2011, 19:49
First
Sorry, I don't understand you. Are you trying to animate things or trying to use Qt Designer :confused:

Sceond
You can install a event filter on QWebView, and get the mouse position from the mouse move event (QMouseEvent:: pos())

I mean this!
http://www.youtube.com/watch?v=JOuCuLHmk3o

heavy.is.happy
8th July 2011, 19:26
Why does this NOT working?

I want to change the text in the label to X and Y axis values. I have deleted all text in the label first.


label_2->setText(QCursor::pos());

My label has the name label_2