A Week of Compiling

A Week of Compiling

By Jeff Tranter

This week was a little slow as some people were away for the holidays. The new callback-qtimplementation by Viras got committed to github and we are now working with that version.

Much of the week has been spent building Qt5. The source code for Qt5 is huge - several gigabytes. It takes considerable time to check out the code even with a fast Internet connection. Some reasons for this are the size of Webkit, all of the new modules, mobility functions, unit tests, and the files related to git. There are some good instructions for building Qt5 here.

The version of WebKit in Qt5 git is rather old and for this project we want the latest WebKit 2 to pick up all the recent changes for performance and HTML5 support. We built the latest QtWebkit version from git using the instructions here. This is also a very big git checkout and takes some time to build.

Once we had Qt5 built with WebKit support, we looked at what was needed to compile the current callback-qt code with Qt5. Most of the changes needed are quite straightforward. Qt5 has moved what was Qt Mobility into Qt modules such as "location", "feedback", and "systeminfo". In fact the QWidgets are now an optional module "widgets" that you need to enable in your qmake project file. Some class names have changed in Qt5. For example, QSystemNetworkInfo is now QNetworkInfo and QSystemDeviceInfo is now QDeviceInfo. We now have an initial set of patches that allow callback-qt to compile with Qt5 as well as Qt4, in some cases using #if directives in the code to handle the differences. With these changes the sample Qt PhoneGap HTML5 application is working with Qt5.

The Qt Simulator is very useful for this type of project as it allows you to simulate most of the phone hardware like GPS, battery, camera, sensors, etc. when running on a desktop. Unfortunately it looks like a significant amount of work is needed to port the simulator and the other components it uses to Qt5. It is not clear yet when this will be ready.

We plan to move on to implementing some of the missing PhoneGap modules. I've summarized them on the wiki page. The Accelerometer and Compass modules look like good candidates for us to start on as they are quite small and map well to functions in Qt, so we plan to start on those next week (or should I say next year?).