From d44cee241a420edf1d1dee64e7306905edc00e7c Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Sun, 3 Sep 2006 20:11:16 +0000 Subject: [PATCH] integrated Toby's Qt4 fixes git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@386 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/bb_track.h | 10 +++++++--- src/core/track.cpp | 49 ++++++++++++++++++++++++++++++---------------- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/include/bb_track.h b/include/bb_track.h index fdd25fab5..711f4abf3 100644 --- a/include/bb_track.h +++ b/include/bb_track.h @@ -122,7 +122,7 @@ public: bool automationDisabled( track * _track ) { - return( m_disabled_tracks.containsRef( _track ) ); + return( m_disabled_tracks.contains( _track ) ); } void disableAutomation( track * _track ) { @@ -130,7 +130,11 @@ public: } void enableAutomation( track * _track ) { - m_disabled_tracks.removeRef( _track ); +#ifndef QT3 + m_disabled_tracks.removeAll( _track ); +#else + m_disabled_tracks.remove( _track ); +#endif } @@ -147,7 +151,7 @@ protected: private: nameLabel * m_trackLabel; - QPtrList m_disabled_tracks; + vlist m_disabled_tracks; typedef QMap infoMap; static infoMap s_infoMap; diff --git a/src/core/track.cpp b/src/core/track.cpp index 208dfceba..410d71007 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -455,6 +455,10 @@ void trackContentObject::mouseReleaseEvent( QMouseEvent * _me ) +#ifdef QT3 +#define addSeparator insertSeparator +#endif + void trackContentObject::contextMenuEvent( QContextMenuEvent * _cme ) { QMenu contextMenu( this ); @@ -463,11 +467,7 @@ void trackContentObject::contextMenuEvent( QContextMenuEvent * _cme ) contextMenu.addAction( embed::getIconPixmap( "cancel" ), tr( "Delete (middle mousebutton)" ), this, SLOT( close() ) ); -#ifdef QT4 contextMenu.addSeparator(); -#else - contextMenu.insertSeparator(); -#endif contextMenu.addAction( embed::getIconPixmap( "edit_cut" ), tr( "Cut" ), this, SLOT( cut() ) ); } @@ -475,7 +475,7 @@ void trackContentObject::contextMenuEvent( QContextMenuEvent * _cme ) tr( "Copy" ), this, SLOT( copy() ) ); contextMenu.addAction( embed::getIconPixmap( "edit_paste" ), tr( "Paste" ), this, SLOT( paste() ) ); - contextMenu.insertSeparator(); + contextMenu.addSeparator(); contextMenu.addAction( embed::getIconPixmap( "muted" ), tr( "Mute/unmute ( + middle click)" ), this, SLOT( toggleMute() ) ); @@ -484,6 +484,7 @@ void trackContentObject::contextMenuEvent( QContextMenuEvent * _cme ) contextMenu.exec( QCursor::pos() ); } +#undef addSeparator @@ -1109,8 +1110,13 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe ) mute_active_icon = "mute_on"; mute_inactive_icon = "mute_off"; } +#ifndef QT3 + m_trackOps->setIcon( embed::getIconPixmap( + trackOps_icon ) ); +#else m_trackOps->setIconSet( embed::getIconPixmap( trackOps_icon ) ); +#endif m_muteBtn->setActiveGraphic( embed::getIconPixmap( mute_active_icon ) ); m_muteBtn->setInactiveGraphic( embed::getIconPixmap( @@ -1188,7 +1194,12 @@ void trackOperationsWidget::muteBtnRightClicked( void ) void trackOperationsWidget::updateMenu( void ) { - QMenu * to_menu = m_trackOps->popup(); + QMenu * to_menu = m_trackOps-> +#ifndef QT3 + menu(); +#else + popup(); +#endif to_menu->clear(); if( inBBEditor() ) { @@ -1626,12 +1637,12 @@ track::~track() m_trackWidget = NULL; } - QPtrListIterator it( m_automation_patterns ); - automationPattern * pattern ; - while( ( pattern = it.current() ) ) + for( vlist::iterator it = + m_automation_patterns.begin(); + it != m_automation_patterns.end(); + ++it ) { - ++it; - pattern->forgetTrack(); + ( *it )->forgetTrack(); } } @@ -1884,7 +1895,11 @@ void track::addAutomationPattern( automationPattern * _pattern ) void track::removeAutomationPattern( automationPattern * _pattern ) { - m_automation_patterns.removeRef( _pattern ); +#ifndef QT3 + m_automation_patterns.removeAll( _pattern ); +#else + m_automation_patterns.remove( _pattern ); +#endif } @@ -1892,12 +1907,12 @@ void track::removeAutomationPattern( automationPattern * _pattern ) void track::sendMidiTime( const midiTime & _time ) { - QPtrListIterator it( m_automation_patterns ); - automationPattern * pattern; - while( ( pattern = it.current() ) ) + for( vlist::iterator it = + m_automation_patterns.begin(); + it != m_automation_patterns.end(); + ++it ) { - ++it; - pattern->processMidiTime( _time ); + ( *it )->processMidiTime( _time ); } }