qtwebkit

Invoke C++ method from webviews Javascript

限于喜欢 提交于 2019-12-03 21:41:33
问题 In qt4 qml the qtwebkit 1.0 the component webview has a property javaScriptWindowObjects . I used it to add javaScriptWindowObjects to the context of my webpages javascript to call c++ functions. like so WebView{ url: "http://test.com" anchors.fill: parent scale: 1.0 javaScriptWindowObjects: QtObject { WebView.windowObjectName: "native" function foo(x, y) { console.log("This is a call from javascript"); myCppHandler.fooNative(b,c); } } } so i can call it from the webpages javascript like so

wkhtmltopdf: Is it possible to merge PDF files?

∥☆過路亽.° 提交于 2019-12-03 17:11:04
问题 Using this library wkhtmltopdf, is it possible to merge 2 pdf files. I need to generate a report and merge the report with some attached documents. Generation of report is done, converting from HTML to PDF. But I need to merge the resulting PDF with some other PDFs 回答1: wkhtmltopdf doesn't provide support for merging PDF's. You can accomplish this using GhostScript . It's a pretty powerful tool and frequently used by Linux users. You can use the following command: gs -dBATCH -dNOPAUSE -q

setInterval and this.wait in casper.js

邮差的信 提交于 2019-12-03 13:40:54
问题 I need to make a loop of 3 times and 2 seconds in between each iteration . I tried these 3 options: Option 1 var casper = require('casper').create({ verbose: false, logLevel: 'debug' }); casper.start("http://google.com"); casper.on('remote.message', function(msg) { this.echo('remote message caught: ' + msg); }) casper.thenEvaluate(function() { var x = 0; var intervalID = setInterval(function () { console.log("Using setInternal " + x); if (++x === 3) { window.clearInterval(intervalID); } },

How to set the size of browser using QtWebKit

爷,独闯天下 提交于 2019-12-03 08:41:42
Recently I use PyQt4 to crawl some web pages. I want to set different size of the browser which is generated by QWebView().show() . I tried to use the following code snippet to set the size: self.qsize = QWebPage().viewportSize() self.qsize.setHeight(3000) self.qsize.setWidth(1000) print self.qsize.height() print self.qsize.width() But the browser displayed is always the same size. Please give me some tips on how to set the size of the browser displayed by QWebView . Thanks in advance. I tested this, the window resizes itself after loadFinished is emitted: import sys from PySide.QtCore import

Example code for a simple web page browser using WebKit QT in C++

僤鯓⒐⒋嵵緔 提交于 2019-12-03 08:12:12
I have never used Qt and WebKit and now have a need to create a simple single web page browser using the Qt WebKit module . The application that I'm looking to create needs to have a plain window that displays a web page URL passed in via command line. I've done this sort of thing using WebKitGTK but I have no idea where to start in Qt . I've done some research to see what is involved and so far I've only been able to find snippets of code that pertain to the WebKit QWebView class. So can anybody provide me with complete sample code that will just display a web page in Qt ? Once I get that

wkhtmltopdf: Is it possible to merge PDF files?

倖福魔咒の 提交于 2019-12-03 05:59:30
Using this library wkhtmltopdf , is it possible to merge 2 pdf files. I need to generate a report and merge the report with some attached documents. Generation of report is done, converting from HTML to PDF. But I need to merge the resulting PDF with some other PDFs user2339071 wkhtmltopdf doesn't provide support for merging PDF's. You can accomplish this using GhostScript . It's a pretty powerful tool and frequently used by Linux users. You can use the following command: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf You can try these links for further reading:

setInterval and this.wait in casper.js

99封情书 提交于 2019-12-03 03:41:16
I need to make a loop of 3 times and 2 seconds in between each iteration . I tried these 3 options: Option 1 var casper = require('casper').create({ verbose: false, logLevel: 'debug' }); casper.start("http://google.com"); casper.on('remote.message', function(msg) { this.echo('remote message caught: ' + msg); }) casper.thenEvaluate(function() { var x = 0; var intervalID = setInterval(function () { console.log("Using setInternal " + x); if (++x === 3) { window.clearInterval(intervalID); } }, 2000); }); casper.run(); Observation : Nothing appeared because the script ended right away before the

Unable to pass integer from javascript to npapi plugin

雨燕双飞 提交于 2019-12-02 12:31:10
问题 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

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

我的未来我决定 提交于 2019-12-02 12:03:38
问题 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

Does PhantomJS use QtWebKit or Blink?

早过忘川 提交于 2019-12-02 10:16:17
问题 Does PhantomJS (CasperJS) use WebKit or Chromium as default browser-driver? If WebKit, is it direct WebKit or qt or gtk? 回答1: PhantomJS is based on QtWebKit. The FAQ says: Q: Which WebKit version is used by PhantomJS? A: If you want to know HTML5/CSS3/other features supported by PhantomJS, using WebKit version is not a good idea. See Supported Web Standards documentation page for details. If you really like to get the WebKit version, find it via the user agent, run the examples/useragent.js.