• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ positionUpdated函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中positionUpdated函数的典型用法代码示例。如果您正苦于以下问题:C++ positionUpdated函数的具体用法?C++ positionUpdated怎么用?C++ positionUpdated使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了positionUpdated函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: QObject

androidGps::androidGps(QObject *parent) : QObject(parent)
{
   QGeoPositionInfoSource *source1 = QGeoPositionInfoSource::createDefaultSource(0);

               connect(source1, SIGNAL(positionUpdated(QGeoPositionInfo)),
                       this, SLOT(positionUpdated(QGeoPositionInfo)));

               connect(source1, SIGNAL(error(QGeoPositionInfoSource::Error)),
                       this, SLOT(error(QGeoPositionInfoSource::Error)));

          if (source1) {
               source1->setUpdateInterval(1000);
               source1->startUpdates();


               qDebug() << "Gps1 status: " << source1->sourceName();
           }



           QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createDefaultSource(0);
           if (source)
           {
               source->setUpdateInterval(1000);
               source->startUpdates();
           }

           connect(source, SIGNAL(satellitesInUseUpdated(QList<QGeoSatelliteInfo>)), this, SLOT(satellitesInViewUpdated(QList<QGeoSatelliteInfo>)));

           qDebug() << source->sourceName() << "Source name";

}
开发者ID:geirwanvik,项目名称:WDrov,代码行数:32,代码来源:androidgps.cpp


示例2: connect

void GpsPosition::startGps()
{
    if (_location){
        connect(_location, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(positionUpdated(QGeoPositionInfo)));
        _location->startUpdates();
    }
}
开发者ID:AnadoluPanteri,项目名称:meecast,代码行数:7,代码来源:gpsposition.cpp


示例3: SIGNAL

void GPSWidget::startGPS()
{
    // Obtain the location data source if it is not obtained already
    if (!locationDataSource)
    {
        locationDataSource =
                QGeoPositionInfoSource::createDefaultSource(this);//this
        if (locationDataSource)
        {
            // Whenever the location data source signals that the current
            // position is updated, the positionUpdated function is called.
            QObject::connect(locationDataSource,
                             SIGNAL(positionUpdated(QGeoPositionInfo)),
                             this,
                             SLOT(positionUpdated(QGeoPositionInfo)));
            // Start listening for position updates
            locationDataSource->startUpdates();
        } else {
            // Not able to obtain the location data source
            // TODO: Error handling
        }
    } else {
        // Start listening for position updates
        locationDataSource->startUpdates();
    }
    qWarning("startujemy z GPS updates");

}
开发者ID:Hrehory,项目名称:EnigameQt,代码行数:28,代码来源:gpswidget.cpp


示例4: QObject

TrackRecorder::TrackRecorder(QObject *parent) :
    QObject(parent)
{
    qDebug()<<"TrackRecorder constructor";
    m_distance = 0.0;
    m_accuracy = -1;
    m_tracking = false;
    m_isEmpty = true;
    m_applicationActive = true;
    m_autoSavePosition = 0;

    // Load autosaved track if left from previous session
    loadAutoSave();

    // Setup periodic autosave
    m_autoSaveTimer.setInterval(60000);
    connect(&m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(autoSave()));
    m_autoSaveTimer.start();

    m_posSrc = QGeoPositionInfoSource::createDefaultSource(0);
    if (m_posSrc) {
        m_posSrc->setUpdateInterval(1000);
        connect(m_posSrc, SIGNAL(positionUpdated(QGeoPositionInfo)),
                this, SLOT(positionUpdated(QGeoPositionInfo)));
        connect(m_posSrc, SIGNAL(error(QGeoPositionInfoSource::Error)),
                this, SLOT(positioningError(QGeoPositionInfoSource::Error)));
        // Position updates are started/stopped in setIsTracking(...)
    } else {
        qDebug()<<"Failed initializing PositionInfoSource!";
    }
}
开发者ID:juiceme,项目名称:rena,代码行数:31,代码来源:trackrecorder.cpp


示例5: QgsDebugMsg

