From 11a76c45fc194bf78ca6eb3e726fba2ad4ec9911 Mon Sep 17 00:00:00 2001 From: Vesa Date: Mon, 24 Mar 2014 17:11:42 +0200 Subject: [PATCH] Compat code to make LMMS compile on Qt <4.8 --- src/core/timeline.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 3120dacc1..42d976884 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -40,6 +40,10 @@ #include "text_float.h" +#if QT_VERSION < 0x040800 +#define MiddleButton MidButton +#endif + QPixmap * timeLine::s_timeLinePixmap = NULL; QPixmap * timeLine::s_posMarkerPixmap = NULL; @@ -283,14 +287,14 @@ void timeLine::mousePressEvent( QMouseEvent* event ) m_moveXOff = s_posMarkerPixmap->width() / 2; } } - else if( event->button() == Qt::RightButton || event->button() == Qt::MiddleButton ) + else if( event->button() == Qt::RightButton || event->button() == Qt:: MiddleButton ) { const MidiTime t = m_begin + static_cast( event->x() * MidiTime::ticksPerTact() / m_ppt ); if( m_loopPos[0] > m_loopPos[1] ) { qSwap( m_loopPos[0], m_loopPos[1] ); } - if( ( event->modifiers() & Qt::ShiftModifier ) || event->button() == Qt::MiddleButton ) + if( ( event->modifiers() & Qt::ShiftModifier ) || event->button() == Qt:: MiddleButton ) { m_action = MoveLoopBegin; }