Results 1 to 2 of 2

Thread: How To Use mousePressEvent to get the click position on QWebFrame or QWebView ?

  1. #1
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question How To Use mousePressEvent to get the click position on QWebFrame or QWebView ?

    Hi all

    I am quite new to QT and I want to get the mouse position when clicked on a web page. As far as I know there is a mousePressEvent function that can be used through the QWebView widgent. What I have done so fare is as follow
    Qt Code:
    1. // I have set a page to the webview
    2. webView->setUrl(QUrl::fromLocalFile(fileName));
    3. QWebFrame* pFrame = webView->page()->mainFrame();
    4. QWebElement document = pFrame->documentElement();
    5. webView->mousePressEvent(QMouseEvent *e);
    6. qDebug()<<(e->pos());
    To copy to clipboard, switch view to plain text mode 

    Obviously this does not work. So can anyone help me please how to make this work?

    Thanks in advance

  2. #2
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How To Use mousePressEvent to get the click position on QWebFrame or QWebView ?

    well, Since no one has replayed yet. I want to declare my question?
    I noticed I can use eventFilter function to filter events
    my question is:
    does this function work with QWebFrame ??

Similar Threads

  1. QWebView / QWebFrame create and edit content
    By Margit in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2010, 19:06
  2. Get mouse position on click?
    By N3wb in forum Qt Programming
    Replies: 2
    Last Post: 21st August 2010, 23:33
  3. Replies: 2
    Last Post: 16th June 2010, 15:42
  4. qwebframe - scrolling to a specific position
    By boast in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2010, 02:20
  5. Right-click menu position
    By thuswa in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2009, 22:00

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.