void QgsQtLocationConnection::startGPS()
{
    QgsDebugMsg( "Starting GPS QtLocation connection" );
    // Obtain the location data source if it is not obtained already
    if ( !locationDataSource )
    {
        locationDataSource = QGeoPositionInfoSource::createDefaultSource( this );
        if ( locationDataSource )
        {
            locationDataSource->setPreferredPositioningMethods( QGeoPositionInfoSource::SatellitePositioningMethods );  //QGeoPositionInfoSource::AllPositioningMethods
            locationDataSource->setUpdateInterval(1000);
            // Whenever the location data source signals that the current
            // position is updated, the positionUpdated function is called.
            QObject::connect( locationDataSource,
                              SIGNAL( positionUpdated( QGeoPositionInfo ) ),
                              this,
                              SLOT( positionUpdated( QGeoPositionInfo ) ) );
            // Start listening for position updates
            locationDataSource->startUpdates();
        }
        else
        {
            // Not able to obtain the location data source
            QgsDebugMsg( "No QtLocation Position Source" );
        }
    }
    else
    {
        // Start listening for position updates
        locationDataSource->startUpdates();
    }
}
开发者ID:sebastiangz,项目名称:Quantum-GIS,代码行数:32,代码来源:qgsqtlocationconnection.cpp


示例6: disconnect

void LocationWatcher::disable()
{
    if (source) {
        source->stopUpdates();
        disconnect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
                   this, SLOT(positionUpdated(QGeoPositionInfo)));
    }
}
开发者ID:qwazix,项目名称:oobProfile,代码行数:8,代码来源:locationwatcher.cpp


示例7: connect

void LocationWatcher::enable()
{
    if (getSetting("active")=="1"){
        if (source) {
            connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),this, SLOT(positionUpdated(QGeoPositionInfo)));
            source->startUpdates();
        }
    }
}
开发者ID:qwazix,项目名称:oobProfile,代码行数:9,代码来源:locationwatcher.cpp


示例8: QMainWindow

ClientApplication::ClientApplication(QWidget *parent)
    : QMainWindow(parent)
{
    textEdit = new QTextEdit;
    setCentralWidget(textEdit);

    LogFilePositionSource *source = new LogFilePositionSource(this);
    connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
            this, SLOT(positionUpdated(QGeoPositionInfo)));

    source->startUpdates();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:12,代码来源:clientapplication.cpp


示例9: connect

void GeolocationClientQt::startUpdating()
{
    if (!m_location && (m_location = QGeoPositionInfoSource::createDefaultSource(this)))
        connect(m_location, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(positionUpdated(QGeoPositionInfo)));

    if (!m_location) {
        WebCore::Page* page = QWebPagePrivate::core(m_page);
        RefPtr<WebCore::GeolocationError> error = GeolocationError::create(GeolocationError::PositionUnavailable, failedToStartServiceErrorMessage);
        page->geolocationController()->errorOccurred(error.get());
        return;
    }

    m_location->startUpdates();
}
开发者ID:wpbest,项目名称:copperspice,代码行数:14,代码来源:GeolocationClientQt.cpp


示例10: QGeoAreaMonitor

QTM_BEGIN_NAMESPACE

#define UPDATE_INTERVAL_5S  5000

