I want to introduce a feature that we’ve been asked for over and over: QtWebKit on Windows CE. Its still in the works but already in a quite usable state. Eventually its possible to create your own applications with web browsing capabilities on your favourite Windows CE device!
To give QtWebKit for Windows CE a whirl, you can fetch the current source from the QtWebKit git repository. So make sure that you have the following software installed:
First of all, download the source code:
git clone git://code.staikos.net/webkit
git checkout -b wince origin/joerg/wince-master
You now should have a local branch called wince, which is based on the remote Windows CE branch. Then you must set up your environment to build Qt for Windows CE applications.
This could look like this:
call vsvars32
set QTDIR=c:\Qt\4.4.1
set PATH=%QTDIR%\bin;%PATH%
setcepaths wince-mymakespec
Go into your WebKit directory and call the build script:
perl WebKitTools\Scripts\build-webkit
If everything goes well, you will find in WebKitBuild\Release\bin a QtWebKit4.dll and QtLauncher.exe. Deploy these files to your device (with the Qt binaries including network and image plugins), run it and browse the web!
For Windows CE 5 I strongly recommend to build a smaller Qt version, tailored to your needs. Remember that you only have 32 MB memory per process which is pretty soon filled if you’re displaying web sites with many images or animations.
Try it, have fun and use the mailing list qt-wince-interest@trolltech.com if you have questions or comments.
Usually you will use QSvgRenderer or QSvgWidget to show the content of SVG (Scalable Vector Graphics) files. So far, QtSvg supports SVG 1.2 Tiny static, without any DOM nor scripting supports. For a much more advanced SVG dancing, one way to do it is by using QtWebKit [1] that is available since Qt 4.4. More detailed information can be obtained by tracking the SVG status support in WebKit.
For the dojo example, here I present less-than-150-lines of code that rasterizes an SVG [2] into an image. The principle is surprisingly simple: we just use QWebView to load the SVG. To rasterize it, we create a QPainter that operates on an image then ask the main web frame to render to the image by using this painter. A little bit complication is on the scaling. To keep the code cleaner and easier to understand, this little SVG rasterizer is made to work only on SVG that has a valid size, i.e. the SVG explicitly specifies both width and height attributes. Since DOM API is not available yet in Qt 4.4, a trick which is employed here to get both attributes is by using QWebFrame::evaluateJavaScript() function [3].
Without further ado, get the code:
svn checkout svn://labs.trolltech.com/svn/graphics/dojo/svg2png
As with many other vector graphics-related goodies, here is the obligatory “Tiger” screenshot (click to enlarge). On the left side is the SVG file shown inside Inkscape, on the right side is the rasterized version (using svg2png) displayed with Gwenview. Due to the said restriction (specifying width, height), the SVG is not really the same as the commonly used example, I added both the necessary height and width attributes.
As an exercise to the reader, modify the program so that it works with a remote file, e.g. an URL with http or ftp scheme. Hint: check for guessUrlFromString() function in the Qt 4.4 Demo Browser.
[1] However, filter effects are not fully implemented yet.
[2] .svgz is not supported
[3] Use the JavaScript console in the Web Inspector to check and play with the DOM elements and their attributes.
The past few weeks I have been hacking on another feature in Qt. Going with the theme of making Qt 4.5 faster I added a cache system to QNetworkAccessManager and provided a simple QNetworkDiskCache that can be used by most applications. Under the hood the new http backend has been enhanced to support all the http rfc cache features you would expect (even behave better than FireFox in one case). Adding a cache system is very important to a lot of our customers.
- Anyone who wants to use rss/atom feeds absolutely must have a cache system in place.
- Anyone who uses QtWebKit has been looking forward to a cache system.
- Any other application that pulls down files off the network such as in XMLPatterns can use the cache to improve performance and reduce network overhead.
To store the cache QDesktopServices::storageLocation has a new enum CacheLocation that can be used to determine a proper cross platform location for where cache files can be stored. The included QNetworkDiskCache is simple and should be good enough for a lot of customers, but for those that want to write a highly optimized one for small devices or to hook into another cache system (such as MSIE’s) the interface QAbstractNetworkCache is provided so you can implement custom cache systems.
For many applications enabling the cache will be as simple as:
QNetworkDiskCache *diskCache = new QNetworkDiskCache(this);
QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
diskCache->setCacheDirectory(location);
networkAccessManager->setCache(diskCache);
To see it in action you can checkout the demo browser the 4.5 snapshots where I have enabled it.
Hi there. This is my first blog post, so I guess introductions are in order; My name is Henrik Hartz, and work as a Specialist with Product Management in Troll^W Qt Software. In Product Management I do all kinds of stuff, ranging from working with requirements, specifications, product releases, meeting customers, thinking about the future of Qt, the list goes on.. Recently I’ve had the pleasure of focusing on WebKit.
WebKit is a fantastic technology. Being able to stick web content into your application is simply amazing, there’s just about anything out there you can show! And, a lot of people know HTML, so making use of this to add content to your application enables you to (ab)use your Graphic Designer buddies.
But, WebKit is so much more than just a way to show HTML in your app. You can actually do anything a browser can - and much more! Experimenting with WebKit over the last couple of months I’ve made an example that a lot of people seem to be interested in; Using WebKit to host a Google Maps component.
I wanted to show where our offices are located in the world. So, I started with a simple QStandardItemModel that would read in addresses from a txt file. In the constructor, we read in the text file - using the first field of the comma separated line as the display role, and the rest as the address stored in the UserRole;
QStringList addressLines = address.split(",");
QStandardItem *item = new QStandardItem;
this->insertRow(this->rowCount(),item);
item->setData(addressLines.takeFirst(), Qt::DisplayRole);
item->setData(addressLines.join(",").trimmed(),Qt::UserRole);
With this model in place, we simply set it on the list view of our GUI design (yeah, I like using Qt Designer - it’s fast!);
ui.treeView->setModel(new AddressModel(this));
In the GUI we’ve also placed a web view, which is pointed to a web page under our control. This page shows a Google Maps control. So here is the GUI with the address list and QtWebKit component;

