⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Does Qt WebKit work with ios yet in Qt 5.1 beta?

  • Hi all,

    I'm trying to use QWebView inside a Qt app I'm writing for iOS. The basic compilation worked fine but when I tried to add

    @Qt += webkit@

    to my pro file and build it but it said it can't find the module.
    I realised the webkit module is not compiled and I am now trying to compile it but it fails horribly saying about not finding LLintAssembly.h file from LowLevelInterpreter.cpp. Turns out that file is meant to be generated by offlineasm which is something written in ruby in JavaScriptCore/offlineasm.

    I am not sure I am doing something wrong or if webkit is not yet supported for ios. Here's how I configured the compilation of qt5:

    @./configure -xplatform unsupported/macx-ios-clang -developer-build -nomake examples -nomake tests -release -sdk iphoneos6.1 -openssl-linked -I /opt/ios-openssl-master/include/ -confirm-license@



  • Apple explicitly forbids that any programming language be compiled/interpreted on the iOS device itself, except by their own WebKit. So Qt's WebKit would be lumped with "everything else" and disallowed.

    (I might be wrong, as I don't know anything about your specific situation; this is just how the walled garden generally works.)

  • OK,

    great, thank you Apple... -.- Any idea if there are ways of embedding native ios code in qt then?



  • So you're saying I should't use webkit anyway? The problem is, I need to. I want to use, Google/Facebook/Twitter authentication services and although they provide api's to do so with iOS code, I want to use Qt and the only way I can then do the authentication is to use their web api's which are based on javascript and html. So, you see, I really need some way of visualizing/using webpages from within my app or to include that native code into it.



  • Could you write a web page to use those APIs and point a UIWebView at that page? You would have a wall between your codes, but you could communicate between them via your server (possibly a useless option depending on what the communication is for).

    When you initially said native code, I thought you meant WebKit rather than your own code; sorry for my confusion.

  • Yes, I could. But then, as you said, I would have to point a UIWebView at the page and I would't know how to "make" a UIWebView from my Qt app. Obviously, it would be desirable for all these things to happen completely without users noticing it.

  • Per "this thread":http://qt-project.org/forums/viewthread/7271, Qt4iOS has a QWidget that uses iOS's UIWebView, so the source code would be a good starting point. (My second link above was irrelevant; I didn't inspect it for mention of iOS before pasting. I've now removed it.)

    EDIT: And I suggest trying to render the web page in an invisible UIWebView before showing it to the user, although I'm not sure the iOS SDK would allow that.

  • (Double-posting in hope that you're more likely to read this before responding.)

    I've reconsidered. I think at this point using Cocoa makes more sense than WebKit, which has become a burning wagon for this project.

  • I did not try the library you linked above but reading the comments, it seems to be only working with qt 4.x. I am working with Qt 5.1 beta (also what Qt4iOS links to is a 500 MB library and I wouldn't even know where to start from. And of course there are no docs)

  • The only way I know to do it is that, and come to think of it even that would need to be modified to use the native means of accessing your APIs because its means of getting JavaScript to work rely on security vulnerabilities in the iPhone that can be patched at any time and would preclude acceptance into the app store.

    Do you have portability requirements that make native code unattractive? At this point I think you'll need to bite the bullet and code a platform-specific implementation anyway. Unless you can rethink your problem to not involve those APIs. (Note that native code does not imply Objective-C; you can use vanilla C++ to call the APIs, thanks to whatever Qt does for its own benefit.)

Log in to reply