Saturday, January 17, 2009

Getting started with UFaceKit and QT

QT and UFaceKit

So the big news this week in opensource space was the announcement of Nokia to release their C++ cross-platform widget toolkit under LGPL. This is great and people now once more start to request a SWT-Port for QT. I don't know if any company is going to invest the development resources into such a port at least I haven't heard anything.

From UFaceKit point of view the announcement is great because we've been working since some time on an UFaceKit-Implementation for QT. Today I invested some time to implement features to render the AddressBook-Application i showed you in my last blog entry

Below is the application rendered using the CleanlooksStyle on MacOSX:



The only change to the code I showed you last week is how the application is launched.
For SWT the launcher looks like this:
public class Launcher {
public static void main(String[] args) {
final Display display = new Display();

Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
public void run() {
JFaceFactory factory = new JFaceFactory();
Workbench workbench = new Workbench(factory);
workbench.open();

while( ! workbench.isDisposed() ) {
if( ! display.readAndDispatch() ) {
display.sleep();
}
}
}
});
}
}

And for QT:
public class Launcher {
public static void main(String[] args) {
QApplication.initialize(new String[0]);
QApplication.setStyle(new QCleanlooksStyle());

Realm.runWithDefault(QTObservables.getRealm(), new Runnable() {
public void run() {
QTFactory factory = new QTFactory();
Workbench workbench = new Workbench(factory);
workbench.open();
QApplication.exec();
}
});
}
}


And now with styles applied the whole application looks like this:



I'm still in the process to make myself familiar with the QT-API and how I'm supposed to use and implement certain functions. Even if you don't want to use our UFaceKit-API the work we are doing here is interesting to you probably because we provide for example QTObservables for use with Eclipse-Databinding and a Combo/List/Table/Tree-Viewer implementation for QT-Controls.

UFaceKit Dokuware

I was asked to provide instructions how to get the applications I show in my blog running the locally and play with them. I've opened a new section in the Eclipse-Wiki holding all informations about our project - outlining our goals, instructions how to get the current code base running, and hopefully much more information soon.

1 comment:

xiaoxia said...

Namun, pernyataan tersebut baru dikeluarkan oleh produsen Power Balance di Australia mbt shoeskarena promosi yang dilakukan dianggap melanggar Undang-Undang Praktik Perdagangan di negara tersebut.