mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-30 18:34:23 +02:00
Fixed the instant-resize-after-first-load issue
This commit is contained in:
@ -34,32 +34,37 @@ void SpeedGraph::setInfo()
|
||||
clearInfo();
|
||||
}
|
||||
|
||||
void SpeedGraph::loadData(const Data &data, const QList<PathItem *> &paths)
|
||||
QList<GraphItem*> SpeedGraph::loadData(const Data &data)
|
||||
{
|
||||
QList<GraphItem*> graphs;
|
||||
|
||||
for (int i = 0; i < data.tracks().count(); i++) {
|
||||
const Track *track = data.tracks().at(i);
|
||||
const Graph &graph = track->speed();
|
||||
|
||||
if (graph.size() < 2) {
|
||||
skipColor();
|
||||
continue;
|
||||
graphs.append(0);
|
||||
} else {
|
||||
SpeedGraphItem *gi = new SpeedGraphItem(graph, _graphType,
|
||||
track->movingTime());
|
||||
gi->setTimeType(_timeType);
|
||||
GraphView::addGraph(gi);
|
||||
_avg.append(QPointF(track->distance(), gi->avg()));
|
||||
_mavg.append(QPointF(track->distance(), gi->mavg()));
|
||||
graphs.append(gi);
|
||||
}
|
||||
|
||||
SpeedGraphItem *gi = new SpeedGraphItem(graph, _graphType,
|
||||
track->movingTime());
|
||||
gi->setTimeType(_timeType);
|
||||
GraphView::addGraph(gi, paths.at(i));
|
||||
|
||||
_avg.append(QPointF(track->distance(), gi->avg()));
|
||||
_mavg.append(QPointF(track->distance(), gi->mavg()));
|
||||
}
|
||||
|
||||
for (int i = 0; i < data.routes().count(); i++)
|
||||
for (int i = 0; i < data.routes().count(); i++) {
|
||||
skipColor();
|
||||
graphs.append(0);
|
||||
}
|
||||
|
||||
setInfo();
|
||||
|
||||
redraw();
|
||||
|
||||
return graphs;
|
||||
}
|
||||
|
||||
qreal SpeedGraph::avg() const
|
||||
|
Reference in New Issue
Block a user