Logo Search packages:      
Sourcecode: kdenlive version File versions  Download package

QCursor TrackPanelClipResizeFunction::getMouseCursor ( Gui::KTrackPanel panel,
QMouseEvent *  event 
) [virtual]

Returns a relevant mouse cursor for the given mouse position

Implements TrackPanelFunction.

Definition at line 78 of file trackpanelclipresizefunction.cpp.

References Gui::KTrackPanel::documentTrackIndex(), KdenliveDoc::framesPerSecond(), DocTrackBase::getClipAt(), Gui::KTrackPanel::hasDocumentTrackIndex(), Gui::KTimeLine::mapLocalToValue(), Gui::KTimeLine::mapValueToLocal(), and KdenliveDoc::track().

{

    if (panel->hasDocumentTrackIndex()) {
      DocTrackBase *track =
          m_document->track(panel->documentTrackIndex());
      if (track) {
            GenTime mouseTime((int)m_timeline->mapLocalToValue(event->x()),
            m_document->framesPerSecond());
          DocClipRef *clip = track->getClipAt(mouseTime);
          if (clip) {
            if (event->x() <= (m_timeline->mapValueToLocal(clip->trackStart().
                      frames(m_document->framesPerSecond())) + s_resizeTolerance)) {
                return m_startCursor;
            }
            if (event->x() >= (m_timeline->mapValueToLocal((clip->trackEnd()).
                      frames(m_document->framesPerSecond())) - s_resizeTolerance)) {
                return m_endCursor;
            }
          }
      }
    }

    //return QCursor(Qt::SizeHorCursor);
}


Generated by  Doxygen 1.6.0   Back to index