qtwebkit

How to edit QtWebKit's right-click context menu in Qt Creator?

一个人想着一个人 提交于 2019-12-04 13:03:47
Alright, here's my dillema. I am making a simple application with Qt Creator that makes use of Webkit. I thought Qt Creator would have an easy way to edit the right-click context menu with the signals and slots editor, but this has proven to not be true. I know webkit has classes that have to do with the context menu, but I don't know how to access them through Qt Creator. I need to edit the "Open Link in New Window" part of the context menu so that it opens my application up in a new window when a link is followed, but as I said previously, I can't think of a way to edit it without compiling

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

梦想与她 提交于 2019-12-04 11:54:22
问题 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

How to send data to and from the browser with a Qt HTML5 Application

有些话、适合烂在心里 提交于 2019-12-04 11:00:42
问题 None of the tutorials available online show how to create a Qt HTML5 application. Ideally, I just need a way to send data (a string will do) between webkit and Qt. When I create a Qt HTML5 Application It generates myApp.pro html5applicationviewer.pri // comments say dont touch this file html5applicationviewer.h // comments say dont touch this file html5applicationviewer.cpp // comments say dont touch this file main.cpp index.html So how do I add a function in C++ to communicate with the

How to choose value from an option list using PyQt4.QtWebKit

限于喜欢 提交于 2019-12-04 09:05:11
I'm trying to auto-select a birthday from an option list on my website by using PyQt4.QtWebKit, but I'm having trouble doing this. When I want to select a radio button I do this: doc = webview.page().mainFrame().documentElement() g = doc.findFirst("input[id=gender]") g.setAttribute("checked", "true") Or set some text input: doc = webview.page().mainFrame().documentElement() s = doc.findFirst("input[id=say_something]") s.setAttribute("value", "Say Hello To My Little Friends") But how do I select a month from this option list? <select tabindex="11" name="birthday_m"> <option value="">---</option

Override shouldInterruptJavaScript in QWebPage with PySide

亡梦爱人 提交于 2019-12-04 06:14:02
问题 I would like to override PySide.QtWebKit.QWebPage.shouldInterruptJavaScript() slot to silently ignore JavaScript interrupt requests. I have my own timeout timer setup and I do not need a default message dialog. Quoting PySide documentation: Because of binary compatibility constraints, this function is not virtual. If you want to provide your own implementation in a PySide.QtWebKit.QWebPage subclass, reimplement the QWebPage.shouldInterruptJavaScript() slot in your subclass instead. QtWebKit

Qt4: How to call JavaScript functions in a page from C++ via QtWebkit?

丶灬走出姿态 提交于 2019-12-04 06:11:38
I'm trying to write a simple log viewer using Qt4's WebKit port/implementation. My HTML code looks like this: http://pastie.org/613296 More specifically, I'm trying to find out how to call the add_message() function which is defined in the <script> section in the HTML document from my C++ code. // Doesn't work: QWebElement targetElement = chatView->page()->mainFrame()->findFirstElement("head").firstChild("script"); // Function is not included, either... qDebug() << targetElement.tagName() << targetElement.functions(); // The ultimate attempt in calling the function anyway: QVariant

How to Create a webservice by Qt [closed]

一世执手 提交于 2019-12-04 06:08:52
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am looking for a tool or plugin that help me to create web service as DOT NET does for Linux. From the OP Edit in question: After search, I found that Qt does not have any thing to write web services gSOAP is an Open Source Solution

Crossplatform webview in Qt5.6

拟墨画扇 提交于 2019-12-04 03:59:36
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 version), what should I do? Is there a hope it will be solved in the next Qt versions? Edit: Even when I

“QComboBox Pop-up” expanding and QtWebkit

时光毁灭记忆、已成空白 提交于 2019-12-04 03:30:32
In Firefox/Chrome/InternetExplorer/Safari/Opera pop-ups from the combobox expand as the content, see Firefox picture: QComboBox pop-up does not expand the content. Pop-ups are limited by the size of QComboBox , see QWebView picture: So I implemented the QComboBox::showPopup : void newQComboBox::showPopup() { int width = this->width(); this->view()->setTextElideMode( Qt::ElideNone ); const int iconSize = this->iconSize().width(); const QFontMetrics fontMetrics = this->fontMetrics(); const int j = this->count(); for( int i=0; i < j; ++i ) { const int textWidth = fontMetrics.width( this->itemText

QWebView / Qt WebKit won't open some SSL pages; redirects not allowed?

送分小仙女□ 提交于 2019-12-04 02:14:14
Clean install of Qt SDK 1.1.4 on Windows 7 with Visual C++ 2008 SP1; I'm using Qt Creator. Why does this code not load some web pages? #include <QtGui/QApplication> #include <QtWebKit/QWebView> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWebView b; b.load(QUrl("https://gmail.com")); // doesn't work //b.load(QUrl("https://accounts.google.com")); // works //b.load(QUrl("https://google.com")); // doesn't work //b.load(QUrl("https://www.google.com")); // works b.show(); return a.exec(); } Why do some of the URLs not work, and others do? I think the google.com / www.google.com