This doesn’t do much on it’s own - so we promote the QWebView class to a custom component “Map”, defined by map.h in Qt Designer. This component has some additional services that allow us to update the map, specifically;
void geoCode(const QString &address);
What we want is to update the map based on the entries in the list view when they are clicked. We do this in a slot method connected to the clicked signal of my view. Here we can access the data of the item being clicked, extract the address and ask the map component to geo-code it;
void MainWindow::showItem(const QModelIndex &idx)
{
ui.map->geoCode( idx.data( Qt::UserRole).toString() );
}
The geoCode method will use QtWebKit’s capability of calling JavaScript functions in the web environment. Here we’ll use the Google Maps API to get Google to return a coordinate of the specified address in CSV format, using the asynchronous QNetworkAccessManager::get(const QNetworkRequest &request) API;
void Map::geoCode(const QString &address)
{
QString requestStr( tr("http://maps.google.com/maps/geo?q=%1&output=%2&key=%3")
.arg(address)
.arg("csv")
.arg("GOOGLE_MAPS_KEY") );
manager->get( QNetworkRequest(requestStr) );
}
In another method connected to the QNetworkManager::finished(QNetworkReply*) signal, we parse out the coordinate returned in CSV format from Google, and pass it to a method which updates the map component appropriately;
void Map::loadCoordinates()
{
QStringList scriptStr;
scriptStr
< < "var map = new GMap2(document.getElementById(\"map\"));"
< < "var bounds = new GLatLngBounds;"
< < "var markers = [];"
< < "map.setCenter( new GLatLng(0,0),1 );";
int num=-1;
foreach( QPointF point, coordinates ) {
scriptStr < < QString("markers[%1] = new GMarker(new GLatLng(%2, %3));")
.arg(++num)
.arg(point.x())
.arg(point.y());
}
scriptStr
< < "for( var i=0; i<markers.length; ++i ) {"
< < " bounds.extend(markers[i].getPoint());"
< < " map.addOverlay(markers[i]);"
< < "}"
< < "map.setCenter(bounds.getCenter());";
this->page()->mainFrame()->evaluateJavaScript( scriptStr.join("\n") );
}
In the final call, we tell QtWebKit to evaluate the JavaScript we have synthesized, and the web view updates with the appropriate location;

