I got a QtWebKit.QWebView widget in a PyQt application window that I use to display text and stuff for a chat-like application.
self.mainWindow = QtWebKit.QWebView()
self.mainWindow.setHtml(self._html)
As the conversation gets longer the vertical scrollbar appears.
What I'd like to get, is to scroll the displayed view to the...
I'd like PyQt to load an image and display it from the web. Dozens of examples I've found online did not work, as they are for downloading the image.
I simply want to view it.
Something like
from PyQt4.QtWebKit import *
web = QWebView()
web.load(QUrl("http://stackoverflow.com/content/img/so/logo.png"))
...
I'm writing an ebook viewer in C++ using Qt 4.5, using the QWebView object to render html files.
Some of the html files need a high window width, otherwise an horizontal scroll bar will appear, which is very annoying, thus I would like to implement an option to fit the content to the window width.
Please, do you have any idea how to ma...
Good day,
How I can use QWebView with method load() in threads?
I have create QWebView in main(!) thread, but I can't use load() with QWebView (used signals/slots from other threads to do it):
QWebView wv = new QWebView(); //ok
QUrl url = new QUrl("http://somesite.com/"); //ok
wv.load(url); //ERROR: QObject: Cannot create children for...
I wrote a quick test app to use the google analytics scripts in a client app. It works fine using QWebView and
QWebFrame* pFrame = m_pWebView->page()->mainFrame();
pFrame->setContent(arrayHtml);
pFrame->evaluateJavaScript(strScript);
But no matter what I do I cannot get it to release memory. Every time I call the script it keeps addi...
Hello,
I have a QWebView which displays some HTML content and I used CSS to style the text:
body { font-size: 10pt; }
The window with the QWebView also has a QTextEdit field, for which I have set the font like this:
QFont newFont;
newfont.setPointSize(10);
myEditField->setFont(newFont);
Unfortunately, the text displayed in the QWe...
When I click on a link in a QWebView I need to perform some actions based on the MIME type of that link.
Obviously when I click on the link QWebView tries to navigate there, but how do I get the content type after this?
...
Hi.
I'm working on a kiosk web browser using Qt and PyQt4. QWebView seems to work quite well except for one quirk.
If a URL fails to load for any reason, I want to redirect the user to a custom error page. I've done this using the loadFinished() signal to check the result, and change the URL to the custom page if necessary using QWebVi...
I am using a QWebView to display some content and I want to use custom CSS to spruce up the output. I found that I can use the QWebSettings.setUserStyleSheetUrl() method to load my own CSS into the view. The .css file is in the same directory as my main program.
self.webview = QWebView(MainWindow)
self.webview.settings().setUserStyleS...
Hi,
I'm trying to render a web page, in QT 4.5, that uses an embedded font. Most of the time this works as expected. Unfortunately, sometimes I get really weird behaviour.
The font is rendered - apparently - off-by-one. For instance the text:
"By" woukd appear as "Cz"
Has anyone run into this before? And - more importantly - knows ho...
So let's say I'm trying to click a link in the QWebView, here is what I have:
// extending QWebView
void MyWebView::click(const QString &selectorQuery)
{
QWebElement el = this->page()->mainFrame()->findFirstElement(selectorQuery);
if (!el)
return;
el.setFocus();
QMouseEvent pressEvent(QMouseEvent::MouseButtonP...
I am working with Qt's QWebView, and have been finding lots of great uses for adding to the webkit window object.
One thing I would like to do is nested objects... for instance:
in Javascript I can...
var api = new Object;
api.os = new Object;
api.os.foo = function(){}
api.window = new Object();
api.window.bar = function(){}
obvious...
I have a QWebView in my Qt app. If the QWebView has a form, how can I intercept its submission and get the values of the form?
...
Using Qt 4.6, I can dynamically add to an HTML page like this:
ui->webView->page()->mainFrame()->documentElement().findFirst("body").appendInside("<i>some text</i>\n");
However, if I QWebView::load() an XML file, it displays it with the correct CSS styling (from an processing instruction), but doesn't show any changes when I do somet...
Hi everyone,
i need to be able to react on focus changes in QWebPage. I used microFocusChanged() signal and it gives me almost desirable behavior, but anyway i don't know how to know which element is selected. I want to do some actions when any editable element on page gets or loses focus.
Thank you in advance
...
I'm building a Qt app with Python where you can point and click at a (google) map and get the coordinates of the location. The map is shown through a QWebView loading a simple HTML page and the user can create markers by clicking. Screenshot of the widget after clicking on the map.
However, I'm having trouble to retrieve the just-clicke...
I have an application that displays some HTML in a QWebview, which references images on the local file system. This works fine directly running the python. When compiling via py2exe, the images no longer load. Google doesn't seem to know the answer, any ideas?
...
Is there a way to access the widgets generated by INPUT and SELECT on a page in WebKit, using Qt?
On a related note, does WebKit provide these widgets, or does it delegate back to Qt to generate them?
...
I have a QWebview in a grid layout, along with other widgets. When the user resizes the window, the QWebview doesn't resize, but the other widgets do. How can I make the QWebview resize correctly?
...
I have a simple Qt application that launches a window with a QWebView. I tried several sites using the video tag with h.264, and it either can't play the video at all (as in youtube or sublime video), or it renders the video poorly, with black lines covering parts of it, like when viewing the video here.
Is this a known issue with QtWeb...