qtwebengine

QWebView or QWebEngineView

[亡魂溺海] 提交于 2019-11-28 05:53:34
Are there any functional differences between QWebView and QWebEngineView? If I understand correctly, QWebView is webkit, while QWebEngineView is blink. Are there any differences to the programmer? Does one offer more customization of look & feel over the other? I would give QtWebEngine a try. It is replacing QtWebKit for a reason. If you control the HTML that is getting rendered, then it probably doesn't hurt to use QWebKit. Just make sure you test your pages beforehand. QWebView uses WebKit as the backend. http://doc.qt.io/qt-5/qwebview.html#details QWebEngineView uses Chromium as the backend

Remove ScrollBars from QWebEngineView or QWebEnginePage

左心房为你撑大大i 提交于 2019-11-28 00:31:49
问题 Is there a way to remove scrollbars from QWebEngineView or can i somehow get access to it's ScrollArea? With webkit it was as easy as WebView->page()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); WebView->page()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); but i don't see any similar functionality within QWebEngine. I do not even see any scroll area within qwebengine sources.. Is there a something that i'm missing? Update: I think i can try to force scrollbars

How to send artificial QKeyEvent to QWebEngineView?

青春壹個敷衍的年華 提交于 2019-11-27 23:52:18
问题 Context: I'm creating a small web browser with a custom on-screen keyboard. It was working almost fine with Qt WebKit ( QWeb* classes) but there were crashes attributed to bugs in WebKit... which won't be fixed after Qt 5.4.0 since they're moving to Qt WebEngine. So I decided to move the stuff to Qt WebEngine ( QWebEngine* classes), following the short webkit->webengine transition guide. Following the caveat section on QWebElement , I have worked my way around showing/hiding the on-screen

PyQt WebEngineView interferes with MainMenu

风流意气都作罢 提交于 2019-11-27 16:29:53
I'm trying to create an application that contains a web browser within it, but when I add the web browser my menu bar visually disappears but functionally remains in place. The following are two images, one showing the "self.centralWidget(self.web_widget)" commented out, and the other allows that line to run. If you run the example code, you will also see that while visually the entire web page appears as if the menu bar wasn't present, you have to click slightly below each entry field and button in order to activate it, behaving as if the menu bar was in fact present. Web Widget Commented Out

How to render PDF using pdf.js viewer in PyQt?

自古美人都是妖i 提交于 2019-11-27 14:53:44
I have tried adding the pdf.js viewer files in my project and it works in browsers like Chrome, Mozilla, Safari, etc, but it's not loading some pages in node-webkit and PyQt webkit. I am trying to load the file using an iframe, like this: <iframe src="/test/?file=/assets/pdf/example.pdf#page=3"> </iframe> I've found this thread over at the Qt Forums , where thebeast44 posted a snippet of Qt code answering your question. My translation to python is below. You'll also need to unpack the res folder from the author's original code , I think he just modified the viewer... I've also attached said

QtWebEngine debugging

爱⌒轻易说出口 提交于 2019-11-27 14:32:47
问题 Recently Qt introduced the QtWebEngine module. Is there a way to invoke developer tools and debug JavaScript code inside QWebEngineView ? It was possible with QWebView using page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); but I couldn't find any similar option in QWebEngineView . 回答1: I just ran across this so I added it here for posterity. It was just added to Qt 5.5 git. You have to enable it via an environment variable QTWEBENGINE_REMOTE_DEBUGGING=<port> . You

QT QWebEnginePage::setWebChannel() transport object

£可爱£侵袭症+ 提交于 2019-11-27 13:19:12
I'm using the QT WebEngine framework to display web pages. I'm injecting javascript into a page when it loads, and want to allow the javascript to be able to access a QT object. Apparently, to do this a QWebChannel must exist that establishes some IPC between chromium (the javascript) and the rest of my C++/QT project. I came across the QWebEnginePage::setWebChannel (QWebChannel *channel) function, however I can't find any examples of its use. The documentation ( http://doc.qt.io/qt-5/qwebenginepage.html#setWebChannel ) mentions that qt.webChannelTransport should be available in the javascript

QWebView or QWebEngineView

北城以北 提交于 2019-11-27 00:58:53
问题 Are there any functional differences between QWebView and QWebEngineView? If I understand correctly, QWebView is webkit, while QWebEngineView is blink. Are there any differences to the programmer? Does one offer more customization of look & feel over the other? 回答1: I would give QtWebEngine a try. It is replacing QtWebKit for a reason. If you control the HTML that is getting rendered, then it probably doesn't hurt to use QWebKit. Just make sure you test your pages beforehand. QWebView uses

PyQt WebEngineView interferes with MainMenu

狂风中的少年 提交于 2019-11-26 18:39:21
问题 I'm trying to create an application that contains a web browser within it, but when I add the web browser my menu bar visually disappears but functionally remains in place. The following are two images, one showing the "self.centralWidget(self.web_widget)" commented out, and the other allows that line to run. If you run the example code, you will also see that while visually the entire web page appears as if the menu bar wasn't present, you have to click slightly below each entry field and

How to render PDF using pdf.js viewer in PyQt?

China☆狼群 提交于 2019-11-26 18:25:17
问题 I have tried adding the pdf.js viewer files in my project and it works in browsers like Chrome, Mozilla, Safari, etc, but it's not loading some pages in node-webkit and PyQt webkit. I am trying to load the file using an iframe, like this: <iframe src="/test/?file=/assets/pdf/example.pdf#page=3"> </iframe> 回答1: I've found this thread over at the Qt Forums, where thebeast44 posted a snippet of Qt code answering your question. My translation to python is below. You'll also need to unpack the res