There is almost always room for a browser in a desktop application. You might need to show some help pages, documents, formated source code, xml or what not. And then you need a browser.
Up to now these browsers have often been limited to show some simple html. But with Qt 4.4 and Qt Jambi 4.4 we will have a proper WebKit integration and voila.. you have a full fledged web browser at your fingertips.
Let’s have a quick look at what it can do!
Oi, that looks promising.. Let’s have a look at the source code to this example that has been written using Qt Jambi.
import com.trolltech.qt.core.*;
import com.trolltech.qt.gui.*;
import com.trolltech.qt.webkit.*;
class HelloWebKit extends QWidget {
private QWebView browser;
private QLineEdit field;
public HelloWebKit() {
field = new QLineEdit();
browser = new QWebView();
QVBoxLayout layout = new QVBoxLayout(this);
layout.addWidget(field);
layout.addWidget(browser);
field.returnPressed.connect(this, "open()");
}
public void open() {
String text = field.text();
if (text.indexOf("://") < 0)
text = "http://" + text;
browser.load(new QUrl(text));
}
public static void main(String args[]) {
QApplication.initialize(args);
HelloWebKit widget = new HelloWebKit();
widget.show();
QApplication.exec();
}
}
That wasn’t difficult was it
But can this actually render some normal webpages.. yes it can. So here goes another screenshot
8 Responses to “Who needs a browser, Qt Jambi just got one?”
a web browser in qt… i’m still amazed every time i see it !
good job
“Qt is definitely my favorite sin”
~ Al Pacino
This is (alongside Phonon in Qt) the greatest news I’ve heard in a while! Hats off!
Will there be a flash plugin available?
We will work towards getting Flash plugin support. But right now we are not able to do this for all supported platforms so it will have to wait.
Do you plan to make the “Document” available to the Qt API? This would be great to develop “complex” apps with QtWebKit.
Hi! Great job!
A question regarding the API. Do you plan to provide access to Web Core objects (WebCore::Page)? As far as I see, currently it is private.
Thanks
The Qt Jambi api will follow the Qt api as close as possible. Have a look here to see what you can expect: http://doc.trolltech.com/main-snapshot/qtwebkit.html


