예제 #1
0
파일: graphview.cpp 프로젝트: tumic0/GPXSee
void GraphView::loadGraph(const Graph &graph, PathItem *path, int id)
{
	if (graph.size() < 2)
		return;

	GraphItem *gi = new GraphItem(graph);
	gi->setGraphType(_graphType);
	gi->setId(id);
	gi->setColor(_palette.nextColor());
	gi->setWidth(_width);

	connect(this, SIGNAL(sliderPositionChanged(qreal)), gi,
	  SLOT(emitSliderPositionChanged(qreal)));
	connect(gi, SIGNAL(sliderPositionChanged(qreal)), path,
	  SLOT(moveMarker(qreal)));
	connect(path, SIGNAL(selected(bool)), gi, SLOT(selected(bool)));

	_graphs.append(gi);

	if (!_hide.contains(id)) {
		_visible.append(gi);
		_scene->addItem(gi);
		_bounds |= gi->bounds();
		setXUnits();
	}
}
예제 #2
0
void MovieSynchronizer::swapTiles()
{
    TiledSynchronizer::swapTiles();

    if (!_updater->isPaused() || _updater->isSkipping())
    {
        _fpsCounter.tick();
        emit statisticsChanged();
        emit sliderPositionChanged();
    }
}
예제 #3
0
파일: graphview.cpp 프로젝트: tumic0/GPXSee
void GraphView::emitSliderPositionChanged(const QPointF &pos)
{
	if (_slider->area().width() <= 0)
		return;

	_sliderPos = (pos.x() / _slider->area().width()) * bounds().width();
	_sliderPos = qMax(_sliderPos, bounds().left());
	_sliderPos = qMin(_sliderPos, bounds().right());
	updateSliderPosition();

	emit sliderPositionChanged(_sliderPos);
}
예제 #4
0
void MovieSynchronizer::update(const Window& window, const QRectF& visibleArea)
{
    if (_updater->isSkipping())
        emit sliderPositionChanged();

    // Tiles area corresponds to Content dimensions for Movies
    const auto tilesSurface = window.getContent().getDimensions();
    const auto visibleTilesArea =
        ZoomHelper{window}.toTilesArea(visibleArea, tilesSurface);

    if (_visibleTilesArea == visibleTilesArea)
        return;

    _visibleTilesArea = visibleTilesArea;
    markTilesDirty();
}