Results 1 to 2 of 2

Thread: Qwebview <img> javascript replacement question

  1. #1
    Join Date
    Mar 2010
    Posts
    86
    Thanks
    11
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Qwebview <img> javascript replacement question

    Hi have a Win7 MingW Qt4.6.4 Build....
    Have made tons of Qt GUI Apps with it for a few years now.
    suddenly a new project with QWebview won't display animated .gif's
    I've never had this problem before, so I thought what the hell is different about this?
    Well to try and obscure the animated .gif from people nabbing it, I made the HTML image tag have a name & id attribute, set the first picture as a totally empty transparent png with the exact size as the animated gif.
    Then with a javascript function, I do a image replace with the animated gif. (the function is in a long and ridiculous script line. Then just to be thorough, I put another div with a higher z-index ontop of the original image with another transparent empty png.
    So, anyone right clicking on it and saving as, gets an empty .png, and then if they go through the HTML code and see the actual image and click on that, they get a second empy .png. If they are really that hard up, for the .gif, then they can sift through the javascript, but just to be a jerk, I named the image id/name 'if', so they can't even do a find or search on it very quickly.

    this works just great in any browser IE, Firefox, Chrome, Safari.... But the javascript isn't executing at all in a Qt app Qwebview. Even though I DO have
    Qt Code:
    1. defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
    To copy to clipboard, switch view to plain text mode 

    anyone have any ideas why it isn't executing the script in Qt?
    (other javascript functions work just fine for image replacement, but they are smaller buttons and what have you,
    the image in question is 960x240 pixel .gif...)
    Last edited by budda; 29th August 2012 at 22:05.

  2. #2
    Join Date
    Mar 2010
    Posts
    86
    Thanks
    11
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwebview <img> javascript replacement question

    so I guess my question is: is there an actual width and height limit for an animated .gif in Qt webview?

Similar Threads

  1. QWebview not showing images
    By manojmka in forum Qt Programming
    Replies: 27
    Last Post: 16th July 2012, 23:22
  2. QWebView progresive images
    By Talei in forum Qt Programming
    Replies: 0
    Last Post: 4th August 2011, 03:37
  3. Get images from a QWebView or QWebPage
    By redneon in forum Qt Programming
    Replies: 6
    Last Post: 21st January 2010, 09:03
  4. QWebView not displaying images
    By andyp in forum Qt Programming
    Replies: 7
    Last Post: 3rd December 2009, 21:35
  5. QWebView shows '?' instead of all images
    By doep in forum Qt Programming
    Replies: 2
    Last Post: 5th February 2009, 10:03

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.