qtwebkit

QObject::setParent: Cannot set parent, new parent is in a different thread

假装没事ソ 提交于 2019-12-02 04:41:14
Greeting I have a following class. class MyClass : public QObject { Q_OBJECT public: Q_INVOKABLE QVariant status(); public: MyClass(ClassX * classX); public slots: void slotA(); void slotB(); signals: void signalA(); void signalB(); private: void init(); void doSomething(); private: ClassX * classX; ClassA classA; ClassB classB; }; In MyClass 's constructor, I set classX to this.classX and in init() , I connect some of classX signals to MyClass slots and wise-versa and in someFunction() i use classA and classB . In my controller class in main thread, I create MyClass object and run it inside

How to use qtwebkit in python threads?

社会主义新天地 提交于 2019-12-02 04:32:58
问题 I'm trying to parse webpages generated by js with qtwebkit, I found an example of how to get page source: import sys from PySide.QtGui import * from PySide.QtCore import * from PySide.QtWebKit import * class Render(QWebPage): def __init__(self, url): self.app = QApplication(sys.argv) QWebPage.__init__(self) self.loadFinished.connect(self._loadFinished) self.mainFrame().load(QUrl(url)) self.app.exec_() def _loadFinished(self, result): self.frame = self.mainFrame() self.app.quit() url = 'http:/

Unable to pass integer from javascript to npapi plugin

纵然是瞬间 提交于 2019-12-02 03:58:15
I am writing a simple napapi plugin where I have to print the value passed from javascript function in html page. But I am facing problem while doing it. It works properly on firefox. But I want to do it on qt fancybrowser example. The value printed is always 0 no matter whatever value I pass in javascript code. The javascript code is as follows : <html> ..... <script> function process_data() { PluginObject = document.getElementById("Object"); var i =100; if(PluginObject){ ret = PluginObject.process_Data(i); } } </script> .... </html> The plugin code is as follows : ..... bool ScriptableObject

基于PyQt5的快速开发框架QFramer

丶灬走出姿态 提交于 2019-12-02 03:44:21
QFramer 是基于PyQt5的一款快速开发框架 ####1. 基于Qt/ PyQt /PySide开发GUI常用的开发方式 QWidget + qss QtWebkit + html + css + js Qt Quick 这三种技术都可以高效、快速、完美的开发出你所需要的跨平台桌面软件 目前Qt官方主推的开发方式为 Qt Quick ,采用类json的语言qml进行快速开发,上手容易,功能强大,Ubutun、Linux Deepin等Linux桌面开发团队都在积极使用qml进行桌面开发, 相信qml能在桌面开发走的长远。 ####2.什么是QFramer? 得益于Qt的强大和Python的高度开发效率,使用PyQt/PySide进行桌面开发将是一场美妙体验。正因为如此,笔者开发了一套基于PyQt5的快速开发框架QFramer,方便快速搭建框架原型,把更多的精力放大相应的业务逻辑上。 开发环境:Python3.5 + PyQt5 + cx_Freeze QFamer 提供了两种开发模式 混合模式 : 混合 QWiget + qss + QtWebkit + html + css + js + Qt Quick ,利用 Qwidget 原生控件搭建外层框架, QtWebkit 和 QtQuick 作为内嵌模块,无所不能... qml模式 : 单独使用 QtQuick 技术,利用

How to use qtwebkit in python threads?

独自空忆成欢 提交于 2019-12-02 00:31:42
I'm trying to parse webpages generated by js with qtwebkit, I found an example of how to get page source: import sys from PySide.QtGui import * from PySide.QtCore import * from PySide.QtWebKit import * class Render(QWebPage): def __init__(self, url): self.app = QApplication(sys.argv) QWebPage.__init__(self) self.loadFinished.connect(self._loadFinished) self.mainFrame().load(QUrl(url)) self.app.exec_() def _loadFinished(self, result): self.frame = self.mainFrame() self.app.quit() url = 'http://www.thesite.gov/search' r = Render(url) html = r.frame.toHtml() But i don't know how to make it work

How to fix/work around QtWebKit's incorrect font fallback behavior?

烂漫一生 提交于 2019-12-01 18:20:46
I have a website in which some pages have user-generated content. I use phantomjs (based on QtWebKit) to take screenshots of the pages, so they must render perfectly in QtWebKit. The problem starts when the content is not in English. Then, popular browsers (such as Chrome and Firefox) fall back to the next font in the CSS font-family, up to the default font. However, in my tests, QtWebKit seems to exhibit different behavior: it incorrectly picks a font that's unable to render the content. Consider this example file, "fonts.html": calibri, arial: <div style="font-family: calibri, arial; font

How to fix/work around QtWebKit's incorrect font fallback behavior?

六眼飞鱼酱① 提交于 2019-12-01 17:57:43
问题 I have a website in which some pages have user-generated content. I use phantomjs (based on QtWebKit) to take screenshots of the pages, so they must render perfectly in QtWebKit. The problem starts when the content is not in English. Then, popular browsers (such as Chrome and Firefox) fall back to the next font in the CSS font-family, up to the default font. However, in my tests, QtWebKit seems to exhibit different behavior: it incorrectly picks a font that's unable to render the content.

Problem loading a specific website through Qt Webkit

折月煮酒 提交于 2019-12-01 13:13:55
问题 I am currently using the following PyQt code to create a simple browser: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * app = QApplication(sys.argv) web = QWebView() web.load(QUrl("http://www.robeez.com")) web.show() sys.exit(app.exec_()) Websites like google.com or stackoverflow.com work fine but robeez.com doesn't. Does anyone with Webkit experience know what might be wrong? robeez.com works fine in a regular browser like Chrome or Firefox. 回答1:

PDF with QWebView: missing refresh/repaint after loading

妖精的绣舞 提交于 2019-12-01 12:57:28
I use the QWebView (python 3.3 + pyside 1.1.2 + Qt 4.8) as FileViewer. Picture, Text, HTML, ... all fine, but PDF has a display problem. I tested two possible ways. internal pdf viewer: after use webview.load(file) it loads, but the screen is blank, after loading another file, all works fine, it shows the file pdf.js: after use setContent() with filebase, it loads the webviewer.html/.js with a white page and the loading circle. The screen only refresh if I resize the form or use the scrollbars, but then all is fine I don't find an event for "plugin/javascript finished loading", so I could

the sound don't stop when QWebView window closed (loaded with youtube video)

荒凉一梦 提交于 2019-12-01 12:44:31
I load a youtube video with QWebView by the following code ,when the video is playing I close the QWebView window ,but I still can hear the voice from that video even when QWebView window is closed, so is there any way to stop the sound by code when QWebView window is closed ? from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import * import sys app = QApplication(sys.argv) view = QWebView() view.resize(1230,760) view.settings().setAttribute(QWebSettings.PluginsEnabled, True) view.load(QUrl("http://www.youtube.com/v/nKIu9yen5nc")) # # view.show() sys.exit(app.exec_()) 来源