Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle signature changes for nativeEventFilter for qt6 #7254

Merged
merged 78 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
42a2f19
refactored gui_templates.h
Rossmaxx Mar 24, 2024
573177a
experimental qt6 support enabled
Rossmaxx Mar 24, 2024
9143a05
oops
Rossmaxx Mar 24, 2024
f3aaeb5
added some qt6 flags
Rossmaxx Mar 24, 2024
3dad2b8
remotevst
Rossmaxx Mar 24, 2024
1a11e9c
missed this on src/cmakelist
Rossmaxx Mar 24, 2024
9ca4132
fixup lmms_wrap_cpp and lmms_wrap_ui
Rossmaxx Mar 27, 2024
eebe551
another minor one
Rossmaxx Mar 27, 2024
ef13bcb
bump up minor version
Rossmaxx Mar 27, 2024
a596216
generation success
Rossmaxx Mar 28, 2024
5bc0cf9
Revert "refactored gui_templates.h"
Rossmaxx Mar 28, 2024
72a7985
Merge branch 'LMMS:master' into experiment-qt6
Rossmaxx Mar 28, 2024
5f7530c
remove the useless QTDIR variable
Rossmaxx Mar 28, 2024
09de46e
does this fix it?
Rossmaxx Mar 28, 2024
a2d83dc
added status check for qt6
Rossmaxx Mar 30, 2024
aa22ef5
alignment
Rossmaxx Mar 30, 2024
e8119ea
Merge branch 'LMMS:master' into experiment-qt6
Rossmaxx Mar 30, 2024
f79b490
status_vst
Rossmaxx Mar 30, 2024
c77b93b
Merge branch 'master' into experiment-qt6
Rossmaxx Apr 6, 2024
74f1835
replace qt5_wrap_ui with cmake_autouic
Rossmaxx Apr 8, 2024
46bd6b7
moved ui files
Rossmaxx Apr 8, 2024
9470abc
Merge branch 'remove-qt5-wrap-ui' into experiment-qt6
Rossmaxx Apr 10, 2024
bba21f9
try to fix the rcc error
Rossmaxx Apr 10, 2024
faae414
rpmalloc
Rossmaxx Apr 10, 2024
46fdf26
declare cpp 17 explicitly
Rossmaxx Apr 10, 2024
5bd8290
reorder cpp 17 call
Rossmaxx Apr 10, 2024
5057356
temp
Rossmaxx Apr 10, 2024
bfb438b
lmmsobjs
Rossmaxx Apr 10, 2024
1bee307
permissive
Rossmaxx Apr 10, 2024
74712d3
quotes
Rossmaxx Apr 10, 2024
6b8ec51
cleanup
Rossmaxx Apr 10, 2024
8d78274
Merge branch 'master' of https://github.com/Rossmaxx/lmms into experi…
Rossmaxx Apr 10, 2024
9d85660
Revert unnecessary autoui changes
Rossmaxx Apr 10, 2024
853cffa
Revert "does this fix it?"
Rossmaxx Apr 10, 2024
263cfa8
try to use older cmake
Rossmaxx Apr 10, 2024
077dfa4
Revert "reorder cpp 17 call"
Rossmaxx Apr 10, 2024
f8284e8
freeboy
Rossmaxx Apr 10, 2024
753b2a9
made comment clearer
Rossmaxx Apr 10, 2024
1d6a892
try removing the explicit call
Rossmaxx Apr 10, 2024
bb4d04b
Make the minimum code compile for Qt6
michaelgregorius Apr 11, 2024
52689c3
Qt 5 support
Rossmaxx Apr 13, 2024
3a83aea
Fix Qt5 build for ControlLayout
michaelgregorius Apr 13, 2024
2e736ec
Prepare LadspaMatrixControlDialog for Qt6
michaelgregorius Apr 13, 2024
835310e
CMakeLists.txt adjustments for Qt6
michaelgregorius Apr 13, 2024
c262ac2
force qt 5 on vst for now
Rossmaxx Apr 14, 2024
ea8f8c3
Switch to "using" instead of "typedef"
michaelgregorius Apr 14, 2024
9085f05
Merge branch 'master' into experiment-qt6
Rossmaxx Apr 20, 2024
6f85e45
cleanup qt5compat finding code
Rossmaxx Apr 20, 2024
684afdb
Fix build
michaelgregorius Apr 20, 2024
c456470
Fix warnings in AutomationClip.cpp
michaelgregorius Apr 20, 2024
820a88e
Fix warning in AutomationClipView
michaelgregorius Apr 20, 2024
66ec096
Fix deprecated usage of x() and y() methods
michaelgregorius Apr 20, 2024
f2638ae
Fix more iterator operator warnings
michaelgregorius Apr 20, 2024
0f83043
Fix QKeyCombination warning
michaelgregorius Apr 20, 2024
70ede88
added minimum version check
Rossmaxx Apr 24, 2024
2abe82a
Merge branch 'LMMS:master' into experiment-qt6
Rossmaxx Apr 24, 2024
7161377
style changes
Rossmaxx Apr 24, 2024
1906ea5
zyn build fix for msvc qt6
Rossmaxx Apr 24, 2024
2209c3e
forgot to rename to zyn
Rossmaxx Apr 24, 2024
cf40e74
finally fixed zyn for msvc
Rossmaxx Apr 24, 2024
2bd862a
Add experimental Qt 6 support flags. (#7182)
Rossmaxx Apr 25, 2024
52c15d3
Merge remote-tracking branch 'upstream/master' into qt6
DomClark Apr 27, 2024
d08d6ba
Fix Qt6 DMG on Apple (#7240)
tresf May 7, 2024
ae031ad
pulled from upstream qt6
Rossmaxx May 13, 2024
faada51
fixup nativeEventFilter on windows
Rossmaxx May 13, 2024
bd82ca7
check namespace
Rossmaxx May 13, 2024
ad8ff79
fix typecast
Rossmaxx May 13, 2024
320d03a
fixed dom's comment
Rossmaxx May 17, 2024
e973864
headers
Rossmaxx May 17, 2024
118efbd
Merge branch 'qt6' into experiment-qt6
tresf May 17, 2024
d3fee47
Fix formatting after rebase
tresf May 17, 2024
5cbb349
Addressed code review
Rossmaxx May 18, 2024
0858a4d
fixed dom's comment
Rossmaxx May 17, 2024
d8e614d
headers
Rossmaxx May 17, 2024
516128c
win32EventFilter
Rossmaxx May 19, 2024
f9e9af6
botched git so had to copy paste again
Rossmaxx May 19, 2024
87c7518
missed the header again
Rossmaxx May 19, 2024
54258ff
Missed function call
Rossmaxx May 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 40 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ option(WANT_DEBUG_TSAN "Enable ThreadSanitizer" OFF)
option(WANT_DEBUG_MSAN "Enable MemorySanitizer" OFF)
option(WANT_DEBUG_UBSAN "Enable UndefinedBehaviorSanitizer" OFF)
OPTION(BUNDLE_QT_TRANSLATIONS "Install Qt translation files for LMMS" OFF)
option(WANT_QT6 "Build with experimental Qt6 support" OFF)


IF(LMMS_BUILD_APPLE)
Expand Down Expand Up @@ -179,30 +180,54 @@ check_library_exists(rt shm_open "" LMMS_HAVE_LIBRT)

LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")

FIND_PACKAGE(Qt5 5.9.0 COMPONENTS Core Gui Widgets Xml REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS LinguistTools QUIET)
IF(WANT_QT6)
MESSAGE("Building with Qt6 is experimental, not guaranteed to succeed")
SET(QT_VERSION_MAJOR 6)
SET(LMMS_QT_MIN_VERSION 6.0.0)
SET(WANT_VST OFF)
SET(STATUS_VST "VSTs not supported with Qt 6")
SET(STATUS_QT6 "ENABLED")
ELSE()
SET(QT_VERSION_MAJOR 5)
SET(LMMS_QT_MIN_VERSION 5.9.0)
SET(STATUS_QT6 "NOT ENABLED")
ENDIF()

FIND_PACKAGE(Qt${QT_VERSION_MAJOR} ${LMMS_QT_MIN_VERSION} COMPONENTS Core Gui Widgets Xml REQUIRED)
FIND_PACKAGE(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools QUIET)

INCLUDE_DIRECTORIES(
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Gui_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Xml_INCLUDE_DIRS}
)

SET(QT_LIBRARIES
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Xml
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Xml
)

IF(WANT_QT6)
# Core5Compat is needed so that we get QTextCodec which is used by
# the Hydrogen importer plugin.
# TODO : fix hydrogen importer plugin with qt6
# See: https://doc.qt.io/qt-6/qtcore5-index.html
FIND_PACKAGE(Qt6 COMPONENTS Core5Compat REQUIRED)
INCLUDE_DIRECTORIES(${Qt6Core5Compat_INCLUDE_DIRS})
SET(QT_LIBRARIES ${QT_LIBRARIES} Qt6::Core5Compat)
ENDIF()

IF(LMMS_BUILD_LINUX AND WANT_VST)
# Todo, enable qt6 for vst support
FIND_PACKAGE(Qt5 COMPONENTS X11Extras REQUIRED)
LIST(APPEND QT_LIBRARIES Qt5::X11Extras)
ENDIF()

# Resolve Qt5::qmake to full path for use in packaging scripts
GET_TARGET_PROPERTY(QT_QMAKE_EXECUTABLE "${Qt5Core_QMAKE_EXECUTABLE}" IMPORTED_LOCATION)
# Resolve qmake to full path for use in packaging scripts
GET_TARGET_PROPERTY(QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)

# Find the location of Qt translation files
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_TRANSLATIONS
Expand All @@ -215,8 +240,8 @@ IF(EXISTS "${QT_TRANSLATIONS_DIR}")
ADD_DEFINITIONS("-DQT_TRANSLATIONS_DIR=\"${QT_TRANSLATIONS_DIR}\"")
ENDIF()

FIND_PACKAGE(Qt5Test)
SET(QT_QTTEST_LIBRARY Qt5::Test)
FIND_PACKAGE(Qt${QT_VERSION_MAJOR}Test)
SET(QT_QTTEST_LIBRARY Qt${QT_VERSION_MAJOR}::Test)

# check for libsndfile
FIND_PACKAGE(SndFile REQUIRED)
Expand Down Expand Up @@ -890,6 +915,7 @@ MESSAGE(
"* Debug using ThreadSanitizer : ${STATUS_DEBUG_TSAN}\n"
"* Debug using MemorySanitizer : ${STATUS_DEBUG_MSAN}\n"
"* Debug using UBSanitizer : ${STATUS_DEBUG_UBSAN}\n"
"* Experimental Qt6 support : ${STATUS_QT6}\n"
)

MESSAGE(
Expand Down
3 changes: 3 additions & 0 deletions cmake/apple/install_apple.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ echo -e "$MSG_COLOR\n\nCreating App Bundle \"$APP\"...$COLOR_RESET"
qtpath="$(dirname "@QT_QMAKE_EXECUTABLE@")"
export PATH="$PATH:$qtpath"

# Qt6: Fix @rpath bug https://github.com/orgs/Homebrew/discussions/2823
ln -sf "$qtpath/../lib" "@CMAKE_BINARY_DIR@/lib"

# Remove any old .app bundles
rm -Rf "$APP"

Expand Down
2 changes: 1 addition & 1 deletion cmake/install/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SET(PLUGIN_FILES "")
IF(LMMS_BUILD_WIN32)
INSTALL(FILES $<TARGET_FILE:Qt5::QWindowsIntegrationPlugin> DESTINATION platforms)
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin> DESTINATION platforms)
ENDIF()

IF(LMMS_BUILD_WIN32 OR LMMS_INSTALL_DEPENDENCIES)
Expand Down
8 changes: 6 additions & 2 deletions cmake/modules/BuildPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
ADD_GEN_QRC(RCC_OUT "${PLUGIN_NAME}.qrc" PREFIX artwork/${PLUGIN_NAME} ${PLUGIN_EMBEDDED_RESOURCES})
ENDIF(ER_LEN)

QT5_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
IF(WANT_QT6)
QT6_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
ELSE()
QT5_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
ENDIF()

FOREACH(f ${PLUGIN_SOURCES})
ADD_FILE_DEPENDENCIES(${f} ${RCC_OUT})
Expand All @@ -55,7 +59,7 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)

