Quantcast
Channel: Qt DevNet forums: Qt WebKit
Viewing all 542 articles
Browse latest View live

Unknown module(s) in QT: webkitwidgets webkit

$
0
0
Hi, First I built and installed QT5 in Ubuntu 13.10 without webkit: ./init-repository —no-webkit # we build WebKit separately ./configure -developer-build -opensource -confirm-license make -j 40 make install Then I downloaded webkit and built it separately (because I need to modify webkit): Tools/Scripts/build-webkit —qt —video-track —makeargs=”-j40” —no-webkit2 Finally I ran qmake: export QTDIR=~/workspace/qt5/qtbase export PATH=$QTDIR/bin:$PATH export WEBKIT_ROOT=~/workspace/webkit qmake QtBrowser.pro And got an error: Project ERROR: Unknown module(s) in QT: webkitwidgets webkit Can anybody help me, please? I tried to fix it for 3 days, but i really do not know what to do.

Disable sound in QWebPage

$
0
0
Is it possible to disable sound in QWebPage ? Till now I’ve managed to completely disable javascript pop-ups etc using this code: class CustomWebPage : public QWebPage { protected:     virtual QString chooseFile(QWebFrame *, const QString&) { return QString(); }     virtual void javaScriptAlert (QWebFrame*, const QString &) {}     virtual bool javaScriptConfirm(QWebFrame *, const QString &) { return false; }     virtual bool javaScriptPrompt(QWebFrame *, const QString &, const QString &, QString *) { return false; } }; I also tried muting any <audio> and <video>, but unsuccessfully: QWebElement bodyElem = webPage->mainFrame()->documentElement().findFirst("body");       bodyElem.evaluateJavaScript("var mute=function(tag){"\                                              "    var elems = document.getElementsByTagName(tag);"\                                              "    for(var i = 0; i < elems.length; i++){"\                                              "        elems[i].muted=true;" \                                              "    }    "\                                              "}"\                                              "mute(\"video\");"\                                              "mute(\"audio\");"\                                              ); While the above code works here, for example: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_audio_muted But this was just a workaround. I would like, if possible, to mute the whole QWebPage.

How can I develop and host web application using Qt ?

$
0
0
How can I develop website using Qt and host that website into a hosting server ? Also is there have any web hosting company for that?

Data Retrieval from NOAA API

$
0
0
Hi All: First let me say I’m fairly new to all of this, but I’m picking it up quickly. My experience has mostly been HPC with Fortran until now. What I’m trying to do is fetch from the web a dataset generated by a specific link (The link will vary depending on what I’m looking for, I’m not sure what the technical term for this type of link is). The data comes from NOAA. For example: http://tidesandcurrents.noaa.gov/api/datagetter?begin_date=20130808 15:00&end_date=20130809 15:06&station=8454000&product=water_temperature&units=english&time_zone=gmt&application=ports_screen&format=xml generates a bunch of data. I want to go get it and use it. So my question is, how can I have Qt go out to the web, populate the data set, and then come back with the data in hand as something that I can pick apart and use in my code. Thanks for you help

Using Qt WebKit

$
0
0
Hello all, I want to create a C++ app with a HTML page attached to it. I was succesfull in creating the project and add a HTML page and was able to run it. I can now see my HTML page with buttons and text in it. Now i want to be able to recieve the HTML button click events in the C++ code. How can i do that? Once i recieve the button click, i want to call a JavaScript function in HTML page. How to do that? I am new to Qt and WebKit. So please help. I looked at the FormExtractor example in Qt web, but that doesn’t talk about how to recive HTML button click events in C++ code. Thanks in advance.

Integrating native functionality with QT Webkit ?

$
0
0
Does QT webkit allows to have a hybrid model in which the web content can interact with natve cpp code ? In short, does it follow ‘Phone gap’ like model, or is it just a web content render-er alone ?

QWebView how to load only a ?

$
0
0
Hi, I managed to load an URL in a QWebView using this: QUrl url("http://www.nfe.fazenda.gov.br/"); ui->webView->setUrl( url ); But my goal is to load/show only one specific <div> by its id (#someId). How can I achieve this ? Thanks in advance.

QWebView memory deallocation

$
0
0
Hello all! I’m building application which constantly creates a deletes QWebView object. After some time the memory consumption is growing significantly. I build the minimal example, which demonstrates the problem.     QList<QWebView *>views;         for(int i = 0;i<500;i++)     {         QWebView *view = new QWebView();         view->setHtml("Test");         views.append(view);     }       foreach(QWebView *view,views)     {         delete view;     }     views.clear(); If I run this function in a loop memory allocated by programm gets evenly growing. If I replace QWebView with QPlainTextEdit or other widget – problem disappears. I also tried functions like clearMemoryCaches, setObjectCacheCapacities, deleting page. Still no luck. Is there is a correct way how resources from QWebView can be deallocated?

QWebView doesn't free its memory

$
0
0
I want to download several pages, do something with them, and free the memory they’ve been using. Here, the same page is downloaded 10 times: #include <QApplication> #include <QtNetwork/QNetworkProxy> #include <QtWebKitWidgets/QWebView>   void Load(char *url) {   QWebView web_view;   QEventLoop loop;   QObject::connect(&web_view, SIGNAL(loadFinished(bool)), &loop, SLOT(quit()));   web_view.setUrl(QUrl(url));   loop.exec(); }   int main(int argc, char *argv[]) {   QApplication a(argc, argv);   QWebSettings::setMaximumPagesInCache(0);   QWebSettings::setObjectCacheCapacities(0, 0, 0);     for (int i = 0; i<10; ++i) {     Load("http://www.huffingtonpost.com/");     QWebSettings::clearMemoryCaches();     QWebSettings::clearIconDatabase();     printf("%d\n", i);   }     return a.exec(); } I would expect that QWebView is destructed at the end of each Load(), but for some reason memory usage is increasing up to 200MB and does not decrease even after we reach “return a.exec()”. Why memory consumption is this high? How can I free it? P.S.: I tried adding web_view.deleteLater() at the end of Load(), but it was of no avail.

File dialog from <input type="file"> causes main window to lose focus

$
0
0
Hello. I am completely new to C++ and Qt as well, so this may be a dumb question. I have a simple application based on Html5ApplicationViewer. Everything is fine, but when a file dialog is opened by pressing the “Choose File” of an &lt;input type=“file”&gt;, the application loses focus (some other window is activated) after the dialog is finished. This happens even in newly created HTML5 Application project. I know this may be caused by/related to the file dialog having no defined parent (?) Is there a way to fix it without rewriting half of Html5ApplicationViewer?

Sending external events to QtWebView components

$
0
0
All, Here is my requirement. 1. My Qt WebKit applictaion loads the html page which has Html Buttons and javascript. 2. An external event [comes from different process via sockets] should be captured and sent to this QtWebkit html page. Those events [JSON format] will be processed through Javascript and action will be taken in the html flow. Will it be possible using in QT? If so what is the approach [ classes i should look into]? And the screen display is controlled by different process and and user inputs [button clicks] will not be available to Qt webview directly. But they can be available to [x,y] coordinate to Qt application. If so, how these clicks can be processed inside the application. Please guide me the approach. Inotially i though of using Node.JS with websockets support where the external events [JSON] will be given to html loaded through QT. Unfortunately Node.JS and websockets support is not available, so i have do find different approach to receive the events from various processes.

QWebkit + extracting dynamic DOM data

$
0
0
Hello! I am looking for decision for extracting calendar data from pages like this: http://www.dukascopy.com/swiss/russian/marketwatch/calendars/eccalendar/ There are js-widget + js-applet. And they load data and insert it to the html DOM. So when I try “inspect element” in firefox, I see, that they are loaded as pure html. Are there any functions in PySide to extract all completely finished DOM data? Or are there any functions to extract widgets result? Provide plz, if possible examples. Or tell some other way to manage issue.

QNetWorkRequest SSL

$
0
0
How can I make my QwebView/QNetWorkRequest work with SSL? QT return this errors (is clear that the error occurs because I did not configure SSL in my application): QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf QSslSocket: cannot call unresolved function OPENSSL_add_all_algorithms_conf I am use Qt 5.1.1 for Windows 32-bit (MinGW 4.8, OpenGL) – my window is 64bit I try ( http://stackoverflow.com/a/12769375/1518921 ): &nbsp; &nbsp; myNAM *m_network; &nbsp; &nbsp; &nbsp; &nbsp; QNetworkReply * myNAM::createRequest( &nbsp; &nbsp; &nbsp; &nbsp; Operation op, &nbsp; &nbsp; &nbsp; &nbsp; const QNetworkRequest &amp;request, &nbsp; &nbsp; &nbsp; &nbsp; QIODevice *outgoingData &nbsp; &nbsp; ){ &nbsp; &nbsp; &nbsp; &nbsp; QNetworkRequest req(request); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;QSslConfiguration conf = req.sslConfiguration(); &nbsp; &nbsp; &nbsp; &nbsp; conf.setProtocol(QSsl::TlsV1SslV3); &nbsp; &nbsp; &nbsp;req.setSslConfiguration(conf); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;QNetworkAccessManager::createRequest( &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; op, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; QNetworkRequest(request), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; outgoingData &nbsp; &nbsp; &nbsp; &nbsp; ); &nbsp; &nbsp; } I’ll be honest, I have no idea where to start. I searched but have not found anywhere that shows how trabalar SSL with QNetWorkRequest.

Qt QWebView White Screen After Codesign For App Store

$
0
0
Env: Qt 5.2 rc1 QML Mixed with C++ backend on 10.8 MBPro Issue: Qt QWebView White Screen After Codesign For App Store For speed and deployment purposes, I used QWebView on the C++ side to display websites such as “http://www.google.com”. The webpage is displayed properly during development and even after I used macdeployqt for deployment. However, as soon as I issued codesign on the individual Qt libraries and package, the QWebView shows white screen. Various debugging steps I tried: QWebView window showed. Right click shows refresh context menu. But shows white screen. None of the QWebView signals was emitted. Turned on QT_DEBUG_PLUGINS. Shows all library and plugin loads correctly Comment out codesign build steps, rebuild, and QWebView works fine. Tried Qt 5.1.1 and 5.2.0 rc1. Same issue. The codesign build steps in .pro is the following codesign.commands += codesign -f -s $${APPCERT} -i $${BUNDLEID} \”$${TARGET}.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore\”; codesign.commands += codesign -f -s $${APPCERT} -v —entitlements misc/MyEntitlements.plist \”$${TARGET}.app\”; Any help, pointers, or suggestions would be much appreciated. Thanks in advance.

QtWebkit doesn't handle Javascript array property accessors well

$
0
0
Hello all, I am having trouble trying to make Javascript array property accessors work properly in QtWebkit shipped with Qt 4.8. For example, if I do the following in the QtWebkit web inspector: var _a = [1]; var a = []; Object.defineProperty(a, '0', { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get: function(){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;console.log('getter called'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return _a[0]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set: function(val){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log('setter called'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _a[0] = val; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } }) it should define a numeric property ‘0’ on the array object, so that if I do: console.log(a[0]); it should call the defined getter and return the value of _a [ 0 ], that is, 1. All the latest webkit browsers (Chrome/Safari) return 1 as expected. But QtWebkit returns an `undefined`, without calling the getter at all. I discovered that setting a.length = 1 solves the problem and the getters start working fine. The problem however still remains in setters. When I do: a[0] = 5; the setter is never called as I don’t get the expected log – ‘setter called’ – on the console. Again, the latest webkit browsers (Chrome/Safari) do the right thing and call the defined setter as expected. Does anyone know if there is a quick workaround this problem (like the one I accidentally discovered with getters) so that I could have array setters work properly? Or if this is really a deep nested bug, would it be fixed it Qt 5? Thanks a lot in advance. Prashant

QtWebKit 3.0 problem with WebView and flash

$
0
0
Hello everyone, I have problem with WebView. I don’t know how to configured to use flash in WebView. Even does not work youtube message “To play movies you need Flash player”. I used also QtWebKit.experimental 1.0 and this commands experimental.preferences.pluginsEnabled: true experimental.preferences.javascriptEnabled: true but still it not working. Can u help me?

Google hangout not working in qtweb browser on ubuntu 12.04 ?

$
0
0
Hi, I started google hangout in qt web browser but it was showing black screen.In other browsers same machine it was working fine.Please help me to start a hangout on qt web browser.The browser version is latest only. Thanks,

Is there a way to always put an Pixmap on top of a QWebPage?

$
0
0
Hi, all: I’m wondering is there a way to always put an pixmap on top of a QWebPage? So that the widget doesn’t work the way it should be, but only displaying a picture? Cheers Pei

Qtwebkit language problem in windows xp and xp sp3

$
0
0
I am making a browser in windows with qwebview .In window vista+7+8 its showing the language correctly but in windows xp its not abe to show some websites http://www.goolgule.com/ [goolgule.com] . When i copied some fonts in windows/fonts folder firefox works correcty but not browser with qt even i tried Qupzilla“link”:www.qupzilla.com/ Qtweb Your text to link here… [qtweb.net]‎ I don’t know its problem of qtwebkit or i am missing something. this are some code : &nbsp;QWebSettings *defaultSettings = QWebSettings::globalSettings(); &nbsp; &nbsp; QString standardFontFamily = defaultSettings-&gt;fontFamily(QWebSettings::StandardFont); &nbsp; &nbsp; int standardFontSize = defaultSettings-&gt;fontSize(QWebSettings::DefaultFontSize) +; &nbsp; &nbsp; QFont standardFont = QFont(standardFontFamily, standardFontSize); &nbsp; &nbsp; standardFont = (settings.value(QLatin1String(&quot;standardFont&quot;), standardFont)).value&lt;QFont&gt;(); &nbsp; &nbsp; defaultSettings-&gt;setFontFamily(QWebSettings::StandardFont, standardFont.family()); &nbsp; &nbsp; defaultSettings-&gt;setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize()); &nbsp; &nbsp; &nbsp; QString fixedFontFamily = defaultSettings-&gt;fontFamily(QWebSettings::FixedFont); &nbsp; &nbsp; int fixedFontSize = defaultSettings-&gt;fontSize(QWebSettings::DefaultFixedFontSize); &nbsp; &nbsp; QFont fixedFont = QFont(fixedFontFamily, fixedFontSize); &nbsp; &nbsp; fixedFont = (settings.value(QLatin1String(&quot;fixedFont&quot;), fixedFont)).value&lt;QFont&gt;(); &nbsp; &nbsp; defaultSettings-&gt;setFontFamily(QWebSettings::FixedFont, fixedFont.family()); &nbsp; &nbsp; defaultSettings-&gt;setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize()); &nbsp; &nbsp; &nbsp; bool zoom_text_only = settings.value(QLatin1String(&quot;zoom_text_only&quot;), false).toBool(); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::ZoomTextOnly, zoom_text_only); &nbsp; &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::JavascriptEnabled, settings.value(QLatin1String(&quot;enableJavascript&quot;), true).toBool()); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::JavascriptCanOpenWindows, ! (settings.value(QLatin1String(&quot;blockPopups&quot;), true).toBool())); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::JavaEnabled, settings.value(&quot;allowJava&quot;, true).toBool()); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::DnsPrefetchEnabled, settings.value(&quot;DNS-Prefetch&quot;, false).toBool()); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::JavascriptCanAccessClipboard, settings.value(&quot;allowJavaScriptAccessClipboard&quot;, true).toBool()); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::LinksIncludedInFocusChain, settings.value(&quot;IncludeLinkInFocusChain&quot;, false).toBool()); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::ZoomTextOnly, settings.value(&quot;zoomTextOnly&quot;, false).toBool()); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::PrintElementBackgrounds, settings.value(&quot;PrintElementBackground&quot;, true).toBool()); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::XSSAuditingEnabled, settings.value(&quot;XSSAuditing&quot;, false).toBool()); &nbsp; &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::PluginsEnabled, settings.value(QLatin1String(&quot;enablePlugins&quot;), true).toBool()); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::AutoLoadImages, settings.value(QLatin1String(&quot;autoLoadImages&quot;), true).toBool()); &nbsp; &nbsp; &nbsp; bool enable_local_storage = settings.value(QLatin1String(&quot;enableLocalStorage&quot;), false).toBool(); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::LocalStorageEnabled, enable_local_storage); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, enable_local_storage); &nbsp; &nbsp; defaultSettings-&gt;setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, enable_local_storage); &nbsp; &nbsp; &nbsp; QLatin1String localStoragePath ; &nbsp; &nbsp; defaultSettings-&gt;setLocalStoragePath(localStoragePath); &nbsp; &nbsp; defaultSettings-&gt;setOfflineStoragePath(localStoragePath); &nbsp; &nbsp; defaultSettings-&gt;setOfflineWebApplicationCachePath(localStoragePath); &nbsp; &nbsp; &nbsp; defaultSettings-&gt;setIconDatabasePath(dataLocation()); &nbsp; &nbsp; &nbsp; QWebSettings::globalSettings()-&gt;setAttribute(QWebSettings::PluginsEnabled,true); &nbsp; &nbsp; QWebSettings::globalSettings()-&gt;setWebGraphic(QWebSettings::MissingImageGraphic, QPixmap()); Qt version 4.8.1+mingw, i also tried 5.0.1+mvc and 5.1+mingw thanks

How to filter out «back» events in a web view?

$
0
0
Hello, all! I develop a form based upon QWebView (and have QWebView and QWebPage inherited for additional work). It’s important that a user can press Backspace without returning to whatever page it was opened before. How do I do this in QtWebKit?
Viewing all 542 articles
Browse latest View live