Skip to content

Qt WebKit

Questions about Qt WebKit and related topics? Post here!
1.5k Topics 5.9k Posts
  • 0 Votes
    3 Posts
    3k Views
    M
    Thanks for the reply ThatDude. Does button.click() change i.e. adds/removes elements or it changes properties of existing elements? It adds elements to a static table element. It doesn't change the properties (that I'm aware of), but appends to it. you should try to find these web elements starting from webView->page()->mainFrame()->documentElement() again I tried doing that. During debugging I saw that the javascript is not evaluated immediately upon returning to the main loop. Instead, the slot corresponding to the signal I emitted is called immediately and the javascript is not called until sendpostedevents() is reached in the stack. I ended up finding a workaround by not calling the javascript and loading the html I found in the jQuery arguments, but I'm still curious as to how I COULD have reloaded the DOM. It seems that just doing the same @QWebFrame *frame = webView->page()->mainFrame(); QWebElement document = frame->documentElement();@ after the javascript call might work, but I think I would have to add a slot for some signal that told me that the javascript result had been returned. Otherwise the DOM is reloaded before the javascript is even executed.
  • Convert YouTube (Flash) video frames to QImage problems

    3
    0 Votes
    3 Posts
    2k Views
    P
    Making some progress. The problem appears to be a combination of a sync problem and render problem. A more efficient way to get a QPixmap is to use either the static function QPixmap::grabWidget(QWidget*) or the static function QPixmap::grabWindow(WId). The grabWidget function has all the same problems as the QPage method outlined in the original post. The grabWindow function grabs screen pixels which isn't ideal but somewhat workable provided that the YouTube video is visible. Therein lies another problem. In order to use the grabWindow method one has to wait until the YouTube player has displayed the video which takes some time. On my system it takes as long as 10 seconds provided that the internet connect is viable. Therefore one would like to have a signal when the display is visible. At first glance it appears that the YouTube player api could provide this information. Using the api player reference ("https://developers.google.com/youtube/js_api_reference":https://developers.google.com/youtube/js_api_reference) it appeared to be straightforward by using the QtWebKit bridge. The YouTube player has a user defined JavaScript callback function onYouTubePlayerReady(playerid) which can be used to connect to C++ function that can then use the grabWindow method to save an image. The problem is that the YouTube player doesn't call the callback function when I'm using QWebView to display the YouTube video. At this point I'm stumped. I don't know if the reason the player doesn't call the callback function is because of a security problem or something stupid that I've done. For reference here is the html I'm currently using (just the latest in many variations I've tried): @<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>test</title> </head> <body > <object id="objid" width="420" height="315"> <param id="paramid" name="movie" value="http://www.youtube.com/v/fwbH8dgASRc?enablejsapi=1&playapiid=player1&version=3&hl=en_US&rel=0"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed id="embid" src="http://www.youtube.com/v/fwbH8dgASRc?enablejsapi=1&playapiid=player2&version=3&hl=en_US&rel=0" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed> </object> </body> </html>@ (modified from the suggested code on the YouTube site to include playerid and enablejsapi). So the original post has morphed into the following two questions: How can one detect that the YouTube player has cued the video for play since neither of the JavaScript methods onYouTubePlaterReader or onStateChange seem to work with QWebView? Is it possible to somehow grab the video display without making the QWebView object visible?
  • CSS3 Multiple columns

    2
    0 Votes
    2 Posts
    1k Views
    J
    This seems to be only printing problem. QWebView shows it properly but only a one column is printed. "Here is the bug report":https://bugreports.qt-project.org/browse/QTBUG-40050
  • How can I prevent loading NPAPI plug-in?

    1
    0 Votes
    1 Posts
    704 Views
    No one has replied
  • Upgrading WebKit Engine w/o upgrading Qt

    2
    0 Votes
    2 Posts
    882 Views
    McLionM
    No one an idea :(
  • How to disable painting?

    4
    0 Votes
    4 Posts
    1k Views
    B
    Any solution?
  • Print HTML content

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    1 Posts
    838 Views
    No one has replied
  • Intermittent crash when webkit renders svg

    1
    0 Votes
    1 Posts
    954 Views
    No one has replied
  • C++ Slot Called by Javascript Throws Exception

    1
    0 Votes
    1 Posts
    646 Views
    No one has replied
  • App crashes in libQtWebkit.so.4.10.2

    1
    0 Votes
    1 Posts
    932 Views
    No one has replied
  • Websocket network error: The certificate is self-signed, and untrusted

    2
    0 Votes
    2 Posts
    4k Views
    A
    Hi, I have the same problem by testing wss on a server with a self signed certificate. It seems to be a "problem"/old bug in Webkit. Old (2010) discussion on bugs.webkit.org (bug still in NEW) : "here":https://bugs.webkit.org/show_bug.cgi?id=41419 A similar discussion on old chromium with webkit (in WONTFIX): "here":https://code.google.com/p/chromium/issues/detail?id=146848 Seems to be we should: force a "valid certificate" switch to ws: if not working in wss: Pascal
  • [SOLVED] Google Maps API not showing Satellite Images under Windows 8.1

    4
    0 Votes
    4 Posts
    4k Views
    K
    I've got this sorted! I just needed the Qt/mingw482_32/plugins/imageformats folder in my distribution, containing qjpeg.dll. So it was indeed loading them, but had no way to decode them. All is well now and I hope this is helpful to someone else.
  • The font set by QWebSetting look smaller

    3
    0 Votes
    3 Posts
    1k Views
    W
    the problem has resolved . <body style=’"font-family:‘simsun’;font-size:12pt;color:#000000 ;"’> ddddd </body> the style code is wrong : <body style=’font-family:‘simsun’;font-size:12pt;color:#000000 ;’> ddddd </body>
  • WebView (QtWebKit 3.0): unresponsive UI and weird button style

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • QtWebKit 5 font rendering problem

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED] QWebSettings::AutoLoadImages decision making

    3
    0 Votes
    3 Posts
    2k Views
    S
    qtwebkit/Source/WebCore/loader/ImageLoader.cpp::ImageLoader::updateFromElement is the function I traced this to. Working through it and document->cachedResourceLoader()->autoLoadImages() was the proper path to segmenting the image selection. I don't have a clean solution/patch right now, since my goal was to have autoLoadImages() <- false ; to only block JPG/JPEGs. However, with this information, extending it should be far easier.
  • [SOLVED] Qt5.2.1+EGLFS / WebKit2 running on i.MX6q ?

    6
    0 Votes
    6 Posts
    2k Views
    S
    Thanks. I shall update my sources. BR, Stavros.
  • QGraphicsWebView injecting script does not work

    2
    0 Votes
    2 Posts
    991 Views
    E
    Update: after some more testing, I found that QGraphicsWebView's loadFinished signal does not get sent until after window.onload has completed. QWebFrame's initialLayoutCompleted signal gets sent after window.onload, but seems to run concurrently with it, not waiting for it to finish.
  • WebKitBridge, how to have Qt draw onto an existing HTML5 canvas element?

    1
    0 Votes
    1 Posts
    926 Views
    No one has replied