Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

Qt Extended Java Integration

Java Integration

When integrating a Java VM into Qt Extended, it is important that the installed Java applications operate seamlessly with native Qt Extended applications. To ensure this, the following considerations should be made:

ConsiderationDescription
Use .desktop filesJava applications should be referenced by .desktop files in the $QPEDIR/apps/Applications or $QPEDIR/apps/Games directory (depending whether it is an application or a game). They should not be isolated in a separate tab or in a totally different interface.
Use unique executablesFor the Qt Extended execution model to function correctly the following line must be specified in the .desktop file:
    Exec= line

where line is a unique executable name.

This executable name may simply be a symbolic link to the actual executable which then uses argv[0] to determine its behavior. This is essential for QCop communication between the application and the launcher. In particular, the following will not work:

    Exec=jvm appname

.

Use QtopiaApplicationQtopiaApplication must be used, not QApplication, otherwise all the framework provided for Qt Extended will not function correctly. In particular, QtopiaApplication communicates with the launcher via QCop to handle things such as the taskbar icon, raising, quitting, opening documents and changing styles and fonts.
Use QtopiaApplication::exec()This ensures that functionality such as QCop processing is initiated. If you must use your own event loop rather than exec(), you must at least call QtopiaApplication::setMainWidget(). If is not possible, additional functionality will need to be added to QtopiaApplication to support your event loop.
Follow Qt Extended ConventionsThe widget toolkit or bindings used by the JVM should follow the Qt Extended conventions. For example, it should use QtopiaApplication::execDialog() rather than QDialog::exec().

Note: These items are listed in order of the Qt Extended application execution control flow and so correspond to the order in which they can be easily tested.

The above rules can be relaxed to some extent, however additional integration coding will be required in QtopiaApplication and the Qt Extended launcher (qpe) process.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3