Results 1 to 5 of 5

Thread: Use QImage/QPixmap as source for HTML img elements in QWebEngine

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Use QImage/QPixmap as source for HTML img elements in QWebEngine

    Thanks for the reply.

    I forgot to say that my main html-document is loaded from qrc which seems to be what is blocking the access to the local filesystem.

    I guess I'm forced to load my html from the filesystem then, or what?

    Cheers

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Use QImage/QPixmap as source for HTML img elements in QWebEngine

    Quote Originally Posted by Jakob View Post
    I forgot to say that my main html-document is loaded from qrc which seems to be what is blocking the access to the local filesystem.
    No, you already said that.

    Quote Originally Posted by Jakob View Post
    I guess I'm forced to load my html from the filesystem then, or what?
    See my other comment.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2015
    Posts
    3
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Use QImage/QPixmap as source for HTML img elements in QWebEngine

    ok, well then using the QWebEngineSettings::LocalContentCanAccessFileUrls attribute was not enough. Actually it seems be enough to extract the main html file to a local tempdir. I can still load other resources via qrc afterwards.

    I think it would be nice if it was possible to extend and reduce the resource dictionary runtime so you could access bytearrays using :/ and qrc:/.

    Ie:
    * QResource::addData(const QString &path, const QByteArray &data);
    * QResource::removeData(const QString &path);

    Cheers Jakob

Similar Threads

  1. Replies: 2
    Last Post: 18th September 2015, 08:40
  2. Hot do I get HTML source from a web page?
    By earendil in forum Newbie
    Replies: 9
    Last Post: 16th March 2012, 15:15
  3. Replies: 4
    Last Post: 13th February 2012, 18:09
  4. How to make custom menu for QWebView html elements ?
    By rsilva in forum Qt Programming
    Replies: 0
    Last Post: 10th May 2011, 00:18
  5. What's faster: QPixmap-to-QImage or QImage-to-QPixmap
    By forrestfsu in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2006, 17:11

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