Qt is not only styling…
September 22nd, 2010 by Eugene Ostroukhov

…but is also a set of cross-platform widgets.

This is my shot at embedding WebKit into Eclipse SWT:

QWebView embedded in SWT/Win32

QWebView embedded in SWT/Win32

QWebView embedded in SWT/Cocoa32

QWebView embedded in SWT/Cocoa32

This effort is quite different from SWT/Qt as it does not intend to provide whole SWT on top of Qt – my goal is to compliment “native” SWTs with Qt widgets. I believe Qt is a great complement for SWT as:

  1. It has uniform cross-platform API – meaning developers can provide consistent functionality on all major desktop platforms.
  2. It has native look-and-feel – Qt relies on native APIs. My tests had shown that embedding Qt into SWT is more stable then embedding Swing into SWT.
  3. Qt provide a lot of well-tested ready to embed components – QWebView integration is my primary focus right now. It was fairly straightforward to embed full-fledged WebKit browser into Eclipse workbench. I researched other WebKit “bindings” like the Cocoa’s WebKit and it looks like Qt provides most comprehensive APIs of them all.

This project will become an open-source project on one of the OSS hosting sites. I see following issues with the project:

  1. It will be LGPL project. Qt is LGPL and my code statically compiles to some other LGPLed Qt code. There isn’t really a lot of options. LGPL means that no Eclipse Foundation project will ever be able to leverage it. Note: WebCore and JavaScriptCore (they are primary WebKit components) are both released under LGPL meaning that any WebKit binary will always have LGPL code.
  2. Huge size and distribution problems. I have little C++ and Qt experience so I was unable to statically link JNI DLL to Qt libraries. Qt dynamic libraries introduce both distribution and size concerns.

Current state and future directions:

  1. The code will be published after I expose more QWebView APIs to SWT clients and will improve the build configuration.
  2. I plan to focus on QWebKit functionality like QWebInspector and QWebPage
  3. Research other Qt components that are attractive to SWT crowd (native combo with images)?

Help wanted:

  1. Build configuration to produce binaries as small as possible.
  2. SWT/GTK port – I am completely unfamiliar with GTK development so I haven’t even started looking in this direction. It shouldn’t be hard – both Win32-specific and Cocoa-specific parts are a few dozen lines long.

3 Responses  
  • Tom Schindl writes:
    September 23rd, 201012:45 amat

    Why linking statically – I’ve you’d link dynamically you could release under EPL and LGPL, not? I’ve been experimenting my own yesterday while traveling and implement a QtJambi free Java-Qt port (well as a start I wrote a wrapper for QPushButton) seems easier than I thought (I don’t want the advanced features like Subclassing in Java and most important I don’t want to rely on Java-Garbage-Collector).

    Maybe we should join forces but for me being able to release the code under EPL to make it hostable on Eclipse is a must!

  • Left writes:
    May 26th, 20115:33 amat

    Я такую же штуку бросил примерно через пару недель разработки – для того чтобы довести это до ума пришлось бы делать похаченую версию как QT так и SWT, причём хаки должны были быть разными под разные платформы. Вообщем, AWT/SWT бридж показался бы верхом стабильности по сравнению с тем что должно было получиться.

»  Substance:WordPress   »  Style:Ahren Ahimsa