The snippets shown here are simplified to some extent, but you can find the complete source code here. Please remember to put the HTML for the map component on a server you control - and replace the GOOGLE_MAPS_KEY with your own key (you need to register and bind to a domain for it to work) in both map.cpp and index.html.
Enjoy!
Hi there. This is my first blog post, so I guess introductions are in order; My name is Henrik Hartz, and work as a Specialist with Product Management in Troll^W Qt Software. In Product Management I do all kinds of stuff, ranging from working with requirements, specifications, product releases, meeting customers, thinking about the future of Qt, the list goes on.. Recently I’ve had the pleasure of focusing on WebKit.
WebKit is a fantastic technology. Being able to stick web content into your application is simply amazing, there’s just about anything out there you can show! And, a lot of people know HTML, so making use of this to add content to your application enables you to (ab)use your Graphic Designer buddies.
But, WebKit is so much more than just a way to show HTML in your app. You can actually do anything a browser can - and much more! Experimenting with WebKit over the last couple of months I’ve made an example that a lot of people seem to be interested in; Using WebKit to host a Google Maps component.
I wanted to show where our offices are located in the world. So, I started with a simple QStandardItemModel that would read in addresses from a txt file. In the constructor, we read in the text file - using the first field of the comma separated line as the display role, and the rest as the address stored in the UserRole;
QStringList addressLines = address.split(",");
QStandardItem *item = new QStandardItem;
this->insertRow(this->rowCount(),item);
item->setData(addressLines.takeFirst(), Qt::DisplayRole);
item->setData(addressLines.join(",").trimmed(),Qt::UserRole);
With this model in place, we simply set it on the list view of our GUI design (yeah, I like using Qt Designer - it’s fast!);
ui.treeView->setModel(new AddressModel(this));
In the GUI we’ve also placed a web view, which is pointed to a web page under our control. This page shows a Google Maps control. So here is the GUI with the address list and QtWebKit component;

This doesn’t do much on it’s own - so we promote the QWebView class to a custom component “Map”, defined by map.h in Qt Designer. This component has some additional services that allow us to update the map, specifically;
void geoCode(const QString &address);
What we want is to update the map based on the entries in the list view when they are clicked. We do this in a slot method connected to the clicked signal of my view. Here we can access the data of the item being clicked, extract the address and ask the map component to geo-code it;
void MainWindow::showItem(const QModelIndex &idx)
{
ui.map->geoCode( idx.data( Qt::UserRole).toString() );
}
The geoCode method will use QtWebKit’s capability of calling JavaScript functions in the web environment. Here we’ll use the Google Maps API to get Google to return a coordinate of the specified address in CSV format, using the asynchronous QNetworkAccessManager::get(const QNetworkRequest &request) API;
void Map::geoCode(const QString &address)
{
QString requestStr( tr("http://maps.google.com/maps/geo?q=%1&output=%2&key=%3")
.arg(address)
.arg("csv")
.arg("GOOGLE_MAPS_KEY") );
manager->get( QNetworkRequest(requestStr) );
}
In another method connected to the QNetworkManager::finished(QNetworkReply*) signal, we parse out the coordinate returned in CSV format from Google, and pass it to a method which updates the map component appropriately;
void Map::loadCoordinates()
{
QStringList scriptStr;
scriptStr
< < "var map = new GMap2(document.getElementById(\"map\"));"
< < "var bounds = new GLatLngBounds;"
< < "var markers = [];"
< < "map.setCenter( new GLatLng(0,0),1 );";
int num=-1;
foreach( QPointF point, coordinates ) {
scriptStr < < QString("markers[%1] = new GMarker(new GLatLng(%2, %3));")
.arg(++num)
.arg(point.x())
.arg(point.y());
}
scriptStr
< < "for( var i=0; i<markers.length; ++i ) {"
< < " bounds.extend(markers[i].getPoint());"
< < " map.addOverlay(markers[i]);"
< < "}"
< < "map.setCenter(bounds.getCenter());";
this->page()->mainFrame()->evaluateJavaScript( scriptStr.join("\n") );
}
In the final call, we tell QtWebKit to evaluate the JavaScript we have synthesized, and the web view updates with the appropriate location;

