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

QWhereaboutsFactory Class Reference
[QtLocationModule]

The QWhereaboutsFactory class creates QWhereabouts instances. More...

    #include <QWhereaboutsFactory>

Static Public Members


Detailed Description

The QWhereaboutsFactory class creates QWhereabouts instances.

It detects the available Whereabouts plugins, allowing the preferred plugin to be loaded into the application at runtime. The create() function returns a QWhereabouts instance representing the plugin identified by a given key. The valid keys (i.e. the supported plugins) can be retrieved using the keys() function.

Qtopia includes a built-in whereabouts plugin, "gpsd". This reads data from a GPSd daemon if one is present. When using this plugin, the source argument to create() can be an empty string; in this case, the plugin reads from localhost on the default TCP port (2947). Otherwise, the source specifies the address to read from, in "host:port" form (e.g. "127.0.0.1:2947").

A default plugin can be specified by the "Plugins/Default" value in the $QPEDIR/etc/Settings/Trolltech/Whereabouts.conf settings file. To specify a different default plugin, set this value to the name of the plugin class.

See also QWhereaboutsPlugin and Location Services.


Member Function Documentation

QWhereabouts * QWhereaboutsFactory::create ( const QString & key = QString(), const QString & source = QString() )   [static]

Creates and returns a QWhereabouts object specified by key that will read position data from the given source. The key is either a built-in plugin or the class name of a whereabouts plugin (see QWhereaboutsPlugin). Note that the keys are case-insensitive.

If key is an empty string, this uses the default plugin, or the first known plugin if no default is specified.

If source is an empty string, a default source is used, if possible. The default value is determined by the individual plugin.

See also QWhereaboutsPlugin.

QStringList QWhereaboutsFactory::keys ()   [static]

Returns the list of valid keys that can be passed to create(), i.e. the names of the available whereabouts plugins.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3