Results 1 to 4 of 4

Thread: capture web contents with the qt webkit?

  1. #1
    Join Date
    Aug 2006
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Red face capture web contents with the qt webkit?

    Hello guys,

    I want to implement a feature in my program that captures the HTML code under where my mouse clicked. for example, if i loaded a webpage, and then i click my mouse on a picture on that page, i can capture the HTML of that picture: <img src="..." />, and if i press on a video, i can get an <embed ...> tag.

    I'm just wondering if i can get this information from the webkit render. given a position on the rendered web page, can the webkit tell me which line of the HTML code was drawn at that place?

    I also want to know that if i specify one line of HTML of a web page, can webkits tell me where that line of HTML will be rendered? and what size it would be?

    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: capture web contents with the qt webkit?

    I don't think it is possible directly with WebKit. You'd have to inject some javascript code into WebKit (which is possible) but I don't know if Javascript let's you operate on the DOM tree in a geometrical fashion.

    Some things can be done by using QWebFrame::hitTestContent() but I don't see any way to retrieve information about what you actually clicked.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: capture web contents with the qt webkit?

    You can check this example on Qt labs. May be it helps you

  4. #4
    Join Date
    Aug 2006
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: capture web contents with the qt webkit?

    Quote Originally Posted by aamer4yu View Post
    You can check this example on Qt labs. May be it helps you
    thank you, but i guess, i have to look into the webkit feature to have this feature. the editor example is not what i want.

Similar Threads

  1. synchronise QLabel display and webcam capture
    By fbmfbm in forum Qt Programming
    Replies: 2
    Last Post: 24th February 2009, 11:10
  2. Complex button contents
    By spraff in forum Qt Programming
    Replies: 3
    Last Post: 11th November 2008, 15:17
  3. Where can I get basic WebKit software?
    By crazymoonboy in forum General Discussion
    Replies: 1
    Last Post: 4th September 2008, 14:15
  4. qt webkit
    By kernel_panic in forum Qt Programming
    Replies: 5
    Last Post: 4th November 2007, 20:03

Tags for this Thread

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.