Skip to content

Qt WebKit

Questions about Qt WebKit and related topics? Post here!
1.5k Topics 5.9k Posts
  • 0 Votes
    3 Posts
    3k Views
    Some status updates: I've got the qtwebkit to build ok, using these options: perl Tools\Scripts\build-webkit \ --qt \ --release \ --cmakeargs="-Wno-dev -DCMAKE_PREFIX_PATH=path_to_qt5_static_install_dir -G\"MinGW Makefiles\" -DENABLE_API_TESTS=OFF -DENABLE_TEST_SUPPORT=OFF" \ --makeargs="-j8" \ --install \ --prefix=path_to_qt5_static_install_dir (note the ENABLE_API_TESTS=OFF and ENABLE_TEST_SUPPORT=OFF defines (which seem to be effective in turning off some internal unit testing apps), plus the "--install" option. The most important static .a libs that got built are: libJavaScriptCore, libWebCore, libWTF, libwoff2, libbrotli, libQt5WebKit and libQt5WebKitWidgets. The install part of the build also seemed to follow the standard Qt "protocol" i.e. header, libs and .pri files landing in the right place. The not-so-great news are: The QtTestBrowser.exe app shows a message box like "Application failed to start because platform plugin “windows” is missing in path ''", even after copying sibling with it a "platform" dir with qt5 dll plugins etc. And then terminates. Considering the issues depicted in the points below, it is understandable why. The mingw64 7.3.0 toolchain or qtwebkit build / cmake scripts themselves are doing something odd at linker time: what I have discovered was that the .a static files seemed to be "shallow", in the sense that instead of containing the actual .o / .obj object files, they contained only path strings / references to the actual .o files! Somehow the qt or qtwebkit cmake stuff, or the binutils (ar) part of the toolchain are performing in a very bizarre way. I have to re-assemble all the object files myself with the ar utility (3,000+ files) to finally see the static libs usable in my little test app. My test app compiles ok, but fails to link - missing symbols are being reported in basic system libs brought by the toolchain itself (i.e. libws2_32.a, libshell32.a, libicu*.a, libxml2.a, libxslt.a, etc). Which is very strange because the libs are really there and are truly static i.e. I do see the allegedly missing symbols there. Because I saw __imp_xyz prefixes reported in those missing names. I suspect that some mix-up occurs between static and import libs - very probably due to some of the libs brought by the qtwebkit itself inside "<qtwebkit_src_dir>\WebKitLibraries\win". Although those end up in .lib and not having the "lib" prefix in their name, so very probably they are msvc-based. And the qtwebkit's configure reported the dependent libs as coming from somewhere else i.e. the toolchain. Very strange. Today I'll redo all these steps with msvc - even if it fails at least it may give me more insights as to what happens under the hood with qtwebkit build script. And even if that doesn't work, it helps clear my mind a little and make me ready to tackle using an older gcc toolchain or do other patching in qt5 itself. Thank you.
  • PyQt share session between two QWebView widgets

    Solved 23 Feb 2018, 23:48
    0 Votes
    4 Posts
    2k Views
    @Konstantin-Tokarev thanks, you helped me simplify my approach.
  • QtWebKit don't Build

    Unsolved build qtwebkit windows icu62 21 Feb 2018, 12:36
    0 Votes
    15 Posts
    7k Views
    Could you show full output of cmake? Did you install libsqlite3-dev package and cmake reports that sqlite is not found? That does not make any sense
  • 0 Votes
    15 Posts
    19k Views
    @cochise said in Is there a clear way to parse HTML in Qt 5.7: https://github.com/cutelyst/html-qt This is a bit of an old thread but as @cochise said html-qt is an HTML parser, sadly I didn't finish it yet but it follows WHATWG specification on how to implement an HTML parser as HTML is not XML. It's mostly complete but outputting a DOM tree isn't ready yet, so help is welcome.
  • Alternative to click on this QWebElement?

    Unsolved 15 Feb 2018, 02:35
    0 Votes
    6 Posts
    2k Views
    @JonB What happens with that page is it seems a "hack" HTML it's of type text but on GUI appers to be a select and when you click on it it show a list of options, in form of autocompleter. I just want to click on it and display that autcompleter.
  • Access QWebKit (QML based 5.2+ alpha) from C++

    Unsolved 7 Feb 2018, 15:01
    0 Votes
    4 Posts
    1k Views
    What's wrong with accessing webview in the same way as in example above, i.e. property of a root object? In my recent project I use a different approach, my QML scene is really minimalistic (WebView and splash screen only), so I construct it fully in C++
  • Keyboard not working in QWebView

    Solved 6 Feb 2018, 18:19
    0 Votes
    5 Posts
    2k Views
    Good suggestion. Yes, it worked in the examples. I found the issue, there was a layer of code above my app that was restricting keyboard events. I was able to disable that and get it to work.
  • 0 Votes
    2 Posts
    857 Views
    In QtWebKit 5.212 you obtain focused QWebElement by tracking focusedElementChanged signal on QWebPage. We should probably add getter to make it full-fledged property. Note that not everything that you can select on page is element, and geometry of text selection is not available in public API at the moment
  • How do I make my own custom QNetworkReply?

    Solved 2 Feb 2018, 14:37
    0 Votes
    4 Posts
    3k Views
    Super :) It was a long shot but sometimes one is lucky :)
  • Inherit from web page result into run time error.

    Solved 21 Jan 2018, 13:36
    0 Votes
    18 Posts
    5k Views
    @Pablo-J.-Rogina I'm sorry, I new to this forum. Done. Thank you.
  • This topic is deleted!

    Unsolved 26 Jan 2018, 18:10
    0 Votes
    8 Posts
    141 Views
  • How can I get the widget from a QWebElement?

    Unsolved 30 Jan 2018, 19:05
    0 Votes
    3 Posts
    924 Views
    You may want to use this instead: https://github.com/cisco-open-source/qtwebdriver
  • open new window with current page's cookies session

    Unsolved 25 Jan 2018, 14:20
    0 Votes
    2 Posts
    936 Views
    Sharing networkAccessManager between pages should be enough Could you check what cookies were actually transmitted via WebInspector?
  • QtWebKit - request a page as a mobile

    Unsolved 15 Jan 2018, 13:59
    0 Votes
    4 Posts
    1k Views
    What Qt events are you sending to the page? If wheel events are sent, it should be scrolling in the same way as when you are dragging scroll bar. If you device is using touch input, you probably need to recognize appropriate gesture and scroll page via API
  • 0 Votes
    9 Posts
    3k Views
    I have downloaded fresh copy from https://github.com/annulen/webkit/archive/qtwebkit-5.212.0-alpha2.tar.gz and now building properly.
  • Embedded Javascript hanging

    Unsolved 15 Dec 2017, 21:14
    0 Votes
    2 Posts
    941 Views
    Qt 4.8.6 is long EOL, so indeed it's possible that is has troubles with modern macOS versions which didn't exist when it was released Is it happening inside sanbox, by chance? Anyway, you should consider migrating to Qt 5 ASAP
  • Not able to see the video through punch hole

    Unsolved 5 May 2017, 07:39
    0 Votes
    9 Posts
    3k Views
    AFAIU, using GL_SCISSOR_TEST won't allow page to paint anything on top of the hole. This may work for you, but many implementations of media controls rely heavily on painting semi-transparent elements on top of video. This includes built-in controls of QtWebKit.
  • This topic is deleted!

    Unsolved 12 Dec 2017, 10:53
    0 Votes
    12 Posts
    92 Views
  • How to install WebKit?

    Unsolved 3 Dec 2017, 14:56
    0 Votes
    2 Posts
    2k Views
    Hi. Please use the forum's search. This topic has been brought up a dozen times.
  • Google not loading in QtWebkit

    Unsolved arm qtwebkit arm7 google maps 29 Nov 2017, 05:55
    0 Votes
    7 Posts
    4k Views
    @Kart said in Google not loading in QtWebkit: Hi @Konstantin-Tokarev and @JNBarchan, Right now I am trying on an x86 embedded device. I have a Qt 4.8.6 kit for x86 with frame buffer support. But the same issue exists. I have another Qt 4.8.6 kit with same webkit 2.3.4 having a x11 support that I am running on my Ubuntu 12.04 (yeah I am a stone age guy). There the google maps works absolutely fine. So am I missing something on my embedded device ? Or do I have to really move on to Qt5 ? It can be that your QtWebKit configuration that you have on desktop doesn't exactly match your configuration on device. E.g. desktop version uses system libxml2 by default when building, while your embedded version may be built without libxml2 and use QXmlStreamReader instead (which may result in bugs) There may be differences in hardware between you embedded system and PC. For example, does your embedded system support SSE2? I am not against Qt5 or anything. I already have cross compiled Qt5.9.2. But I haven't yet ported my project to Qt5. Can we call it plan B ? Unfortunately "web inspector" is a new word for me. Could you please give me any information on how to use web inspector on an embedded device or how to integrate with Qt ? Do setProperty("_q_webInspectorServerPort", 1234) for QWebPage object, and connect from other WebKit browser to that port (1234 in this case) Thank you.