Skip to content

Qt WebKit

Questions about Qt WebKit and related topics? Post here!
1.5k Topics 5.9k Posts
  • External Javascript in QWebView

    10
    0 Votes
    10 Posts
    21k Views
    P
    I load JS files that contain functions into webview frequently using the following method: Connect the javaScriptWindowObjectCleared signal from QWebFrame to a local jsCleared function. Note have to use this signal or the js loses context. In jsCleared read in the js file that contains your functions. I save my functions in a resource file but you can load in any file from any source (including libraries like jQuery). Once the js file has been read in then just use the evaluateJavaScript method to load the entire js file. In my case when I read the resource js text file it is read as a QByteArray and I have to convert it to a QString before using evaluateJavaScript. Once the jsCleared method has loaded the js file then you can use any function defined in the file using evaluateJavaScript. This is the simplest method I found for loading js libraries (either internal or external) that I don't want to be a permanent part of the HTML file. Note: I use this method with Qt 4.8.1 on a desktop. Finally I noticed that in your original post you set the result variable to the return value of the evaluateJavaScript method but result is a QVariant object and you have to convert it to the correct data type in order to use it.
  • QWebPage CUT and JS range problem

    2
    0 Votes
    2 Posts
    1k Views
    P
    FYI: Apparently one cannot depend on cloning a range and saving it but I found a cumbersome but effective solution. What I did was save the start and end nodes and their offsets separately. Then when I needed a saved range equivalent I used createRange() to form a temporary range object as needed.
  • Qt 5.1.1: Flash privacy settings is not clickable

    1
    0 Votes
    1 Posts
    819 Views
    No one has replied
  • Qt application could be minimized only once in Mac

    6
    0 Votes
    6 Posts
    2k Views
    SGaistS
    You're only showing Qt code so it's impossible to say whether the problem comes from webkit. Can you provide a complete minimal example that shows this behavior ?
  • Scale's problem while printing

    2
    0 Votes
    2 Posts
    2k Views
    L
    So I solved my problem using some ugly workaround, for those who have the same problem, here is my way out : QPainter q(&pdfprinter); q.setRenderHint(QPainter::HighQualityAntialiasing, true); QWebView* tempp = new QWebView(this); tempp->setHtml(maVue->page()->mainFrame()->toHtml()); tempp->show(); q.scale(11,10.9); tempp->setGeometry(QRect(QPoint(0,0),QSize(9920, 28066))); tempp->page()->mainFrame()->render(&q,QRect(QPoint(0,0),QSize(9920, 28066))); delete tempp; The problem now is that the quality is pretty bad... (Since I've got to magnify it 10 times to get it to the size of my page...) And yes, I do need a temporary QWebView for it because I can't setGeometry on my main QWebView and because I want my whole page to be displayed, not only the part displayed by my main QWebView... If anyone as a better solution, please, feel free to contribute. I won't research it further but would be happy to get a better way to do it.
  • QWebkit 4.8.5 on Mac OS X 10.7 (lion) can't play Flash..

    1
    0 Votes
    1 Posts
    958 Views
    No one has replied
  • QWebkit doesn't handle th as a child?

    3
    0 Votes
    3 Posts
    1k Views
    C
    Solved! There is a little hard to spot bug in this code: @ child = element.nextSibling();@ This needs to be child = child.nextSilbling(); Unfortunately its also the only way to iterate (begin() end() and iterators would be nice). But it works now :)
  • QWebView works in QtCreator but not outside

    4
    0 Votes
    4 Posts
    1k Views
    SGaistS
    Did you also copy the platform plugin ?
  • 0 Votes
    1 Posts
    766 Views
    No one has replied
  • Anomalous WebView editing behavior

    1
    0 Votes
    1 Posts
    952 Views
    No one has replied
  • QtWebkit 4.8.4 not load Javascript

    2
    0 Votes
    2 Posts
    1k Views
    G
    Hi, Do you have Java enabled within QWebSettings?
  • QWebview, alignment issue while printing the content to the printer.

    3
    0 Votes
    3 Posts
    2k Views
    O
    I have the same problem, too. I am using: Win7 x64 Qt 5.1 (x32, x64) Apparently QWebView has a problem with <TABLE> tag in Qt5.1. My program works fine with Qt 4.8.4.
  • CMake and QT WebKit Compile

    2
    0 Votes
    2 Posts
    4k Views
    B
    A work-around does exist...but does not explain the issue. It appears that the CMake solution does have an un-necessary dependency on XML Patterns, an illustrated in the work-around. (Work Around) Two changes from working examples: Find the webkit on your system. i.e. instead of #include <QWebView>, mine was #include <QtWebKit/QWebView>. Specify on the link line "-l QtWebKit" or in a target_link_libraries() operation, add "QtWebKit", do not add "set(QT_USE_QTWEBKIT TRUE)"
  • WebKit build fail in 64bit Windows 7 and Qt 5.1.1 with mingw48_32

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Media query for pixel density not working in QtWebView

    1
    0 Votes
    1 Posts
    830 Views
    No one has replied
  • Button onClick not firing for touchscreen devices

    2
    0 Votes
    2 Posts
    3k Views
    J
    Still not sure why this is firing - I didn't have the patience to find out how it was all supposed to work by looking at the source code - but I did find a work around. I just turn off all touch events: @ vww_ui->webView->setAttribute(Qt::WA_AcceptTouchEvents, false); @ Not really the best solution, but as we don't currently do anything with them, it works for us (for now).
  • 0 Votes
    1 Posts
    731 Views
    No one has replied
  • Blink fork, what's Qt position?

    4
    0 Votes
    4 Posts
    4k Views
    G
    Digia has decided to go with Blink engine: http://blog.qt.digia.com/blog/2013/09/12/introducing-the-qt-webengine/
  • 0 Votes
    3 Posts
    2k Views
    A
    Hi Guru, I have used qt-everywhere-opensource-src-5.1.0 and issue seems to be resolved. I was little late in updating the post :)
  • QtWebKit fails with Qt5.0.1 mingw 32bit

    6
    0 Votes
    6 Posts
    3k Views
    G
    try to upgrade compiler Qt5.1.0