Skip to content

Qt WebKit

Questions about Qt WebKit and related topics? Post here!
1.5k Topics 5.9k Posts
  • QWebPage cannot load full js staff

    2
    0 Votes
    2 Posts
    2k Views
    A
    You can subclass NAM, reimplement createRequest and set it to your QWebPage, count all created requests and wait until all of them are finished. You will get all files loaded, but were may still exist some javascript functions which do they job continuously + javascript with dynamic content loading + ajax + json + websockets + flash... so you actually can't get really finished status, because Web 2.0 is dynamic.
  • QML + WebView + VirtualKeyboard

    10
    0 Votes
    10 Posts
    10k Views
    H
    Dear fxonair, Sorry for my late post. This is a simple example which pops up an input dialog to enter text whenever you click on an html input field. Whishing it will be helpful! mainwindow.h: @#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include "webbridge.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: void on_webview_loadFinished(bool issuccessful); private: Ui::MainWindow *ui; WebBridge m_webbridge; }; #endif // MAINWINDOW_H@ mainwindow.cpp: @#include "mainwindow.h" #include "ui_mainwindow.h" #include <QtWebKit> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->webview->settings()->setAttribute(QWebSettings::JavascriptEnabled, true); ui->webview->settings()->setAttribute(QWebSettings::AutoLoadImages, true); ui->webview->settings()->setAttribute(QWebSettings::PluginsEnabled, true); ui->webview->page()->mainFrame()->addToJavaScriptWindowObject("webbridge", &m_webbridge); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_webview_loadFinished(bool issuccessful) { if (issuccessful) { const QString script = "var inputs = document.getElementsByTagName('INPUT');var index;for(index=0; index < inputs.length; index++){inputs[index].onclick = function() {this.value=webbridge.openInputContext(this.value);}}"; ui->webview->page()->mainFrame()->evaluateJavaScript(script); } }@ webbridge.h: @#ifndef WEBBRIDGE_H #define WEBBRIDGE_H #include <QtCore> class WebBridge : public QObject { Q_OBJECT public: WebBridge(); public slots: QString openInputContext(const QString& orgtext); }; #endif // WEBBRIDGE_H@ webbridge.cpp: @#include "webbridge.h" #include <QInputDialog> WebBridge::WebBridge() : QObject() { } QString WebBridge::openInputContext(const QString &orgtext) { QString text = QInputDialog::getText(NULL, "Input Box", "Enter your text"); return (!text.isNull()) ? text : orgtext; }@ Regards,
  • QtWebKit and QtMultimediaKit

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Link error with static webkit 4.8.1

    9
    0 Votes
    9 Posts
    4k Views
    G
    While not a full featured web browser, [[Doc:QTextBrowser]] might support a suitable subset of HTML for your use case.
  • QWebpage createPlugin problem

    2
    0 Votes
    2 Posts
    2k Views
    Q
    Nevermind. Every time the browser is redirected all the embedded objects are deleted so, new objects have to be created for each page.
  • QtWebKit QWebView & the Data-URI Protocol - Not supported?

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • QWebSettings::iconForUrl strange behaviour

    2
    0 Votes
    2 Posts
    2k Views
    P
    Nobody?
  • [SOLVED]How to stretch/shrink HTML Page to fit in QWebView window

    6
    0 Votes
    6 Posts
    6k Views
    K
    Perfect. Its always a nice feeling to find a simple and elegant solution. ^^
  • How to catch Plugin errors in QWebView

    2
    0 Votes
    2 Posts
    1k Views
    F
    i'm using : @ QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true); QWebSettings::globalSettings()->setAttribute(QWebSettings::JavascriptEnabled, true); QWebSettings::globalSettings()->setAttribute(QWebSettings::AutoLoadImages, true); @ ... try it , but may need something more .
  • QtSDK 1.2 and QtWebKit 2.2 not working in qml

    2
    0 Votes
    2 Posts
    2k Views
    D
    is this any solved for this problem?
  • Qml webview + flash : no audio

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • -webkit-mask-box-image not working with -webkit-transform: rotate(90deg)

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Adding objects to Web Worker context

    2
    0 Votes
    2 Posts
    3k Views
    E
    You did not understand how Web Workers work. They have their own context and can never access the DOM or a window object -- well, some say that Web Workers exist in a vacuum. See here: "http://www.html5rocks.com/en/tutorials/workers/basics/#toc-enviornment-features":http://www.html5rocks.com/en/tutorials/workers/basics/#toc-enviornment-features That behaviour has nothing to do with QtWebKit but is the normal Web Worker specification. An object you add with @addToJavaScriptWindowObject("THIS_GETS_TO_THE_DOM", yourObject)@ is added to the DOM (where else should it be placed?)! So, no chance that you can access it from within your Web Worker.
  • 0 Votes
    7 Posts
    3k Views
    E
    As far as I understand your page A (or some native stuff that gets executed when page A is shown) claims memory which is not freed when you exit page A (i.e. navigation to page B). Because it's a hybrid application your memory leaks can occure in the web part, i.e. in your HTML pages and your JavaScript in the native part. Try to get rid of the native part and load your html pages in a standalone browser, like chrome, firefox, safari etc. if you see the problems there too, then it's a leak in the JavaScript part. Of course I do not know if you can get rid of your native part and display the pages alone...? If you see it leaking it can be either an JS engine problem or (and unfortunately that's the common case) it's a problem in your JavaScript coding, because you have cross references or whatsoever. Of course it can be also a memory heap problem in your native part. Take a look if you allocate memory with new or new[] if you show page A and be sure that you did not forget the delete or delete[] if you navigate back from your page. What about your QObject instance with which you have to populate your page A by calling @addToJavaScriptWindowObject("YOUR_BRIDGE_NAME", qObjectInstance)@ For sure this is always done as soon as you show page A.
  • Qt Webkit - Browser Interaction issue [SOLVED]

    4
    0 Votes
    4 Posts
    4k Views
    A
    I'am glad i can help you! Please add "[SOLVED]" to the topic subject.
  • QT5 qtwebkit

    3
    0 Votes
    3 Posts
    3k Views
    N
    I was able to pass through this issue. While configuring the webkit I passed: @--no-3d-canvas@ My qtwebkit configuration now is as given below : @perl Tools/Scripts/build-webkit --qt --install-libs=output --release --no-3d-canvas@ After that its compiling without any issues. Any body has explanation for this?
  • QtWebkit - Strict HTML

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Access to WebElements through WebKit2 Touch API

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Some SSL pages not displaying on Windows/Qt 4.8/MingW ?

    4
    0 Votes
    4 Posts
    4k Views
    D
    You have to set the ssl configuration thing (as above) before anything else in your program (at least, before calling any web thing). Also, actually you still have to use the modified QWebView too (QWebViewExt as in my first post), since in some case the ssl config is not enough. Then you shouldn't have troubles accessing ssl websites.
  • Problem with using more than one QWebInspector and QWebPage

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied