Results 1 to 4 of 4

Thread: How to make Button work with webwiev and a Label shows Mouse Position?

  1. #1
    Join Date
    Jul 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Smile How to make Button work with webwiev and a Label shows Mouse Position?

    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

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: How to make Button work with webwiev and a Label shows Mouse Position?

    First
    Sorry, I don't understand you. Are you trying to animate things or trying to use Qt Designer

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

  3. #3
    Join Date
    Jul 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to make Button work with webwiev and a Label shows Mouse Position?

    Quote Originally Posted by Santosh Reddy View Post
    First
    Sorry, I don't understand you. Are you trying to animate things or trying to use Qt Designer

    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

  4. #4
    Join Date
    Jul 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to make Button work with webwiev and a Label shows Mouse Position?

    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.

    Qt Code:
    1. label_2->setText(QCursor::pos());
    To copy to clipboard, switch view to plain text mode 

    My label has the name label_2

Similar Threads

  1. push button icon not shows???
    By chandantheracer in forum Newbie
    Replies: 2
    Last Post: 25th February 2011, 13:08
  2. How to make a label be on the background?
    By Bong.Da.City in forum Newbie
    Replies: 3
    Last Post: 6th September 2010, 12:37
  3. Replies: 6
    Last Post: 21st August 2010, 22:09
  4. how to get the position of mouse click on a label
    By qt_user in forum Qt Programming
    Replies: 1
    Last Post: 9th August 2010, 10:14
  5. Replies: 1
    Last Post: 2nd August 2010, 06:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.