void RoutingModel::clear() { d->m_route = Route(); beginResetModel(); endResetModel(); emit currentRouteChanged(); }
bool RoutingPlugin::eventFilter( QObject *object, QEvent *e ) { if ( d->m_marbleWidget || !enabled() || !visible() ) { return AbstractFloatItem::eventFilter( object, e ); } MarbleWidget *widget = dynamic_cast<MarbleWidget*> ( object ); if ( widget && !d->m_marbleWidget ) { d->m_marbleWidget = widget; d->m_routingModel = d->m_marbleWidget->model()->routingManager()->routingModel(); connect( d->m_widget.routingButton, SIGNAL(clicked(bool)), this, SLOT(toggleGuidanceMode(bool)) ); connect( d->m_widget.gpsButton, SIGNAL(clicked(bool)), this, SLOT(togglePositionTracking(bool)) ); connect( d->m_widget.zoomInButton, SIGNAL(clicked()), d->m_marbleWidget, SLOT(zoomIn()) ); connect( d->m_widget.zoomOutButton, SIGNAL(clicked()), d->m_marbleWidget, SLOT(zoomOut()) ); connect( d->m_marbleWidget, SIGNAL(themeChanged(QString)), this, SLOT(updateZoomButtons()) ); connect( d->m_marbleWidget, SIGNAL(zoomChanged(int)), this, SLOT(updateZoomButtons(int)) ); connect( d->m_routingModel, SIGNAL(currentRouteChanged()), this, SLOT(updateGuidanceModeButton()) ); d->updateGuidanceModeButton(); }
void RoutingModel::setRoute( const Route &route ) { d->m_route = route; d->m_deviation = RoutingModelPrivate::Unknown; beginResetModel(); endResetModel(); emit currentRouteChanged(); }