The snippets shown here are simplified to some extent, but you can find the complete source code here. Please remember to put the HTML for the map component on a server you control - and replace the GOOGLE_MAPS_KEY with your own key (you need to register and bind to a domain for it to work) in both map.cpp and index.html.
Enjoy!
So the time is finally here. Qt 4.4.0 was released a few weeks ago and as promised Qt Jambi is right behind. A lot of effort has gone into this one, in addition to supporting all the new Qt features, like Phonon, Webkit, Widgets in Graphics View, XQuery and Qt Concurrent, we also have a seriously improved deployment system, JDBC support and a compile-time checked signal-slot approach for the paranoid. Its a good time to be a Java developer I tell yah! We already mentioned all the featuers in the Qt Jambi 4.4.0 Preview Blog so we won’t repeat ourselves here… (There is a danger in linking to eskils blog, as it links to others again, which again links to others, which in the end proves to be a fairly complex graph, but then again… we are engineers and like that kind of stuff)
Under the cover we’ve also done quite some work. We also did an overhaul of the garbage collection and memory management subsystem and hopefully ironed out all the bumps and dents. We’ve also done some work on the build system, so that our users that build from source have a bit more substantial buildsystem to work with. Previously it was a complex install document, which has been replaced by a simple ant command which just does it all… I was very happy to see that the deployment system & ANT build scripts works well enough for the webstart to look like a plain, normal webstart app:
<resources>
<j2se version="1.5+"/>
<jar href="qtjambi-examples-4.4.0_01.jar"/>
<jar href="qtjambi-4.4.0_01.jar"/>
</resources>
<resources os="Windows" arch="x86">
<j2se version="1.5+"/>
<jar href="qtjambi-win32-msvc2005-4.4.0_01.jar"/>
</resources>
No magic nativejar or anything like that, just the qtjambi-win32-msvc2005-4.4.0_01.jar in the classpath and that is enough to load it, jpeg and svg plugins and all. The good thing is that the files included in the webstart are produced directly by the ant script with all dependencies etc set up properly… (well… almost properly, it took us an evening last week to get it really working, but now it works properly). Because of the fixes to memory management and deployment Eskil and I got these offical diplomas:

So, what more is there to say… Try the webstart with its new demos, download the packages and start hacking!
-
The Qt Jambi Team
For web developers, when it comes to debugging the web applications, tools like Firebug for Firefox, Safari Web Inspector and the recently introduced Opera Dragonfly can be handy and very useful. These kinds of tools offers the possibility to trace the DOM, verify the corresponding (computed) CSS, check network usage and resource loading performance, debug JavaScript, etc.
As for the Web Inspector (which is technically a WebKit feature), it is written in HTML/CSS/JavaScript except for the rather small platform-specific InspectorClient code. As Holger has mentioned before, with QtWebKit it is very easy to bring WebInspector into any QtWebKit-based browser, such as the Demo Browser (shipped with Qt 4.4) or its successor Arora. Since these browsers are available on several platforms, it also means now you can use Web Inspector on Linux (*). Using either the Demo Browser or Arora, just open the menu Tools, Enable Web Inspector and you are ready. After loading any web site, right click on the web page to find the menu item Inspect that will launch the Web Inspector.
The screenshot below gives the unsurprising proof of Web Inspector on Linux (click to enlarge):
In the example, I was trying to find out the potential slow-down in SpeedCrunch website. It was easy to spot that the Slideshow JavaScript (slideshow.js) takes around 200 ms. If this particular JavaScript code can be deferred, the web page would have been 200 ms faster.
What about other WebKit-based application? If your application is using QtWebKit, it is almost trivial to enable the Web Inspector. You can use the action available from QWebView::pageAction or trigger it directly using QWebView::triggerPageAction, in both cases passing QWebPage::InspectElement as the action. Easy enough, isn’t it?
Happy inspecting!
(*) Before, it is only possible if you run Safari under Wine
So, after Simon snitched on me and leaked highly sensitive information about my top-secret project, I guess it’s finally time to spill the beans.
Yes, it is true. For the past few months I have been semi-secretly working on taking over the world implementing support for the HTML5 video and audio elements in the Qt port of WebKit, using Phonon as the media backend. This adds QtWebKit to the list of cool browsers that support this feature.
The introduction of a special purpose media element in the HTML5 draft allows embedding of audio and video content into web pages without resorting to using the generic object tag with some random plugin-based player. It’s as easy as this:
<video src="foobar.ogg">Fallback content here.</video>
The media element also comes with a scripting API, making it easy to roll your own player interface if you want to (or use the default one provided by the user agent by adding the controls attribute).
Employing Phonon to implement the playback started out as my “hey-welcome-to-Trolltech-here-is-a-fun-task-for-you”-project, but turned out to also be a good test-case for the implementation of the various Phonon backends we are doing here at Trolltech. The project was momentarily put on ice while we were busy stabilizing the 4.4 release, but now that 4.4 is out the door it’s time to get back in the saddle.
Some of the tasks currently in the pipeline are Win and Mac support (which is still largely untested), full screen support using overlays (for speed), routing the data through an IODevice rather than just passing a URL (which will help buffering and let us ensure that per-site credentials will work), plus implementing more of the default UI controls.
Initial support is already in WebKit trunk for those of you who want to try it out, and the finished result will be in Qt 4.5. Here’s a screenshot, for you pixel peepers out there:

