Esempio n. 1
0
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();
	}
}
Esempio n. 2
0
void MovieSynchronizer::swapTiles()
{
    TiledSynchronizer::swapTiles();

    if (!_updater->isPaused() || _updater->isSkipping())
    {
        _fpsCounter.tick();
        emit statisticsChanged();
        emit sliderPositionChanged();
    }
}
Esempio n. 3
0
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);
}
Esempio n. 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();
}