QAction *delAllGuides = m_contextMenu->addAction(KIcon("edit-delete"), i18n("Delete All Guides"));
connect(delAllGuides, SIGNAL(triggered()), m_view, SLOT(slotDeleteAllGuides()));
m_goMenu = m_contextMenu->addMenu(i18n("Go To"));
- connect(m_goMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotGoToGuide(QAction *)));
+ connect(m_goMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotGoToGuide(QAction*)));
setMouseTracking(true);
}
// virtual
void CustomRuler::mouseMoveEvent(QMouseEvent * event)
{
+ int mappedXPos = (int)((event->x() + offset()) / m_factor);
+ emit mousePosition(mappedXPos);
if (event->buttons() == Qt::LeftButton) {
int pos;
if (m_moveCursor == RULER_START || m_moveCursor == RULER_END) {
- pos = m_view->getSnapPointForPos((int)((event->x() + offset()) / m_factor));
- } else pos = (int)((event->x() + offset()) / m_factor);
+ pos = m_view->getSnapPointForPos(mappedXPos);
+ } else pos = mappedXPos;
int zoneStart = m_zoneStart;
int zoneEnd = m_zoneEnd;
if (pos < 0) pos = 0;
void CustomRuler::wheelEvent(QWheelEvent * e)
{
int delta = 1;
+ m_view->activateMonitor();
if (e->modifiers() == Qt::ControlModifier) delta = m_timecode.fps();
if (e->delta() < 0) delta = 0 - delta;
m_view->moveCursorPos(delta);