From 36b6540f0b2e1b5e0fdb06179045e8eb352d84d8 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 9 Jan 2006 12:48:55 +0000 Subject: [PATCH] qt4 compat fixes git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@46 0778d3d1-df1d-0410-868b-ea421aaaa00d --- configure.in | 5 --- include/fade_button.h | 4 +-- include/qt3support.h | 3 +- plugins/vestige/vestige.cpp | 13 ++++++-- src/core/arp_and_chords_tab_widget.cpp | 29 ------------------ src/core/piano_roll.cpp | 42 +------------------------- src/tracks/pattern.cpp | 8 ----- src/widgets/fade_button.cpp | 4 +-- 8 files changed, 18 insertions(+), 90 deletions(-) diff --git a/configure.in b/configure.in index 9b3006b33..3946b44fa 100644 --- a/configure.in +++ b/configure.in @@ -2,13 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -<<<<<<< configure.in AC_INIT(lmms, 0.1.2-cvs20060108, tobydox/at/users.sourceforge.net) AM_INIT_AUTOMAKE(lmms, 0.1.2-cvs20060108) -======= -AC_INIT(lmms, 0.1.2-cvs20060102, tobydox/at/users.sourceforge.net) -AM_INIT_AUTOMAKE(lmms, 0.1.2-cvs20060102) ->>>>>>> 1.26 AM_CONFIG_HEADER(config.h) diff --git a/include/fade_button.h b/include/fade_button.h index bd98c2f99..40d320a32 100644 --- a/include/fade_button.h +++ b/include/fade_button.h @@ -30,7 +30,7 @@ #ifdef QT4 -#include +#include #include #else @@ -42,7 +42,7 @@ -class fadeButton : public QButton +class fadeButton : public QAbstractButton { Q_OBJECT public: diff --git a/include/qt3support.h b/include/qt3support.h index 1b5267450..dcb3b994a 100644 --- a/include/qt3support.h +++ b/include/qt3support.h @@ -1,7 +1,7 @@ /* * qt3support.h - layer for supporting Qt3 * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -77,6 +77,7 @@ inline QString baseName( const QString & _file ) #define QMatrix QWMatrix #define QIcon QIconSet +#define QAbstractButton QButton // QWidget diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 1004b35b1..b9416e174 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -133,7 +133,7 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) : m_toggleGUIButton = new QPushButton( tr( "Show/hide VST-GUI" ), this ); m_toggleGUIButton->setGeometry( 20, 120, 160, 24 ); - m_toggleGUIButton->setIconSet( embed::getIconPixmap( "zoom" ) ); + m_toggleGUIButton->setIcon( embed::getIconPixmap( "zoom" ) ); m_toggleGUIButton->setFont( pointSize<8>( m_toggleGUIButton->font() ) ); connect( m_toggleGUIButton, SIGNAL( clicked() ), this, SLOT( toggleGUI() ) ); @@ -148,7 +148,7 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) : QPushButton * note_off_all_btn = new QPushButton( tr( "Turn off all " "notes" ), this ); note_off_all_btn->setGeometry( 20, 150, 160, 24 ); - note_off_all_btn->setIconSet( embed::getIconPixmap( "state_stop" ) ); + note_off_all_btn->setIcon( embed::getIconPixmap( "state_stop" ) ); note_off_all_btn->setFont( pointSize<8>( note_off_all_btn->font() ) ); connect( note_off_all_btn, SIGNAL( clicked() ), this, SLOT( noteOffAll() ) ); @@ -227,7 +227,11 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc, for( QMap::const_iterator it = dump.begin(); it != dump.end(); ++it ) { +#ifdef QT4 + vst_de.setAttribute( it.key(), it.value() ); +#else vst_de.setAttribute( it.key(), it.data() ); +#endif } } m_pluginMutex.unlock(); @@ -303,8 +307,13 @@ void vestigeInstrument::setParameter( const QString & _param, } if( m_plugin->pluginWidget() != NULL ) { +#ifdef QT4 + m_plugin->pluginWidget()->setWindowIcon( + getChannelTrack()->windowIcon() ); +#else m_plugin->pluginWidget()->setWindowIcon( *( getChannelTrack()->windowIcon() ) ); +#endif } m_pluginMutex.unlock(); update(); diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index 382492e50..5e145dd63 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -639,9 +639,6 @@ void arpAndChordsTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { QDomElement act_de = _doc.createElement( nodeName() ); -<<<<<<< arp_and_chords_tab_widget.cpp - act_de.setAttribute( "chorddisabled", !m_chordsGroupBox->isActive() ); -======= act_de.setAttribute( "chorddisabled", !m_chordsGroupBox->isActive() ); #ifdef QT4 act_de.setAttribute( "chord", m_chordsComboBox->currentIndex() ); @@ -650,32 +647,6 @@ void arpAndChordsTabWidget::saveSettings( QDomDocument & _doc, #endif act_de.setAttribute( "chordrange", m_chordRangeKnob->value() ); - act_de.setAttribute( "arpdisabled", !m_arpGroupBox->isActive() ); ->>>>>>> 1.11 -#ifdef QT4 -<<<<<<< arp_and_chords_tab_widget.cpp - act_de.setAttribute( "chord", m_chordsComboBox->currentIndex() ); -======= - act_de.setAttribute( "arp", m_arpComboBox->currentIndex() ); ->>>>>>> 1.11 -#else -<<<<<<< arp_and_chords_tab_widget.cpp - act_de.setAttribute( "chord", m_chordsComboBox->currentItem() ); -======= - act_de.setAttribute( "arp", m_arpComboBox->currentItem() ); ->>>>>>> 1.11 -#endif -<<<<<<< arp_and_chords_tab_widget.cpp - act_de.setAttribute( "chordrange", m_chordRangeKnob->value() ); -======= - act_de.setAttribute( "arprange", m_arpRangeKnob->value() ); - act_de.setAttribute( "arptime", m_arpTimeKnob->value() ); - act_de.setAttribute( "arpgate", m_arpGateKnob->value() ); - act_de.setAttribute( "arpdir", m_arpDirection ); - act_de.setAttribute( "arpsyncmode", - ( int ) m_arpTimeKnob->getSyncMode() ); ->>>>>>> 1.11 - act_de.setAttribute( "arpdisabled", !m_arpGroupBox->isActive() ); #ifdef QT4 act_de.setAttribute( "arp", m_arpComboBox->currentIndex() ); diff --git a/src/core/piano_roll.cpp b/src/core/piano_roll.cpp index eb353f3a3..838d36d88 100644 --- a/src/core/piano_roll.cpp +++ b/src/core/piano_roll.cpp @@ -524,12 +524,8 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern ) inline void pianoRoll::drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y, -<<<<<<< piano_roll.cpp Sint16 _width, const bool _is_selected, const bool _is_step_note ) -======= - Sint16 _width, const bool _is_selected ) ->>>>>>> 1.14 { ++_x; ++_y; @@ -583,7 +579,7 @@ void pianoRoll::update( void ) m_paintPixmap = QPixmap( rect().size() ); } m_paintPixmap.fill( QColor( 0, 0, 0 ) ); - QPainter p( &m_paintPixmap, this ); + QPainter p( &m_paintPixmap ); // set font-size to 8 p.setFont( pointSize<8>( p.font() ) ); @@ -934,7 +930,6 @@ void pianoRoll::update( void ) void pianoRoll::removeSelection( void ) { -<<<<<<< piano_roll.cpp m_selectStartTact64th = 0; m_selectedTact64th = 0; m_selectStartKey = 0; @@ -942,29 +937,8 @@ void pianoRoll::removeSelection( void ) } -======= - m_selectStartTact64th = 0; - m_selectedTact64th = 0; - m_selectStartKey = 0; - m_selectedKeys = 0; -} - ->>>>>>> 1.14 -<<<<<<< piano_roll.cpp -void pianoRoll::closeEvent( QCloseEvent * _ce ) -{ - QApplication::restoreOverrideCursor(); - hide(); - _ce->ignore (); -} - -======= ->>>>>>> 1.14 - -<<<<<<< piano_roll.cpp -======= void pianoRoll::closeEvent( QCloseEvent * _ce ) { QApplication::restoreOverrideCursor(); @@ -973,7 +947,6 @@ void pianoRoll::closeEvent( QCloseEvent * _ce ) } ->>>>>>> 1.14 void pianoRoll::enterEvent( QEvent * _e ) @@ -1103,27 +1076,14 @@ void pianoRoll::keyPressEvent( QKeyEvent * _ke ) _ke->ignore(); break; } -<<<<<<< piano_roll.cpp } -======= -} - ->>>>>>> 1.14 - -<<<<<<< piano_roll.cpp - -void pianoRoll::leaveEvent( QEvent * _e ) -{ - while( QApplication::overrideCursor() != NULL ) -======= void pianoRoll::leaveEvent( QEvent * _e ) { while( QApplication::overrideCursor() != NULL ) ->>>>>>> 1.14 { QApplication::restoreOverrideCursor(); } diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 9dc9ca3d4..743edc3dd 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -853,7 +853,6 @@ void pattern::wheelEvent( QWheelEvent * _we ) } songEditor::inst()->setModified(); update(); -<<<<<<< pattern.cpp if( pianoRoll::inst()->currentPattern() == this ) { pianoRoll::inst()->update(); @@ -863,13 +862,6 @@ void pattern::wheelEvent( QWheelEvent * _we ) else { trackContentObject::wheelEvent( _we ); -======= - _we->accept(); - } - else - { - trackContentObject::wheelEvent( _we ); ->>>>>>> 1.12 } } diff --git a/src/widgets/fade_button.cpp b/src/widgets/fade_button.cpp index 7f20b9894..cecf5d855 100644 --- a/src/widgets/fade_button.cpp +++ b/src/widgets/fade_button.cpp @@ -1,7 +1,7 @@ /* * fade_button.cpp - implementation of fade-button * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -42,7 +42,7 @@ fadeButton::fadeButton( const QColor & _normal_color, const QColor & _activated_color, QWidget * _parent ) : - QButton( _parent ), + QAbstractButton( _parent ), m_state( 0.0f ), m_normalColor( _normal_color ), m_activatedColor( _activated_color )