As part of Qt 4.4 we have now made our very first release!
Shortly before the release we finished merging all our changes back to the Subversion trunk branch, where we are working directly now. We will continue to maintain and bugfix the code in the Qt 4.4.x release series, but we try to make the changes in trunk first and then backport changes as they fit.
Our current goal is to catch up with the architectural changes that happened in trunk and maintain the layout tests. Holger for example fixed the HTML Canvas after some internal API changes. Ariya started working on Netscape plugins for Windows and Tor Arne I heard is polishing a secret feature he’s been semi-secretly working on for a while now in not-so-secret trunk. I heard rumors that he’s going to secretly blog about the secret feature soon, so stay tuned.
Big props also to Marc and the guys at Collabora for landing the initial support for Netscape plugins for the X11 Qt and Gtk ports in WebKit trunk! Great job!
On the application side Urs Wolfer’s Google Summer of Code project for integrating QtWebKit into KDE has been accepted. Congrats Urs! Feel free to stop by in #webkit and bug us if you have questions
Arora
The demo browser in Qt 4.4 has obtained a lot of attention and interest. Now that 4.4 is almost out I have forked it and started a new project called Arora where development can continue, features can be added, and anyone who wants can contribute. The source code is in a Git repository and is currently hosted on github. Along with some improvements and features there are autotest and manual tests. Git (and GitHub) makes it pretty easy for new developers to a project to fork off a branch to develop features that can be later merged back into the project. Feel free to grab the source and add the feature that you miss the most or take one of the fun items off the TODO list. To any artists out there we need an icon to match the new name. Given that this is a fork of the demo future news on Arora will be on the project’s home page or on the Arora blog.
QtWebKit & WebKit trunk
In an effort to stabilize QtWebKit before the 4.4 release QtWebKit was forked from WebKit about six months ago. This is why the acid3 test score in Qt4.4 didn’t match the latest Safari. Now that 4.4 is almost out the door work has begun on integrating the changes into WebKit trunk for 4.5. Not everything is in yet, but already a lot works and it is very exciting. I’ll let this screen shot speak for itself:

