Results 1 to 6 of 6

Thread: Inserting a link in webkit

  1. #1
    Join Date
    Apr 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Inserting a link in webkit

    I'm building a basic editor widget using Webkit. The Qt bindings expose a large selection of editing actions through QWebPage::WebAction, but these don't include an action to create a link (<a href="whatever...">...</a>). However, I've found:

    /qt/src/3rdparty/webkit/WebCore/editing/CreateLinkCommand.h

    which seems to suggest that the underlying functionality is there in webkit, but I don't know how to make use of it. Does anyone have any suggestions or code examples showing how to do this?

    Thanks,
    Martin

  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: Inserting a link in webkit

    You can modify the web page contents through QWebElement API.
    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
    Apr 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Inserting a link in webkit

    Do you know how I get access to the QWebElement(s) that contain the selection?

  4. #4
    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: Inserting a link in webkit

    No, I don't. Look it up in the docs.
    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.


  5. #5
    Join Date
    Apr 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Inserting a link in webkit

    I wouldn't post here if I hadn't already spent a lot of time with the docs. I don't see that there's any way to get access to the QWebElement(s) over which the selection ranges.

  6. #6
    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: Inserting a link in webkit

    Maybe not directly. You probably have to go through QWebHitTestResult or similar so it boils down to checking in QtWebKit source code how to determine where the selection is. Maybe in the process you'll find an easier way of determining selection elements.
    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.


Similar Threads

  1. Replies: 11
    Last Post: 5th May 2011, 14:05
  2. Replies: 3
    Last Post: 1st April 2011, 14:02
  3. Static Qt+Webkit 4.6.2 Link Errors
    By geekox86 in forum Installation and Deployment
    Replies: 3
    Last Post: 20th June 2010, 05:06
  4. How to open download link with WebKit
    By myrky in forum Newbie
    Replies: 1
    Last Post: 9th July 2009, 07:11
  5. Replies: 0
    Last Post: 29th May 2009, 13: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.