PDA

View Full Version : Qwebview <img> javascript replacement question



budda
29th August 2012, 22:35
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
defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, true);

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...)

budda
10th September 2012, 02:00
so I guess my question is: is there an actual width and height limit for an animated .gif in Qt webview?