The remaining failing tests mostly relate to SVG Fonts. If you are interested in helping out feel free to join #webkit or #qtwebkit on freenode. Instructions on how to build Arora with QtWebKit trunk can be found in the Arora source wiki page.
In 4.4 Qt is getting a new module, qtwebkit. I have been watching it develop over the past year and have been eager to play around with it in Qt. Shortly after the module was merged into the main Qt branch I began working on a small browser in my spare time. Something I could use for at least some of my daily browsing. By eating my own dogfood I could catch errors in WebKit, the new networking code, and especially spot trouble areas in the API before the release.
*Disclaimer: This is just a little demo project of mine, not a FireFox replacement.*
Startup speed
One nice feature of Qt4 over Qt3 is the startup speed. I have seen reviews of KDE4 that even mention the nice bump that KDE applications received, even application have have just been porting and no extra refactoring was done. When Zack was first working on the webkit Qt integration I noticed that his test application would launch near instantaneous when Qt was in memory already. So if WebKit can launch fast, and Qt can launch fast I was definitely going to make sure that some silly demo code didn’t make it launch slow. So even with an icon database, history, cookies, tabs, etc the demo can still launches quickly. So I think it is fast enough.
Networking
In 4.4 there are some new networking class built up around the new QNetworkAccessManager class. Check out Thiago’s recent blog entry One more piece falling into place: Network Access for some more information about all the new goodies included with it. On top of networking classes I created some gui components including a minimal download manager with the usual suspects such as a progress bar, download speed, etc. A nice little demo for the download manager in its own right. Something new that QNetworkAccessManager uses that not mentioned before is the QCookieJar that is included with Qt4. Wrapping it I added saving/loading, and the usual web browser features.
User Agent
Once the browser was in good enough shape to be use every day I setup Gnome and KDE to choose the demo browser as my preferred browser. So anytime I clicked on links from e-mail or from #qt on irc the demo browser would be used and in the server logs a new user agent would show up for the mysterious demobrowser/0.1. The default qtwebkit user-agent is constructed from QCoreApplication::applicationName and the new QCoreApplication::applicationVersion properties. So if you integrate QtWebKit in your application it will automatically include the application name and version in the user-agent. This is of course configurable. Because it is just a demo and for simplicity sake the demo behaves like a single application, when launched it will contact the already running browser and tell it to open the url from the command line arguments if there is one (configurable to open in new window or tab of course).
Session Managment
Developing the demo I knew that I typically leave my browser open for days at a time and loosing your open tabs (or anything really) in a crash is never good. Also while developing the demo I would want to quickly restart it as changes were made. With that in mind the demo contains is a little watch dog class that makes sure that at most you will only loose the up to the last three seconds in the event of a crash. Not just tabs, but history, cookies, and everything else is protected. Restarting the browser selecting History/Restore Last session will quickly re-open all the top level windows and their tabs from last time.
x-qt-plugin
QtWebKit include a plugin framework and QWebPage has extra built in support for one specific plugin type, x-qt-plugin which the demobrowser implements (see QWebPage::createPlugin) The demo browser lets you add any Qt widget into the webpage. Just like with QScript, signals, slots, properties are all fully accessible from JavaScript. You could even embed QWebView and make a browser in the browser if you wanted to. With the demo browser if you load up a webpage with the following code you will find a loading QProgressbar.
<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar" height=30></object>
<script>
function display(){
if (++document.progressbar.value != 100)
setTimeout("display()", 50)
}
display();
</script>
More than for a browser
Already there have been Qt developers blogging about their interesting QtWebKit projects such as Amarok and KDE Plasmoids. I am looking forward to see what everyone does with QtWebKit.
FAQ:
The demo can be found in the demos/browser directory of the Qt package. The browser in the 4.4 snapshots has more then the beta including proxy configuration, in page search, improved keyboard shortcuts and some of the features mentioned here.
A blog about a browser is only complete with a screenshot so here it is running on Windows (Vista), Linux (Gnome), and OS X (Tiger)

