summaryrefslogtreecommitdiffstats
path: root/README
blob: bec97e7bacd095b5d5cf9feebbc824c7e0806187 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
This example shows how to create desktop widgets with Qt for Maemo 5.

Desktop widgets require a two step approach. First, a special loader is
required in order to load Qt based home screen widgets. This loader only
has to be installed once, and usually, the Debian packaging system should
be used to make sure it is installed.

In your home screen widget's Debian package, make sure you depend on the
package qt4-homescreen-loader. An example "Depends" line could look like:

Depends: libqt4-core (>= 4.6.1), libqt4-gui (>= 4.6.1), qt4-homescreen-loader

The source code for the special Qt home screen loader can be found in the
qtpluginloader directory of this package.


In order to flag a toplevel widget as home screen widgets, some special
X11 attributes must be set. The QMaemo5HomescreenAdaptor class handles all
the special behavior, and also allows home screen applets to have their
own settings dialog.

In order to use the QMaemo5HomscreenAdaptor class, add the qmaemo5homescreenadaptor.cpp and
qmaemo5homescreenadaptor.h files to your project. For qmake based projects, you can also
include the qmaemo5homescreenadaptor.pri file from your project path, e.g. with

include (/path/to/adaptor/qmaemo5homescreenadaptor.pri)

Please refer to qmaemo5homescreenadaptor.cpp for documentation on how to use the class.

The directory qt-homescreen-example contains a small example on how to make a
semi-transparent home screen widget that contains a settings dialog. Note that both
the resulting Qt binary and the corresponding desktop file need to be installed,
as outlined in the Maemo 5 Developer Guide:

    http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Application_Development/Writing_Desktop_Widgets

Note that the following line must be present in the desktop file in order for
the special Qt plugin loader to recognize the home screen widget:

Type=qt

Please refer to qt-homescreen-example for an example desktop file.