ADD_LIBRARY(${PLUGIN_NAME} ${PLUGIN_LINK} ${PLUGIN_SOURCES} ${plugin_MOC_out} ${RCC_OUT})

target_link_libraries("${PLUGIN_NAME}" lmms Qt5::Widgets Qt5::Xml)
target_link_libraries("${PLUGIN_NAME}" lmms Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml)

INSTALL(TARGETS ${PLUGIN_NAME}
LIBRARY DESTINATION "${PLUGIN_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/GenQrc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function(add_gen_qrc RCC_OUT QRC_NAME)
# generators. See issue #6177.
add_custom_command(
OUTPUT "${CPP_FILE}"
COMMAND Qt5::rcc
COMMAND Qt${QT_VERSION_MAJOR}::rcc
--name "${RESOURCE_NAME}"
--output "${CPP_FILE}"
"${QRC_FILE}"
Expand Down
4 changes: 2 additions & 2 deletions data/locale/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SET(QT_LUPDATE_EXECUTABLE "${Qt5_LUPDATE_EXECUTABLE}")
SET(QT_LRELEASE_EXECUTABLE "${Qt5_LRELEASE_EXECUTABLE}")
SET(QT_LUPDATE_EXECUTABLE "${Qt${QT_VERSION_MAJOR}_LUPDATE_EXECUTABLE}")
SET(QT_LRELEASE_EXECUTABLE "${Qt${QT_VERSION_MAJOR}_LRELEASE_EXECUTABLE}")

IF(QT_LUPDATE_EXECUTABLE STREQUAL "")
EXECUTE_PROCESS(COMMAND "lupdate" "-help" RESULT_VARIABLE LUPDATE_FALLBACK OUTPUT_QUIET)
Expand Down
3 changes: 1 addition & 2 deletions include/ColorChooser.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ class ColorChooser : public QColorDialog
//! Forward key events to the parent to prevent stuck notes when the dialog gets focus
void keyReleaseEvent(QKeyEvent *event) override
{
QKeyEvent ke(*event);
QApplication::sendEvent(parentWidget(), &ke);
QApplication::sendEvent(parentWidget(), event);
}
private:
//! Copy the current QColorDialog palette into an array
Expand Down
18 changes: 12 additions & 6 deletions include/ColorHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,22 @@ class ColorHelper
public:
static QColor interpolateInRgb(const QColor& a, const QColor& b, float t)
{
qreal ar, ag, ab, aa;
#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0))
using colorType = float;
#else
using colorType = qreal;
#endif

colorType ar, ag, ab, aa;
a.getRgbF(&ar, &ag, &ab, &aa);

qreal br, bg, bb, ba;
colorType br, bg, bb, ba;
b.getRgbF(&br, &bg, &bb, &ba);

const float interH = lerp(ar, br, t);
const float interS = lerp(ag, bg, t);
const float interV = lerp(ab, bb, t);
const float interA = lerp(aa, ba, t);
const colorType interH = lerp(ar, br, t);
const colorType interS = lerp(ag, bg, t);
const colorType interV = lerp(ab, bb, t);
const colorType interA = lerp(aa, ba, t);

return QColor::fromRgbF(interH, interS, interV, interA);
}
Expand Down
12 changes: 10 additions & 2 deletions include/ControlLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ class ControlLayout : public QLayout
{
Q_OBJECT

#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0))
using ControlLayoutMap = QMultiMap<QString, QLayoutItem *>;
using ControlLayoutMapIterator = QMultiMapIterator<QString, QLayoutItem *>;
#else
using ControlLayoutMap = QMap<QString, QLayoutItem*>;
using ControlLayoutMapIterator = QMapIterator<QString, QLayoutItem*>;
#endif

public:
explicit ControlLayout(QWidget *parent,
int margin = -1, int hSpacing = -1, int vSpacing = -1);
Expand Down Expand Up @@ -126,9 +134,9 @@ private slots:
private:
int doLayout(const QRect &rect, bool testOnly) const;
int smartSpacing(QStyle::PixelMetric pm) const;
QMap<QString, QLayoutItem *>::const_iterator pairAt(int index) const;
ControlLayoutMap::const_iterator pairAt(int index) const;

QMultiMap<QString, QLayoutItem *> m_itemMap;
ControlLayoutMap m_itemMap;
int m_hSpace;
int m_vSpace;
// relevant dimension is width, as later, heightForWidth() will be called
Expand Down
30 changes: 30 additions & 0 deletions include/DeprecationHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,36 @@ inline QPoint position(QWheelEvent *wheelEvent)
#endif
}

/**
* @brief position is a backwards-compatible adapter for
* QMouseEvent::position and pos functions.
* @param me
* @return the position of the mouse event
*/
inline QPoint position(QMouseEvent* me)
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
return me->position().toPoint();
#else
return me->pos();
#endif
}

/**
* @brief position is a backwards-compatible adapter for
* QDropEvent::position and pos functions.
* @param me
* @return the position of the drop event
*/
inline QPoint position(QDropEvent* de)
{
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
return de->position().toPoint();
#else
return de->pos();
#endif
}

} // namespace lmms

