diff --git a/src/library/librarycontrol.cpp b/src/library/librarycontrol.cpp index dd669251ee7..b0c74e5c77d 100644 --- a/src/library/librarycontrol.cpp +++ b/src/library/librarycontrol.cpp @@ -829,10 +829,16 @@ void LibraryControl::slotMoveTrackBackward(double v) { } void LibraryControl::slotMoveTrack(double v) { + if (!m_pLibraryWidget) { + return; + } + const auto key = (v < 0) ? Qt::Key_Up : Qt::Key_Down; const auto times = static_cast(std::abs(v)); - emitKeyEvent(QKeyEvent{ - QEvent::KeyPress, key, Qt::AltModifier, QString(), false, times}); + QKeyEvent event = QKeyEvent{ + QEvent::KeyPress, key, Qt::AltModifier, QString(), false, times}; + QApplication::sendEvent(m_pLibraryWidget, &event); + } void LibraryControl::emitKeyEvent(QKeyEvent&& event) {