mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-02-26 04:00:49 +01:00
Graphtab->mapview connections can be permanent
(no need to recreate them on every graph change)
This commit is contained in:
parent
48dcc6655b
commit
ddc0e60517
@ -679,7 +679,8 @@ void GUI::createGraphTabs()
|
|||||||
_tabs.append(new TemperatureGraph(_graphTabWidget));
|
_tabs.append(new TemperatureGraph(_graphTabWidget));
|
||||||
_tabs.append(new GearRatioGraph(_graphTabWidget));
|
_tabs.append(new GearRatioGraph(_graphTabWidget));
|
||||||
|
|
||||||
connect(_tabs.first(), SIGNAL(sliderPositionChanged(qreal)), _mapView,
|
for (int i = 0; i < _tabs.size(); i++)
|
||||||
|
connect(_tabs.at(i), SIGNAL(sliderPositionChanged(qreal)), _mapView,
|
||||||
SLOT(setMarkerPosition(qreal)));
|
SLOT(setMarkerPosition(qreal)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1726,17 +1727,11 @@ void GUI::graphChanged(int index)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
GraphTab *gt = static_cast<GraphTab*>(_graphTabWidget->widget(index));
|
GraphTab *gt = static_cast<GraphTab*>(_graphTabWidget->widget(index));
|
||||||
|
|
||||||
_mapView->setGraph(_tabs.indexOf(gt));
|
_mapView->setGraph(_tabs.indexOf(gt));
|
||||||
|
|
||||||
if (_lastGraphTab)
|
|
||||||
disconnect(_lastGraphTab, SIGNAL(sliderPositionChanged(qreal)),
|
|
||||||
_mapView, SLOT(setMarkerPosition(qreal)));
|
|
||||||
connect(gt, SIGNAL(sliderPositionChanged(qreal)), _mapView,
|
|
||||||
SLOT(setMarkerPosition(qreal)));
|
|
||||||
|
|
||||||
if (_lastGraphTab)
|
if (_lastGraphTab)
|
||||||
gt->setSliderPosition(_lastGraphTab->sliderPosition());
|
gt->setSliderPosition(_lastGraphTab->sliderPosition());
|
||||||
|
|
||||||
_lastGraphTab = gt;
|
_lastGraphTab = gt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user