QGeoAreaMonitorPolling::QGeoAreaMonitorPolling(QObject *parent) : QGeoAreaMonitor(parent)
{
    insideArea = false;
    location = QGeoPositionInfoSource::createDefaultSource(this);
    if (location) {
        location->setUpdateInterval(UPDATE_INTERVAL_5S);
        connect(location, SIGNAL(positionUpdated(QGeoPositionInfo)),
                this, SLOT(positionUpdated(QGeoPositionInfo)));
    }
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:14,代码来源:qgeoareamonitor_polling.cpp


示例11: source

void tst_QNmeaPositionInfoSource::requestUpdate_after_start()
{
    QNmeaPositionInfoSource source(m_mode);
    QNmeaPositionInfoSourceProxyFactory factory;
    QNmeaPositionInfoSourceProxy *proxy = static_cast<QNmeaPositionInfoSourceProxy*>(factory.createProxy(&source));

    QSignalSpy spyUpdate(proxy->source(), SIGNAL(positionUpdated(QGeoPositionInfo)));
    QSignalSpy spyTimeout(proxy->source(), SIGNAL(updateTimeout()));

    // Start updates with 500ms interval and requestUpdate() with 100ms
    // timeout. Feed an update, and it should be emitted immediately due to
    // the requestUpdate(). The update should not be emitted again after that
    // (i.e. the startUpdates() interval should not cause it to be re-emitted).

    QDateTime dt = QDateTime::currentDateTime().toUTC();
    proxy->source()->setUpdateInterval(500);
    proxy->source()->startUpdates();
    proxy->source()->requestUpdate(100);
    proxy->feedUpdate(dt);
    QTRY_COMPARE(spyUpdate.count(), 1);
    QCOMPARE(spyUpdate[0][0].value<QGeoPositionInfo>().timestamp(), dt);
    QCOMPARE(spyTimeout.count(), 0);
    spyUpdate.clear();

    // Update has been emitted for requestUpdate(), shouldn't be emitted for startUpdates()
    QTRY_COMPARE_WITH_TIMEOUT(spyUpdate.count(), 0, 1000);
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:27,代码来源:tst_qnmeapositioninfosource.cpp


示例12: positionUpdated

void QGeoPositionInfoSourceAndroid::updateTimeoutElapsed()
{
    QGeoPositionInfo position;
    position=m_lastUpdate;

    if (position.isValid())
    {
        if (m_positionInfoState & QGeoPositionInfoSourceAndroid::RequestActive)
        {
            m_requestTimer->stop();
            m_positionInfoState &= ~QGeoPositionInfoSourceAndroid::RequestActive;

            if (m_positionInfoState & QGeoPositionInfoSourceAndroid::Stopped
                ||!(m_positionInfoState & QGeoPositionInfoSourceAndroid::StartUpdateActive))
            {
                QtLocationJni::disableUpdates(this);
            }

        }
        emit positionUpdated(position);
    }
    else
    {
        emit updateTimeout();
    }
    activateTimer();
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:27,代码来源:qgeopositioninfosource_android.cpp


示例13: connect

//! [2]
void AppModel::networkSessionOpened()
{
    d->src = QGeoPositionInfoSource::createDefaultSource(this);

    if (d->src) {
        d->useGps = true;
        connect(d->src, SIGNAL(positionUpdated(QGeoPositionInfo)),
                this, SLOT(positionUpdated(QGeoPositionInfo)));
        d->src->startUpdates();
    } else {
        d->useGps = false;
        d->city = "Brisbane";
        emit cityChanged();
        this->refreshWeather();
    }
}
开发者ID:amccarthy,项目名称:qtlocation,代码行数:17,代码来源:appmodel.cpp


示例14: coordinate

/*
 This is _only_ called when QGeoPositionInfoValidator::valid() returns true for the position.
 This means that it is implied that:
 - (data.dwValidFields & GPS_VALID_LATITUDE) != 0
 - (data.dwValidFields & GPS_VALID_LONGITUDE) != 0
 - (data.dwValidFields & GPS_VALID_UTC_TIME) != 0

 This guarantees that the newly created position will be valid.
 If the code is changed such that this is no longer guaranteed then this method will need to be
 updated to test for those conditions.
*/
void QGeoPositionInfoSourceWinCE::dataUpdated(GPS_POSITION data)
{
    QGeoCoordinate coordinate(data.dblLatitude, data.dblLongitude);

    // The altitude is optional in QGeoCoordinate, so we do not strictly require that the
    // GPS_POSITION structure has valid altitude data in order to trigger an update.
    if ((data.dwValidFields & GPS_VALID_ALTITUDE_WRT_SEA_LEVEL) != 0)
        coordinate.setAltitude(data.flAltitudeWRTSeaLevel);

    QDate date(data.stUTCTime.wYear, data.stUTCTime.wMonth, data.stUTCTime.wDay);
    QTime time(data.stUTCTime.wHour, data.stUTCTime.wMinute, data.stUTCTime.wSecond,
               data.stUTCTime.wMilliseconds);

    QDateTime dateTime(date, time, Qt::UTC);

    QGeoPositionInfo pos(coordinate, dateTime);

    // The following properties are optional, and so are set if the data is present and valid in
    // the GPS_POSITION structure.
    if ((data.dwValidFields & GPS_VALID_SPEED) != 0)
        pos.setAttribute(QGeoPositionInfo::GroundSpeed, data.flSpeed);

    if ((data.dwValidFields & GPS_VALID_HEADING) != 0)
        pos.setAttribute(QGeoPositionInfo::Direction, data.flHeading);

    if ((data.dwValidFields & GPS_VALID_MAGNETIC_VARIATION) != 0)
        pos.setAttribute(QGeoPositionInfo::MagneticVariation, data.dblMagneticVariation);

    lastPosition = pos;
    emit positionUpdated(pos);
}
开发者ID:robclark,项目名称:qtmobility-1.1.0,代码行数:42,代码来源:qgeopositioninfosource_wince.cpp


示例15: positionUpdated

void QGeoPositionInfoSourceAndroid::processPositionUpdate(const QGeoPositionInfo &pInfo)
{
    //single update request and served as part of regular update
    if (m_requestTimer.isActive())
        m_requestTimer.stop();

    emit positionUpdated(pInfo);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:8,代码来源:qgeopositioninfosource_android.cpp


示例16: QObject

GPSTracker::GPSTracker(QObject *parent) :
    QObject(parent) {
    geoPositionInfoSource = QGeoPositionInfoSource::createDefaultSource(this);
    // emit funktioniert erst nach dem Konstruktor
    if(geoPositionInfoSource) {
        connect(geoPositionInfoSource, SIGNAL(positionUpdated(QGeoPositionInfo)),
                this, SLOT(positionUpdated(QGeoPositionInfo)));
        connect(geoPositionInfoSource, SIGNAL(updateTimeout()),
                this, SLOT(updateTimeout()));
        changeGPSStatus(INACTIVE);
    } else {
        changeGPSStatus(ERROR);
    }

    trackingInterval = 500;
    tracking = false;
}
开发者ID:idaohang,项目名称:GPS-Tracker,代码行数:17,代码来源:gpstracker.cpp


示例17: var_GetInteger

void InputManager::UpdatePosition()
{
    /* Update position */
    int64_t i_length = var_GetInteger(  p_input , "length" );
    int64_t i_time = var_GetInteger(  p_input , "time");
    float f_pos = var_GetFloat(  p_input , "position" );
    emit positionUpdated( f_pos, i_time, i_length / CLOCK_FREQ );
}
开发者ID:DaemonSnake,项目名称:vlc,代码行数:8,代码来源:input_manager.cpp


示例18: positionUpdated

void QGeoPositionInfoSourceSimulator::updatePosition()
{
    if (qtPositionInfo()->enabled) {
        lastPosition = Simulator::toPositionInfo(*qtPositionInfo());
        emit positionUpdated(lastPosition);
    } else {
        emit updateTimeout();
    }
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:9,代码来源:qgeopositioninfosource_simulator.cpp


示例19: addPosition

void GPSTracker::positionUpdated(QGeoPositionInfo position) {
    if(tracking){
        addPosition(position);
    }
    emit positionUpdated(Point(position));
    horizontalAccuracy = position.attribute(QGeoPositionInfo::HorizontalAccuracy);
    verticalAccuracy   = position.attribute(QGeoPositionInfo::VerticalAccuracy);
    changeGPSStatus(RECEIVE);
}
开发者ID:idaohang,项目名称:GPS-Tracker,代码行数:9,代码来源:gpstracker.cpp


示例20: msg_Dbg

/* delete Input if it ever existed.
   Delete the callbacls on input
   p_input is released once here */
void InputManager::delInput()
{
    if( !p_input ) return;
    msg_Dbg( p_intf, "IM: Deleting the input" );

    /* Save time / position */
    float f_pos = var_GetFloat( p_input , "position" );
    int64_t i_time = var_GetTime( p_input, "time");
    int i_length = var_GetTime( p_input , "length" ) / CLOCK_FREQ;
    if( f_pos < 0.05 || f_pos > 0.95 || i_length < 60) {
        i_time = -1;
    }
    RecentsMRL::getInstance( p_intf )->setTime( p_item->psz_uri, i_time );

    delCallbacks();
    i_old_playing_status = END_S;
    p_item               = NULL;
    oldName              = "";
    artUrl               = "";
    b_video              = false;
    timeA                = 0;
    timeB                = 0;
    f_rate               = 0. ;

    if( p_input_vbi )
    {
        vlc_object_release( p_input_vbi );
        p_input_vbi = NULL;
    }

    vlc_object_release( p_input );
    p_input = NULL;

    emit positionUpdated( -1.0, 0 ,0 );
    emit rateChanged( var_InheritFloat( p_intf, "rate" ) );
    emit nameChanged( "" );
    emit chapterChanged( 0 );
    emit titleChanged( 0 );
    emit playingStatusChanged( END_S );

    emit teletextPossible( false );
    emit AtoBchanged( false, false );
    emit voutChanged( false );
    emit voutListChanged( NULL, 0 );

    /* Reset all InfoPanels but stats */
    emit artChanged( NULL );
    emit artChanged( "" );
    emit infoChanged( NULL );
    emit currentMetaChanged( (input_item_t *)NULL );

    emit encryptionChanged( false );
    emit recordingStateChanged( false );

    emit cachingChanged( 1 );
}
开发者ID:Kubink,项目名称:vlc,代码行数:59,代码来源:input_manager.cpp



注:本文中的positionUpdated函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ position_ok函数代码示例发布时间:2022-05-30
下一篇:
C++ pos_type函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap