void ScenarioViewInterface::on_timeNodeMoved(const TimeNodePresenter &timenode)
{
    auto h = m_presenter->m_view->boundingRect().height();
    timenode.view()->setExtent(timenode.model().extent() * h);

    timenode.view()->setPos({timenode.model().date().msec() / m_presenter->m_zoomRatio,
                             timenode.model().extent().top() * h});

    m_presenter->m_view->update();
}
Пример #2
0
TimeNodeView::TimeNodeView(TimeNodePresenter& presenter,
                           QGraphicsObject* parent) :
    QGraphicsObject {parent},
    m_presenter{presenter}
{
    this->setParentItem(parent);
    this->setZValue(1);
    this->setAcceptHoverEvents(true);
    this->setCursor(Qt::CrossCursor);

    m_color = presenter.model().metadata.color();
}