Results 1 to 2 of 2

Thread: Save stylesheet with QWebView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Save stylesheet with QWebView

    I have a application that uses QWebView and loads a stylesheet

    previewArea->settings()->setUserStyleSheetUrl(QUrl::fromLocalFile(":resour ces/my.css"));

    But when that app saves the file using previewArea->page()->mainFrame()->toHtml() the style sheet don't goes togheter, how i do to embbed my stylesheet when save the file ?

  2. #2
    Join Date
    Mar 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Save stylesheet with QWebView

    Found the solution

    previewArea->page()->mainFrame()->findFirstElement("html").appendInside("<style>" + css.readAll() + "</style>");

Similar Threads

  1. Qwebview Copy Text And Save Image
    By ShapeShiftme in forum Qt Programming
    Replies: 4
    Last Post: 11th August 2016, 06:30
  2. Replies: 8
    Last Post: 3rd September 2013, 09:51
  3. stylesheet
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2010, 07:45
  4. How to save a Qwebview as an html file
    By richardander in forum Qt Programming
    Replies: 2
    Last Post: 5th June 2009, 00:07
  5. How to do this with StyleSheet
    By yxmaomao in forum Qt Programming
    Replies: 5
    Last Post: 30th May 2008, 08:54

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
  •  
Qt is a trademark of The Qt Company.