コード例 #1
0
QGeoAreaMonitorSource *QGeoPositionInfoSourceFactoryPoll::areaMonitor(QObject *parent)
{
    QGeoAreaMonitorPolling *ret = new QGeoAreaMonitorPolling(parent);
    if (ret && ret->isValid())
        return ret;
    delete ret;
    return 0;
}
コード例 #2
0
/*!
    Creates and returns a monitor with the given \a parent that
    monitors areas using resources on the underlying system.

    Returns 0 if the system has no support for position monitoring.

    Note: Symbian applications will need to have the Location capability
    otherwise this will return 0.
    \since 1.0
*/
QGeoAreaMonitor *QGeoAreaMonitor::createDefaultMonitor(QObject *parent)
{
    // Native Symbian area monitor is temporarily disabled,
    // see http://bugreports.qt.nokia.com/browse/QTMOBILITY-1059
//#if defined(Q_OS_SYMBIAN) && defined(QT_LOCATION_S60_MONITORING)
//    QGeoAreaMonitor *ret = NULL;
//    TRAPD(error, ret = QGeoAreaMonitorS60::NewL(parent));
//    return ret;
//#else
    QGeoAreaMonitorPolling *ret = NULL;
    ret = new QGeoAreaMonitorPolling(parent);
    if (ret && ret->isValid())
        return ret;
//#endif
    return 0;
}