qwebview

How to set cookie with QWebview in QML?

与世无争的帅哥 提交于 2019-12-06 13:00:53
问题 I am using QWebView in QML. I want to show web site that needs authentication. Data should be passed via standard cookie. Any help? Additional link or example would be great. Thank in advance. 回答1: By default, the default QNetworkAccessManager used by webkit have its own (non-persistent) cookie jar, aka QNetworkCookieJar. This will handle the sending and receiving of cookies during the life span of a QWebPage. To keep the same cookie jar across multiple pages, you have to: Create an instance

QWebView Auto Tabs

这一生的挚爱 提交于 2019-12-06 10:27:46
问题 I open a web page with QWebView.load(QUrl(myurl)) , the webpage gets some input and returns a new php generated page. If executed in Firefox the browser automatically opens a new tab/window to show the returned page. How to tell QWebView to open a new instance of QWebview with the returned data loaded? I was looking at at the QwebView documentation at www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwebview.html ... but no joy. Example of such a page : http://www.iqfront.com/index.php

QtWebKit playing HTML5 video without installing flash player

最后都变了- 提交于 2019-12-06 07:55:30
问题 With latest Flash player installed, and enable the Plugins, my simple example can play youtube videos OS: windows 7 Qt: 4.7.4 (both 32 & 64bit works) However, according to "http://www.youtube.com/html5", my example browser supports "Video tag" and "H.264", I was wondering why can't I just DISABLE the Plugins and play the video as usual? I have followed the procedure of " Watch a Video in YouTube's HTML5 Player" http://googlesystem.blogspot.com/2010/08/watch-video-in-youtubes-html5-player.html

Qt how to insert html into an editable QWebView at the cursor position?

帅比萌擦擦* 提交于 2019-12-06 07:31:07
I'm trying to use QWebView to implement a blog post editor. And I have some sample html snippets to insert into the editor by triggering menu actions. However, it's not convenient as QTextEdit to insert html. As for why I don't use QTextEdit , see my test code following: QTextEdit *edit = new QTextEdit; edit->insertHtml(tr("<div class=\"gci-hello\">Hello</div>")); qDebug() << edit->toHtml(); // --> the div tag disappeared So, if I use QWebView, the div tag will be reserved. But I can't find out how to insert my snippet at the cursor postion on the view. Use execCommand with InsertHTML :

Qt WebView - intercept loading of JS/CSS Libraries to load local ones

风格不统一 提交于 2019-12-06 00:54:29
问题 I've been looking for a while through documentation to find a way to accomplish this and haven't been successful yet. The basic idea is, that I have a piece of html that I load through Qt's webview. The same content can be exported to a single html file. This file uses Libraries such as Bootstrap and jQuery. Currently I load them through CDN which works when online just fine. However, my application also needs to run offline. So I'm looking for a way to intercept loading of the Libraries in

Crossplatform webview in Qt5.6

一笑奈何 提交于 2019-12-05 20:48:29
问题 I am using Qt 5.6 with MinGW on Windows 10 64x for developing a cross platform app (desktop + mobile). In Qt 5.5, I could use WebKit to make a cross platform app for showing web pages in my app, and I could use it on Windows, Android, iOs... Today, I realized we can't use it anymore, we can't use QtWebView neither for Windows and also can't use QtWebEngine with MinGW. Thus, I am confused : knowing that I want to show a webpage using my current configuration (for android desktop and mobile

How to set cookie with QWebview in QML?

烂漫一生 提交于 2019-12-04 20:33:29
I am using QWebView in QML. I want to show web site that needs authentication. Data should be passed via standard cookie. Any help? Additional link or example would be great. Thank in advance. By default, the default QNetworkAccessManager used by webkit have its own (non-persistent) cookie jar, aka QNetworkCookieJar. This will handle the sending and receiving of cookies during the life span of a QWebPage. To keep the same cookie jar across multiple pages, you have to: Create an instance of a QNetworkCookieJar, possibly subclassing it to make it persistent attach this cookie jar to each newly

QWebEngineView modify web content before render

↘锁芯ラ 提交于 2019-12-04 19:57:00
I have three questions about QWebengineView (Qt 5.7.0): How can I modify the web content (add extra html/javascript) during load (before render) How can I get events when javascript resource included in webpage is loading ( I want to modify them, too). I get html content by page()->toHtml then set it back by setHtml , but content rendered don't like original (seems to loss format) Thanks for help! 来源: https://stackoverflow.com/questions/38162751/qwebengineview-modify-web-content-before-render

Setting useragent in QWebView

给你一囗甜甜゛ 提交于 2019-12-04 14:31:41
问题 I have a QWebView, which works fine. Then, using code from spynner, I attempt to bind the useragent method to a custom method. This appears to work in spynner (with a QWebPage), but not here. Any help much appreciated. Code: def customuseragent(url): print 'called for %s' % url return 'custom ua' #inside a class self.webkit = QtWebKit.QWebView() self.webkit.page().userAgentForUrl = customuseragent self.webkit.load(QtCore.QUrl('http://www.whatsmyuseragent.com/')) 回答1: I hope this helps... Your

How to disable sound on flashplayer in my custom application?

早过忘川 提交于 2019-12-04 14:03:19
I use Qt QWebView component which uses flash-player for video playback. How to disable sound on flashplayer executed inside of my QWebView? One approach that I consider is to execute some javascript code for disabling sound on player, but when to execute it? For example next code disable sound if run it on 1 second after call "load": page.mainFrame().evaluateJavaScript(""" var mute_all_tags=function(tag){ var elems = document.getElementsByTagName(tag); for(var i = 0; i < elems.length; i++){ elems[i].muted=true; //alert(elems[i]); } } mute_all_tags("video"); mute_all_tags("audio"); """) Earlier