#endif // LMMS_DEPRECATIONHELPER_H
5 changes: 5 additions & 0 deletions include/FloatModelEditorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ class LMMS_EXPORT FloatModelEditorBase : public QWidget, public FloatModelView
void paintEvent(QPaintEvent * me) override;
void wheelEvent(QWheelEvent * me) override;

// Todo : cleanup once we drop QT5 support
#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0))
void enterEvent(QEnterEvent *event) override;
#else
void enterEvent(QEvent *event) override;
#endif
void leaveEvent(QEvent *event) override;

virtual float getValue(const QPoint & p);
Expand Down
12 changes: 8 additions & 4 deletions include/MainApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ class MainApplication : public QApplication
MainApplication(int& argc, char** argv);
bool event(QEvent* event) override;
#ifdef LMMS_BUILD_WIN32
bool winEventFilter(MSG* msg, long* result);
bool nativeEventFilter(const QByteArray& eventType, void* message,
long* result);
#endif
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
using FilterResult = long;
#else
using FilterResult = qintptr;
#endif // QT6 check
bool winEventFilter(MSG* msg, FilterResult* result);
bool nativeEventFilter(const QByteArray& eventType, void* message, FilterResult* result);
#endif // LMMS_BUILD_WIN32
inline QString& queuedFile()
{
return m_queuedFile;
Expand Down
7 changes: 6 additions & 1 deletion include/PluginBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ class PluginDescWidget : public QWidget
void openInNewInstrumentTrack(QString value);

protected:
void enterEvent( QEvent * _e ) override;
// Todo : cleanup once QT 5 support is dropped
#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0))
void enterEvent( QEnterEvent * _e) override;
#else
void enterEvent(QEvent* _e) override;
#endif
void leaveEvent( QEvent * _e ) override;
void mousePressEvent( QMouseEvent * _me ) override;
void paintEvent( QPaintEvent * _pe ) override;
Expand Down
23 changes: 15 additions & 8 deletions plugins/AudioFileProcessor/AudioFileProcessorWaveView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "AudioFileProcessorWaveView.h"

#include "ConfigManager.h"
#include "DeprecationHelper.h"
#include "gui_templates.h"
#include "SampleWaveform.h"

Expand Down Expand Up @@ -113,10 +114,12 @@ void AudioFileProcessorWaveView::leaveEvent(QEvent * e)

void AudioFileProcessorWaveView::mousePressEvent(QMouseEvent * me)
{
const auto pos = position(me);

m_isDragging = true;
m_draggingLastPoint = me->pos();

const int x = me->x();
const int x = pos.x();

const int start_dist = qAbs(m_startFrameX - x);
const int end_dist = qAbs(m_endFrameX - x);
Expand Down Expand Up @@ -154,7 +157,9 @@ void AudioFileProcessorWaveView::mouseMoveEvent(QMouseEvent * me)
return;
}

const int step = me->x() - m_draggingLastPoint.x();
const auto pos = position(me);

const int step = pos.x() - m_draggingLastPoint.x();
switch(m_draggingType)
{
case DraggingType::SampleStart:
Expand All @@ -168,14 +173,14 @@ void AudioFileProcessorWaveView::mouseMoveEvent(QMouseEvent * me)
break;
case DraggingType::Wave:
default:
if (qAbs(me->y() - m_draggingLastPoint.y())
< 2 * qAbs(me->x() - m_draggingLastPoint.x()))
if (qAbs(pos.y() - m_draggingLastPoint.y())
< 2 * qAbs(pos.x() - m_draggingLastPoint.x()))
{
slide(step);
}
else
{
zoom(me->y() < m_draggingLastPoint.y());
zoom(pos.y() < m_draggingLastPoint.y());
}
}

Expand Down Expand Up @@ -474,11 +479,13 @@ void AudioFileProcessorWaveView::reverse()

void AudioFileProcessorWaveView::updateCursor(QMouseEvent * me)
{
const auto pos = position(me);

bool const waveIsDragged = m_isDragging && (m_draggingType == DraggingType::Wave);
bool const pointerCloseToStartEndOrLoop = (me != nullptr) &&
(isCloseTo(me->x(), m_startFrameX) ||
isCloseTo(me->x(), m_endFrameX) ||
isCloseTo(me->x(), m_loopFrameX));
(isCloseTo(pos.x(), m_startFrameX) ||
isCloseTo(pos.x(), m_endFrameX) ||
isCloseTo(pos.x(), m_loopFrameX));

if (!m_isDragging && pointerCloseToStartEndOrLoop)
setCursor(Qt::SizeHorCursor);
Expand Down
Loading
Loading