Having a cross platform browser who’s code base is small and completely open kicks ass.
A big thanks to Jen, Jens, Holger, Morten, Thiago, Simon, Jesper, Thomas, Paul, and everyone else who gave feedback/patches.
Henrik recorded some cool videos showing off a bit of the integration of WebKit into Qt. The Quicktime videos are at the bottom of our QtWebKit announcement page, showing WebKit in designer, integrating Google maps into your Qt application or how to embed native widgets into HTML.
Lots has been happening downunder lately. Namely, summer has come and gone. Wasn’t too hot this year, but rained heaps. Causing my pitiful electric mower to die a horrible death on my back yard that was in some spots, a meter tall. Several lawn mowing services balked at the idea of mowing it, so I bit the big one, and bought a petrol mower. How I hate mowing grass, it goes against nature, is noisy and smelly. My daughter of almost 6 months has started sitting and somewhat getting some sort of locomotion going, although it usually ends up in tears, because she wants to just jump into the whole walking thing like her brother and everyone else does. My 2.5 year old son started painting. Luckily not on the walls, but on an easel.
On the Trolltech front, besides the whole Nokia thing, we released Qtopia 4.3.1 SDK for Neo. What better way to create software for Qtopia for your FIC Neo. It seems that OpenMoko have been slowly coming around to officially using Qtopia, in some sort.
Other than the SDK I have been busy preparing the Qtopia 4.4 webkit demonstration, that was at 3GSM, errr MWC. Cool things are possible with webkit in Qtopia. Although it is rather large, the sizes of flash memory can be quite large, and most phones now have huge amounts of space, classing them not in the embedded space any longer.
The Neuros OSD I have has some competition, as I bought an already-configured-for-Australian-use series 1, Oztivo’ified Tivo (thanks Ian!), (for research purposes, my dear wife!). Neuros really needs some scheduling information, they know it, and have put up a bounty
What I like about the Neuros OSD over the tivo is it’s size. The tivo is just huge, like a regular desktop box, and has cooling fans. The OSD has sexy curves, is sleek, glossy black and silent. Makes me want to lick it. Not to mention Neuros will be using Qt Embedded, errr Qtopia Core soon.
I feel bad about my old Sharp Zaurus 5000d’s. Gathering dust, or played with by my son, until he realizes they need charging. Perhaps I will charge them up…
Almost forgot to mention, I have been putting together a virtual keyboard for X11 using Qt. Based largely on kvkbd for kde, but reads the keys and keycodes from an xml file. It works too!
tsdogs, who is one of the HTC-linux guys (who have ported linux to HTC Universal phones and friends), recently gotten embeddedkonsole 4 to run on Qtopia 4. It’s named qterminal and I have put a qpk package for the Neo at qtopia.net. For those who think they need a terminal on their phone. The HTC-linux guys have done quite a lot to hack Linux onto these phones, although it needs to be run from an sd card. The sources can be found in the unofficial Qtopia git repository : git clone git://git.asheesh.org/qtopia_snapshot.git
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
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
The temperatures in Oslo have been dropping rapidly in the last few days, we’re well below zero now. The same applies to Qt where Thiago opened the fridge of feature freeze. I like how things fall into place :). Actually I have the same feeling with QtWebKit right now. The pieces of the puzzle are falling together, with lots of really good progress:

So Holger (zecke), Girish (g-man) and me (tronical) made it to Foss.in in Bangalore in India. We’re having a great time here, a great atmosphere, awesome food and a nice and warm climate. Girish had a presentation about Qt Stylesheets, I gave a presentation about (Qt)WebKit today and Holger had a presentation about OpenEmbedded. And there is probably going to be another lightning talk tomorrow about WebKit :). As a little side-note we found a rather interestingly named candy-bar. Have a look at it yourself:

It’s been a while since the last update and a few things happened that are worth reporting.
shared/api-changes branch. Right now we want to have a toplevel QWebView class that is a QWidget and provides all the convenience to cover most use-cases. Below that we place QWebPage which contains page related functionality like the actions and the history. The page then provides access to the QWebFrame objects, which deal with the per-frame scrollbars and allow rendering into a given QPainter.shared/network-access branch to port QtWebKit over to use that API. This will completely replace the existing public networking API in QtWebKit when compiled against Qt 4.4. Of course we will keep the old QWebNetworkInterface API around when compiling against Qt 4.3.As you can probably see from recent blogs, lots of new features are being merged into the mainline Qt (what will become Qt 4.4.0). The latest big one is the Network Access API we’ve been developing for the past few months. It’s in today’s snapshot, so you can try it out already. I’d like to thank Marius Monsen, Prasanth, Lars, Andreas, Simon and everyone else who contributed (even if they just contributed opinions).
It’s also one of the big pieces necessary for WebKit: what’s the use of a browser engine if you can’t download anything off the Internet? And another big new feature: an entirely new HTTP stack, written from the scratch to be fully HTTP/1.1 compatible. At this point in time, we’re throwing random junk and real HTTP replies into it to see how it handles broken servers out there (and broken applications too, like trying to download HTTP off the wrong port).
The design is fairly simple. And if it gives you a sensation of déjà vu, it may be because we designed it to be similar to KIO. And now you’re going to ask me: is it supposed to replace KIO? Well, definitely not, at least not in Qt 4.4: KIO does a lot more than file transfers. It also does file management operations (such as copying, moving, deleting, etc.), which is not part of our design here.
But enough of talking, let’s see some code. The following is a full application that downloads the contents of the first argument:
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
QNetworkAccessManager manager;
QNetworkReply *reply = manager.get(QUrl::fromEncoded(argv[1]));
app.connect(reply, SIGNAL(finished()), SLOT(quit()));
app.exec();
qDebug() readAll();
}
QNetworkAccessManager is the central class in the design. It holds some configuration (proxy, defaults, etc.) and some internal state. It takes one QNetworkRequest object and an operation (based on HTTP operations: get, post, put, head) and returns a QNetworkReply object.
QNetworkRequest is a simple, value-based implicitly-shared class that holds a URL and some meta-data: HTTP headers and extra attributes. It also does parsing of some tricky HTTP headers for you, so you don’t have to worry about getting the HTTP dates right.
Finally, QNetworkReply is an abstract QIODevice-based class. It’s open for reading by the time you get it, which means it will emit readyRead() whenever data is available for reading. Unlike KIO::TransferJob, if you don’t react to the signal, you won’t lose the data.
The next phase now is to make WebKit use this new infrastructure. The API will probably have a simple setManager() function that takes a QNetworkAccessManager object. When it needs more data from the network, it’ll simply call get() there.
We’ve also designed it to be extensible. You’ll be able to write your own QNetworkAccessManager class, that returns your own QNetworkReply objects and/or implements your application’s own network and security policies.
We’re interested in the feedback you can give us. The team and I are available for questions in the qt4-preview-feedback mailing list.
It’s time for another update on “what’s happening” on the (Qt)WebKit side of things
QWebSettings *settings = QWebSettings::defaultSettings(); settings->setAttribute(QWebSettings::JavascriptEnabled, false);
Politics aside I’d like to summarize a bit what happened during the development of the Qt port of WebKit in the last weeks. I like technical details, so I’ll concentrate on those
As we plan to integrate WebKit into Qt 4.4 we have to choose a stable code base of WebKit. As Maciej announced on the webkit development list the trunk branch of WebKit is going to be merged with the feature branch and likely to more feature development in the future. Apple instead is going to create a safari-3 branch in WebKit’s Subversion repository and use that for stabilization. We decided to base our work on that stable safari-3 branch. At the same time we decided to switch the development of our patches of the QtWebKit port from Subversion over to git. Our development branches will be hosted on a public git repository here in the Trolltech Labs. You can browse it online through the GitWeb interface. The repository itself is also available through the git protocol, so you can clone the repository and follow our development. Every change that we put into the qtwebkit branch - which is based on the safari-3 branch from Subversion - we also plan to submit into WebKit’s trunk branch in Subversion.
This development model allows us to stay open in our development and makes it easy to publish experimental work. At the same time it should be easy to merge changes between branches and stay in touch with the official WebKit Subversion repository. The svn/* branches in the Git repository are automatically imported from Subversion.
Lars, Zack and I spent the last week making QtWebKit work on Windows. You may wonder why this is worth mentioning at all, since Apple released a WebKit based Safari for Windows not too long ago - and since QtWebKit uses Qt it shouldn’t require any changes at all to work on Windows, right? Indeed, we did not have to change anything in the bits and pieces of WebKit that use Qt, but WebKit is bigger than that. It comes with a lot of build requirements, such as bash, perl, bison, flex, libxml/libxslt, sqlite and more. As a result of that the WebKit for Windows that Safari uses requires a full cygwin installation. That is something we want to avoid as we need to be able to build QtWebKit with minimum dependencies and within “native” Windows environments. So we worked on making it easier to compile the sources and integrate better with QMake for a more portable build process. Below is the obligatory screenshot:

QtWebKit can be built with Microsoft’s Visual Studio Compiler or with the MingW port of GCC and the Open Source Edition of Qt for Windows. We are collecting build instructions and help on the WebKit Wiki, so if you want to try to build it yourself I suggest to start there.


One thing that you can't see is that the contents of the movie is updated while the movie is playing and the perspective transformation is animating. All of which is done in real-time. It's really cool.
Oh, and the code is available at Graphics Dojo.