diff --git a/ChangeLog b/ChangeLog index 11a0618ec..22dccf79c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,223 @@ +2007-08-26 Tobias Doerffel + + * plugins/patman/patman.cpp: + * plugins/patman/patman.h: + * plugins/ladspa_effect/ladspa_effect.cpp: + * plugins/ladspa_effect/ladspa_control_dialog.cpp: + * plugins/ladspa_effect/ladspa_effect.h: + * plugins/ladspa_effect/ladspa_control_dialog.h: + * plugins/ladspa_effect/ladspa_subplugin_features.cpp: + * plugins/organic/organic.cpp: + * plugins/lb302/lb302.cpp: + * plugins/bit_invader/graph.cpp: + * plugins/bit_invader/bit_invader.cpp: + * plugins/bit_invader/graph.h: + * plugins/vst_effect/vst_effect.h: + * plugins/vibed/graph.cpp: + * plugins/vibed/impulse_editor.h: + * plugins/vibed/nine_button_selector.h: + * plugins/vibed/vibed.h: + * plugins/vibed/graph.h: + * plugins/vibed/string_container.h: + * plugins/vibed/impulse_editor.cpp: + * plugins/vibed/nine_button_selector.cpp: + * plugins/vibed/vibed.cpp: + * plugins/triple_oscillator/triple_oscillator.cpp: + * plugins/singerbot/singerbot.h: + * plugins/singerbot/singerbot.cpp: + * plugins/live_tool/live_tool.cpp: + * plugins/ladspa_base/ladspa_manager.cpp: + * plugins/ladspa_base/ladspa_2_lmms.h: + * plugins/ladspa_base/ladspa_manager.h: + * plugins/ladspa_base/ladspa_control.cpp: + * plugins/ladspa_base/ladspa_port_dialog.cpp: + * plugins/ladspa_base/ladspa_control.h: + * plugins/ladspa_base/ladspa_port_dialog.h: + * plugins/ladspa_base/ladspa_2_lmms.cpp: + * plugins/audio_file_processor/audio_file_processor.cpp: + * plugins/audio_file_processor/audio_file_processor.h: + * plugins/stk/mallets/mallets.cpp: + * plugins/stk/mallets/mallets.h: + * plugins/vestige/vestige.cpp: + * plugins/vst_base/lvsl_client.cpp: + * plugins/vst_base/lvsl_client.h: + * plugins/kicker/kicker.cpp: + * plugins/Makefile.am: + * plugins/flp_import/flp_import.h: + * plugins/flp_import/flp_import.cpp: + * plugins/midi_import/midi_import.h: + * plugins/midi_import/midi_import.cpp: + * include/mmp.h: + * include/knob.h: + * include/cpuload_widget.h: + * include/fade_button.h: + * include/templates.h: + * include/automatable_slider.h: + * include/lcd_spinbox.h: + * include/track.h: + * include/spc_bg_hndl_widget.h: + * include/note.h: + * include/tool_button.h: + * include/embed.h: + * include/name_label.h: + * include/midi_alsa_raw.h: + * include/gui_templates.h: + * include/visualization_widget.h: + * include/tab_widget.h: + * include/config_mgr.h: + * include/midi_tab_widget.h: + * include/import_filter.h: + * include/mixer.h: + * include/instrument_track.h: + * include/audio_port.h: + * include/instrument.h: + * include/text_float.h: + * include/piano_widget.h: + * include/sample_buffer.h: + * include/effect_select_dialog.h: + * include/automation_pattern.h: + * include/midi_mapper.h: + * include/nstate_button.h: + * include/plugin.h: + * include/clipboard.h: + * include/note_play_handle.h: + * include/side_bar.h: + * include/rack_view.h: + * include/pattern.h: + * include/string_pair_drag.h: + * include/audio_file_device.h: + * include/kmultitabbar.h: + * include/file_browser.h: + * include/base64.h: + * include/audio_jack.h: + * include/about_dialog.h: + * include/piano_roll.h: + * include/group_box.h: + * include/envelope_tab_widget.h: + * include/rubberband.h: + * include/bb_track.h: + * include/song_editor.h: + * include/project_notes.h: + * include/effect_tab_widget.h: + * include/kmultitabbar-qt3.h: + * include/automatable_button.h: + * include/midi_alsa_seq.h: + * include/tab_button.h: + * include/journalling_object.h: + * include/setup_dialog.h: + * include/export_project_dialog.h: + * include/rename_dialog.h: + * include/pixmap_button.h: + * include/tab_bar.h: + * include/effect_label.h: + * include/automatable_object_templates.h: + * include/sample_track.h: + * include/timeline.h: + * include/surround_area.h: + * include/main_window.h: + * include/audio_device.h: + * include/midi_client.h: + * include/automatable_object.h: + * include/automation_editor.h: + * include/midi_port.h: + * include/audio_sample_recorder.h: + * include/bb_editor.h: + * include/effect_chain.h: + * include/arp_and_chords_tab_widget.h: + * include/project_journal.h: + * include/plugin_browser.h: + * include/envelope_and_lfo_widget.h: + * include/preset_preview_play_handle.h: + * include/qt3support.h: + * include/track_container.h: + * include/combobox.h: + * include/side_bar_widget.h: + * include/play_handle.h: + * include/qxembed.h: + * include/xqmap.h: + * configure.in: + * src/audio/audio_file_device.cpp: + * src/audio/audio_alsa.cpp: + * src/audio/audio_oss.cpp: + * src/audio/audio_jack.cpp: + * src/midi/midi_client.cpp: + * src/midi/midi_mapper.cpp: + * src/midi/midi_oss.cpp: + * src/midi/midi_alsa_seq.cpp: + * src/midi/midi_alsa_raw.cpp: + * src/lib/string_pair_drag.cpp: + * src/lib/base64.cpp: + * src/lib/mmp.cpp: + * src/lib/journalling_object.cpp: + * src/lib/sample_buffer.cpp: + * src/lib/embed.cpp: + * src/widgets/rack_plugin.cpp: + * src/widgets/automatable_slider.cpp: + * src/widgets/visualization_widget.cpp: + * src/widgets/group_box.cpp: + * src/widgets/lcd_spinbox.cpp: + * src/widgets/rubberband.cpp: + * src/widgets/tool_button.cpp: + * src/widgets/combobox.cpp: + * src/widgets/text_float.cpp: + * src/widgets/tab_widget.cpp: + * src/widgets/rack_view.cpp: + * src/widgets/led_checkbox.cpp: + * src/widgets/side_bar_widget.cpp: + * src/widgets/project_notes.cpp: + * src/widgets/volume_knob.cpp: + * src/widgets/kmultitabbar.cpp: + * src/widgets/qxembed.cpp: + * src/widgets/rename_dialog.cpp: + * src/widgets/pixmap_button.cpp: + * src/widgets/nstate_button.cpp: + * src/widgets/knob.cpp: + * src/widgets/automatable_button.cpp: + * src/widgets/tempo_sync_knob.cpp: + * src/widgets/fade_button.cpp: + * src/widgets/cpuload_widget.cpp: + * src/widgets/tab_bar.cpp: + * src/widgets/tooltip.cpp: + * src/tracks/sample_track.cpp: + * src/tracks/bb_track.cpp: + * src/tracks/instrument_track.cpp: + * src/tracks/pattern.cpp: + * src/core/plugin.cpp: + * src/core/arp_and_chords_tab_widget.cpp: + * src/core/plugin_browser.cpp: + * src/core/envelope_and_lfo_widget.cpp: + * src/core/preset_preview_play_handle.cpp: + * src/core/track_container.cpp: + * src/core/config_mgr.cpp: + * src/core/midi_tab_widget.cpp: + * src/core/effect_control_dialog.cpp: + * src/core/import_filter.cpp: + * src/core/setup_dialog.cpp: + * src/core/file_browser.cpp: + * src/core/main.cpp: + * src/core/mixer.cpp: + * src/core/export_project_dialog.cpp: + * src/core/about_dialog.cpp: + * src/core/piano_roll.cpp: + * src/core/track.cpp: + * src/core/engine.cpp: + * src/core/note.cpp: + * src/core/timeline.cpp: + * src/core/envelope_tab_widget.cpp: + * src/core/surround_area.cpp: + * src/core/piano_widget.cpp: + * src/core/effect_select_dialog.cpp: + * src/core/main_window.cpp: + * src/core/song_editor.cpp: + * src/core/automation_pattern.cpp: + * src/core/name_label.cpp: + * src/core/effect_tab_widget.cpp: + * src/core/automation_editor.cpp: + * src/core/bb_editor.cpp: + * acinclude.m4: + * Makefile.am: + dropped Qt3-support and improved Qt4-support + 2007-08-23 Tobias Doerffel * configure.in: diff --git a/Makefile.am b/Makefile.am index cf37019e0..f189d6183 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,7 +69,6 @@ lmms_MOC = \ ./file_browser.moc \ ./group_box.moc \ ./kmultitabbar.moc \ - ./kmultitabbar-qt3.moc \ ./knob.moc \ ./lcd_spinbox.moc \ ./led_checkbox.moc \ @@ -89,7 +88,6 @@ lmms_MOC = \ ./rack_plugin.moc \ ./rack_view.moc \ ./rubberband.moc \ - ./qxembed.moc \ ./rename_dialog.moc \ ./sample_buffer.moc \ ./sample_play_handle.moc \ @@ -188,11 +186,11 @@ lmms_SOURCES = \ $(srcdir)/src/core/track_container.cpp \ $(srcdir)/src/core/surround_area.cpp \ $(srcdir)/src/core/timeline.cpp \ - $(srcdir)/src/lib/base64.cpp \ $(srcdir)/src/lib/clipboard.cpp \ $(srcdir)/src/lib/journalling_object.cpp \ $(srcdir)/src/lib/project_journal.cpp \ $(srcdir)/src/lib/project_version.cpp \ + $(srcdir)/src/lib/base64.cpp \ $(srcdir)/src/lib/embed.cpp \ $(srcdir)/src/lib/mmp.cpp \ $(srcdir)/src/lib/oscillator.cpp \ @@ -226,7 +224,6 @@ lmms_SOURCES = \ $(srcdir)/src/widgets/rack_plugin.cpp \ $(srcdir)/src/widgets/rack_view.cpp \ $(srcdir)/src/widgets/rubberband.cpp \ - $(srcdir)/src/widgets/qxembed.cpp \ $(srcdir)/src/widgets/rename_dialog.cpp \ $(srcdir)/src/widgets/side_bar_widget.cpp \ $(srcdir)/src/widgets/tab_bar.cpp \ @@ -291,7 +288,6 @@ lmms_SOURCES = \ $(srcdir)/include/gui_templates.h \ $(srcdir)/include/surround_area.h \ $(srcdir)/include/kmultitabbar.h \ - $(srcdir)/include/kmultitabbar-qt3.h \ $(srcdir)/include/side_bar.h \ $(srcdir)/include/side_bar_widget.h \ $(srcdir)/include/track.h \ @@ -312,7 +308,6 @@ lmms_SOURCES = \ $(srcdir)/include/clipboard.h \ $(srcdir)/include/types.h \ $(srcdir)/include/update_event.h \ - $(srcdir)/include/qt3support.h \ $(srcdir)/include/embed.h \ $(srcdir)/include/timeline.h \ $(srcdir)/include/config_mgr.h \ @@ -374,9 +369,17 @@ lmms_SOURCES = \ $(srcdir)/include/ladspa-1.1.h \ $(srcdir)/include/sweep_oscillator.h \ $(srcdir)/include/meter_dialog.h \ - $(srcdir)/include/qxembed.h \ $(srcdir)/include/effect_lib.h \ - $(srcdir)/include/xqmap.h \ + $(srcdir)/plugins/ladspa_base/ladspa_base.cpp \ + $(srcdir)/plugins/ladspa_base/ladspa_port_dialog.cpp \ + $(srcdir)/plugins/ladspa_base/ladspa_2_lmms.cpp \ + $(srcdir)/plugins/ladspa_base/ladspa_manager.cpp \ + $(srcdir)/plugins/ladspa_base/ladspa_control.cpp \ + $(srcdir)/plugins/ladspa_base/ladspa_manager.h \ + $(srcdir)/plugins/ladspa_base/ladspa_2_lmms.h \ + $(srcdir)/plugins/ladspa_base/ladspa_control.h \ + $(srcdir)/plugins/ladspa_base/ladspa_port_dialog.h \ + $(srcdir)/plugins/ladspa_base/ladspa_base.h \ $(THIRD_PARTY_CODE) diff --git a/acinclude.m4 b/acinclude.m4 index 6e2723430..dcfa12c19 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -9,15 +9,15 @@ AC_ARG_WITH([qtdir], [ --with-qtdir=DIR Qt installation directory [defau # Check that QTDIR is defined or that --with-qtdir given if test x"$QTDIR" = x ; then # some usual Qt-locations - QT_SEARCH="/usr /usr/lib/qt /usr/lib/qt3 /usr/lib/qt31 /usr/lib/qt32 /usr/lib/qt33 /usr/lib/qt-3.0 /usr/lib/qt-3.1 /usr/lib/qt-3.2 /usr/lib/qt-3.3 /usr/local/qt /usr/local/qt3 /usr/local/qt31 /usr/local/qt32 /usr/local/qt33 /usr/share/qt3 /usr/X11R6" # /usr/share/qt4 /usr/local/Trolltech/Qt-4.0.0 /usr/local/Trolltech/Qt-4.0.1 /usr/local/Trolltech/Qt-4.1.0 /usr/local/Trolltech/Qt-4.1.0" + QT_SEARCH="/usr /usr/lib/qt4 /usr/share/qt4 /usr/local/Trolltech/Qt-4.3.0 /usr/local/Trolltech/Qt-4.3.1 /usr/local/Trolltech/Qt-4.1.0" else QT_SEARCH=$QTDIR QTDIR="" fi for i in $QT_SEARCH ; do - QT_INCLUDE_SEARCH="include include/qt include/qt3" # include/qt4/Qt include/Qt" + QT_INCLUDE_SEARCH="include/qt4 include" for j in $QT_INCLUDE_SEARCH ; do - if test -f $i/$j/qglobal.h -a x$QTDIR = x ; then + if test -f $i/$j/Qt/qglobal.h -a x$QTDIR = x ; then QTDIR=$i QT_INCLUDES=$i/$j fi @@ -41,36 +41,11 @@ if test x"$QT_INCLUDES" = x ; then fi AC_MSG_RESULT([$QT_INCLUDES]) -# Figure out which version of Qt we are using -AC_MSG_CHECKING([Qt version]) -QT_VER=`grep 'define.*QT_VERSION_STR\W' $QT_INCLUDES/qglobal.h | perl -p -e 's/\D//g'` -case "${QT_VER}" in - 2*) - AC_MSG_ERROR([*** Qt 2 is not supported by iTALC. Please upgrade to Qt3!]) - ;; - 3*) - QT_MAJOR="3" - ;; -# 4*) -# QT_MAJOR="4" -# ;; - *) - AC_MSG_ERROR([*** Don't know how to handle this Qt major version]) - ;; -esac -AC_MSG_RESULT([$QT_VER ($QT_MAJOR)]) # Search for available Qt translations AH_TEMPLATE(QT_TRANSLATIONS_DIR, [Define to Qt translations directory]) AC_MSG_CHECKING([Qt translations]) -case "${QT_VER}" in - 3*) - QT_TRANSLATIONS_SEARCH="/usr/share/qt3 /usr/local/qt3 /usr/local/qt31 /usr/local/qt32 /usr/local/qt33 /usr/local/qt" - ;; - 4*) - QT_TRANSLATIONS_SEARCH="/usr/share/qt4 /usr/local/qt /usr/local/Trolltech/Qt-4.0.0 /usr/local/Trolltech/Qt-4.0.1 /usr/local/Trolltech/Qt-4.1.0 /usr/local/Trolltech/Qt-4.1.0" - ;; -esac +QT_TRANSLATIONS_SEARCH="/usr/share/qt4 /usr/local/qt /usr/local/Trolltech/Qt-4.3.0 /usr/local/Trolltech/Qt-4.3.1" for i in $QT_TRANSLATIONS_SEARCH ; do if test -d $i/translations -a x$QT_TRANSLATIONS = x ; then QT_TRANSLATIONS=$i/translations @@ -83,217 +58,115 @@ else fi AC_MSG_RESULT([$QT_TRANSLATIONS]) -QTHOSTDIR=/usr + +if test -z "$QTHOSTDIR" ; then + case "${prefix}" in + /opt/mingw*) + QTHOSTDIR=/usr + ;; + *) + if test -n "$QTDIR" ; then + QTHOSTDIR="$QTDIR" + else + QTHOSTDIR=/usr + fi + ;; + esac +fi + # Check that moc is in path -AC_CHECK_PROG(MOC, moc, $QTDIR/bin/moc,,$QTDIR/bin/) +AC_CHECK_PROG(MOC, moc-qt4, $QTHOSTDIR/bin/moc-qt4,,$QTHOSTDIR/bin/) if test x$MOC = x ; then - AC_CHECK_PROG(MOC, moc-qt3, $QTDIR/bin/moc-qt3,,$QTDIR/bin/) + AC_CHECK_PROG(MOC, moc, $QTHOSTDIR/bin/moc,,$QTHOSTDIR/bin/) if test x$MOC = x ; then - AC_CHECK_PROG(MOC, moc-qt4, $QTHOSTDIR/bin/moc-qt4,,$QTHOSTDIR/bin/) - if test x$MOC = x ; then - AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!]) - fi + AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!]) fi fi -# uic is the Qt user interface compiler -AC_CHECK_PROG(UIC, uic, $QTDIR/bin/uic,,$QTDIR/bin/) +# Check that uic is in path +AC_CHECK_PROG(UIC, uic-qt4, $QTHOSTDIR/bin/uic-qt4,,$QTHOSTDIR/bin/) if test x$UIC = x ; then - AC_MSG_WARN([*** not found! It's currently not needed but should be part of a proper Qt-devel-tools-installation!]) + AC_CHECK_PROG(UIC, uic, $QTHOSTDIR/bin/uic,,$QTHOSTDIR/bin/) + if test x$UIC = x ; then + AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!]) + fi +fi + +# Check that rcc is in path +AC_CHECK_PROG(RCC, rcc-qt4, $QTHOSTDIR/bin/rcc-qt4,,$QTHOSTDIR/bin/) +if test x$RCC = x ; then + AC_CHECK_PROG(RCC, rcc, $QTHOSTDIR/bin/rcc,,$QTHOSTDIR/bin/) + if test x$RCC = x ; then + AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!]) + fi fi # lupdate is the Qt translation-update utility. -AC_CHECK_PROG(LUPDATE, lupdate, $QTDIR/bin/lupdate,,$QTDIR/bin/) +AC_CHECK_PROG(LUPDATE, lupdate-qt4, $QTHOSTDIR/bin/lupdate-qt4,,$QTHOSTDIR/bin/) if test x$LUPDATE = x ; then - AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!]) + AC_CHECK_PROG(LUPDATE, lupdate, $QTHOSTDIR/bin/lupdate,,$QTHOSTDIR/bin/) + if test x$LUPDATE = x ; then + AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!]) + fi fi # lrelease is the Qt translation-release utility. -AC_CHECK_PROG(LRELEASE, lrelease, $QTDIR/bin/lrelease,,$QTDIR/bin/) +AC_CHECK_PROG(LRELEASE, lrelease-qt4, $QTHOSTDIR/bin/lrelease-qt4,,$QTHOSTDIR/bin/) if test x$LRELEASE = x ; then - AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!]) -fi - -# Calculate Qt include path -QT_CXXFLAGS="-I$QT_INCLUDES" -if test "$QT_MAJOR" = "4" ; then - QT_CXXFLAGS="$QT_CXXFLAGS -I$QTDIR/include/qt4 -I$QTDIR/include" -fi - - -QT_IS_EMBEDDED="no" -# On unix, figure out if we're doing a static or dynamic link -case "${host}" in - *-cygwin) - AC_DEFINE_UNQUOTED(WIN32, "", Defined if on Win32 platform) - if test -f "$QTDIR/lib/qt.lib" ; then - QT_LIB="qt.lib" - QT_IS_STATIC="yes" - QT_IS_MT="no" - elif test -f "$QTDIR/lib/qt-mt.lib" ; then - QT_LIB="qt-mt.lib" - QT_IS_STATIC="yes" - QT_IS_MT="yes" - elif test -f "$QTDIR/lib/qt$QT_VER.lib" ; then - QT_LIB="qt$QT_VER.lib" - QT_IS_STATIC="no" - QT_IS_MT="no" - elif test -f "$QTDIR/lib/qt-mt$QT_VER.lib" ; then - QT_LIB="qt-mt$QT_VER.lib" - QT_IS_STATIC="no" - QT_IS_MT="yes" - fi - ;; - - *mingw32) - QT_IS_MT="yes" - QT_LIB="-L$QTDIR/bin -lQtCore4 -lQtGui4 -lQtXml4 -lQt3Support4" - ;; - *) - QT_IS_STATIC=`ls $QTDIR/lib/*.a 2> /dev/null` - if test "x$QT_IS_STATIC" = x; then - QT_IS_STATIC="no" - else - QT_IS_STATIC="yes" - fi - if test x$QT_IS_STATIC = xno ; then - QT_IS_DYNAMIC=`ls $QTDIR/lib/*.so 2> /dev/null` - if test "x$QT_IS_DYNAMIC" = x; then - QT_IS_DYNAMIC=`ls /usr/lib/libQt*so.4 2> /dev/null` - if test "x$QT_IS_DYNAMIC" = x; then - AC_MSG_ERROR([*** Couldn't find any Qt libraries]) - fi - fi - fi - if test "$QT_MAJOR" = "4" ; then - QT_IS_MT="yes" - QT_LIB="-lQtCore -lQtGui -lQtXml -lQt3Support" - MOC="$MOC -DLADSPA_SUPPORT" - else - QT_CXXFLAGS="-DQT3 $QT_CXXFLAGS" - if test "x`ls $QTDIR/lib/libqt-mt.* 2> /dev/null`" != x ; then - QT_LIB="-lqt-mt" - QT_IS_MT="yes" - elif test "x`ls $QTDIR/lib/libqt.* 2> /dev/null`" != x ; then - QT_LIB="-lqt" - QT_IS_MT="no" - elif test "x`ls $QTDIR/lib/libqte.* 2> /dev/null`" != x ; then - QT_LIB="-lqte" - QT_IS_MT="no" - QT_IS_EMBEDDED="yes" - elif test "x`ls $QTDIR/lib/libqte-mt.* 2> /dev/null`" != x ; then - QT_LIB="-lqte-mt" - QT_IS_MT="yes" - QT_IS_EMBEDDED="yes" - fi + AC_CHECK_PROG(LRELEASE, lrelease, $QTHOSTDIR/bin/lrelease,,$QTHOSTDIR/bin/) + if test x$LRELEASE = x ; then + AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!]) fi - ;; -esac -AC_MSG_CHECKING([if Qt is static]) -AC_MSG_RESULT([$QT_IS_STATIC]) -AC_MSG_CHECKING([if Qt is multithreaded]) -if test "$QT_IS_MT" = "no"; then - AC_MSG_ERROR([*** your Qt is not multithreaded. That's bad, because multithreading is required for compiling... Please install Qt-mt!]) -fi -AC_MSG_RESULT([$QT_IS_MT]) -AC_MSG_CHECKING([if Qt is embedded]) -AC_MSG_RESULT([$QT_IS_EMBEDDED]) - -QT_GUILINK="" -QASSISTANTCLIENT_LDADD="-lqassistantclient" -QT_LIBS="$QT_LIB" -x_libraries="$x_libraries -L/usr/X11R6/lib" - -case "${host}" in - *irix*) - QT_LIBS="$QT_LIB" - if test $QT_IS_STATIC = yes ; then - QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE" - fi - ;; - - *linux*) - QT_LIBS="$QT_LIB" - if test $QT_IS_STATIC = yes && test $QT_IS_EMBEDDED = no; then - QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -ljpeg" - fi - ;; - - - *osf*) - # Digital Unix (aka DGUX aka Tru64) - QT_LIBS="$QT_LIB" - if test $QT_IS_STATIC = yes ; then - QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE" - fi - ;; - - *solaris*) - QT_LIBS="$QT_LIB" - if test $QT_IS_STATIC = yes ; then - QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -lresolv -lsocket -lnsl" - fi - ;; - - - *win*) - # linker flag to suppress console when linking a GUI app on Win32 - QT_GUILINK="/subsystem:windows" - - if test $QT_MAJOR = "3" ; then - if test $QT_IS_MT = yes ; then - QT_LIBS="/nodefaultlib:libcmt" - else - QT_LIBS="/nodefaultlib:libc" - fi - fi - - if test $QT_IS_STATIC = yes ; then - QT_LIBS="$QT_LIBS $QT_LIB kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib shell32.lib imm32.lib advapi32.lib wsock32.lib winspool.lib winmm.lib netapi32.lib" - if test $QT_MAJOR = "3" ; then - QT_LIBS="$QT_LIBS qtmain.lib" - fi - else - QT_LIBS="$QT_LIBS $QT_LIB" - if test $QT_MAJOR = "3" ; then - QT_CXXFLAGS="$QT_CXXFLAGS -DQT_DLL" - QT_LIBS="$QT_LIBS qtmain.lib qui.lib user32.lib netapi32.lib" - fi - fi - QASSISTANTCLIENT_LDADD="qassistantclient.lib" - ;; - -esac - - -if test x"$QT_IS_EMBEDDED" = "xyes" ; then - QT_CXXFLAGS="-DQWS $QT_CXXFLAGS" fi -if test x"$QT_IS_MT" = "xyes" ; then - QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -DQT_THREAD_SUPPORT" - QT_LIBS="$QT_LIBS" -fi - -QT_LDADD="-L$QTDIR/lib $QT_LIBS" - -#if test x$QT_IS_STATIC = xyes ; then -# OLDLIBS="$LIBS" -# LIBS="$QT_LDADD" -# AC_CHECK_LIB(Xft, XftFontOpen, QT_LDADD="$QT_LDADD -lXft") -# LIBS="$LIBS" -#fi +# construct CXXFLAGS +QT_CXXFLAGS="-I$QT_INCLUDES -I$QT_INCLUDES/Qt -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_XML_LIB -DQT_THREAD_SUPPORT" AC_MSG_CHECKING([QT_CXXFLAGS]) AC_MSG_RESULT([$QT_CXXFLAGS]) -AC_MSG_CHECKING([QT_LDADD]) -AC_MSG_RESULT([$QT_LDADD]) + + +# check libraries +AC_MSG_CHECKING([Qt4 libraries]) + +case "${host}" in + *mingw32) + QT_LIBS=`ls $QTDIR/lib/libQt*.a 2> /dev/null` + if test "x$QT_LIBS" = x; then + AC_MSG_ERROR([*** Couldn't find any Qt4 libraries]) + fi + QT_LIB="-L$QTDIR/bin -lQtCore4 -lQtXml4 -lQtNetwork4 -lQtGui4 -lQt3Support4 -lws2_32" + # Check that windres is in path + AC_PATH_PROGS([WINDRES],[i586-mingw32-windres windres],,[${prefix}/bin:$PATH]) + if test x$WINDRES = x ; then + AC_MSG_ERROR([*** not found! Make sure you have mingw32 binutils installed!]) + fi + ;; + *) + QT_LIBS=`ls $QTDIR/lib64/libQt*.so 2> /dev/null` + if test "x$QT_LIBS" = x; then + QT_LIBS=`ls $QTDIR/lib/libQt*.so 2> /dev/null` + if test "x$QT_LIBS" = x; then + AC_MSG_ERROR([*** Couldn't find any Qt4 libraries]) + fi + QT_LIB="-L$QTDIR/lib -L$QTDIR/lib/qt4" + else + QT_LIB="-L$QTDIR/lib64 -L$QTDIR/lib64/qt4" + fi + QT_LIB="$QT_LIB -lQtCore -lQtXml -lQtNetwork -lQtGui -lQt3Support" + ;; +esac +AC_MSG_RESULT([found: $QT_LIB]) + +QT_LDADD="$QT_LIB" + + + AC_SUBST(QT_CXXFLAGS) AC_SUBST(QT_LDADD) -AC_SUBST(QT_GUILINK) -AC_SUBST(QASSISTANTCLIENT_LDADD) + ]) diff --git a/configure.in b/configure.in index 804bda26c..e2c7fe606 100644 --- a/configure.in +++ b/configure.in @@ -23,6 +23,7 @@ fi AH_TEMPLATE(BUILD_LINUX, [Build LMMS for Linux]) AH_TEMPLATE(BUILD_WIN32, [Build LMMS for Win32]) +AH_TEMPLATE(WIN32, [Build LMMS for Win32]) AC_ARG_WITH(linux, [ --with-linux explicit build LMMS for Linux], [ build_linux=true ], [ build_linux=false ]) AC_ARG_WITH(win32, diff --git a/include/about_dialog.h b/include/about_dialog.h index 7970daf54..a3c46773e 100644 --- a/include/about_dialog.h +++ b/include/about_dialog.h @@ -1,7 +1,7 @@ /* * about_dialog.h - declaration of class aboutDialog * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,19 +26,8 @@ #ifndef _ABOUT_DIALOG_H #define _ABOUT_DIALOG_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - class QPushButton; class QLabel; class QTabWidget; diff --git a/include/arp_and_chords_tab_widget.h b/include/arp_and_chords_tab_widget.h index 359ee650e..5d0b03bb5 100644 --- a/include/arp_and_chords_tab_widget.h +++ b/include/arp_and_chords_tab_widget.h @@ -27,22 +27,8 @@ #ifndef _ARP_AND_CHORDS_TAB_WIDGET_H #define _ARP_AND_CHORDS_TAB_WIDGET_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - #include "journalling_object.h" #include "types.h" diff --git a/include/audio_device.h b/include/audio_device.h index 8d8a13cf3..627290b27 100644 --- a/include/audio_device.h +++ b/include/audio_device.h @@ -26,22 +26,10 @@ #ifndef _AUDIO_DEVICE_H #define _AUDIO_DEVICE_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #ifdef HAVE_CONFIG_H #include #endif diff --git a/include/audio_file_device.h b/include/audio_file_device.h index 0f701b3f8..78fc40ccd 100644 --- a/include/audio_file_device.h +++ b/include/audio_file_device.h @@ -27,19 +27,8 @@ #define _AUDIO_FILE_DEVICE_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "audio_device.h" diff --git a/include/audio_jack.h b/include/audio_jack.h index 51cb65378..97e1569e7 100644 --- a/include/audio_jack.h +++ b/include/audio_jack.h @@ -37,22 +37,10 @@ #include -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "audio_device.h" @@ -109,7 +97,7 @@ private: QSemaphore m_stop_semaphore; - vvector m_outputPorts; + QVector m_outputPorts; surroundSampleFrame * m_outBuf; diff --git a/include/audio_port.h b/include/audio_port.h index 3a30443ed..2fdad2a98 100644 --- a/include/audio_port.h +++ b/include/audio_port.h @@ -26,18 +26,8 @@ #ifndef _AUDIO_PORT_H #define _AUDIO_PORT_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "effect_chain.h" diff --git a/include/audio_sample_recorder.h b/include/audio_sample_recorder.h index 50b9c101c..138f8b0a6 100644 --- a/include/audio_sample_recorder.h +++ b/include/audio_sample_recorder.h @@ -29,21 +29,9 @@ #define _AUDIO_SAMPLE_RECORDER_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "audio_device.h" @@ -67,7 +55,7 @@ private: const fpp_t _frames, const float _master_gain ); - typedef vlist > bufferList; + typedef QList > bufferList; bufferList m_buffers; } ; diff --git a/include/automatable_button.h b/include/automatable_button.h index 55ca2e282..a3d78d06c 100644 --- a/include/automatable_button.h +++ b/include/automatable_button.h @@ -26,19 +26,8 @@ #ifndef _AUTOMATABLE_BUTTON_H #define _AUTOMATABLE_BUTTON_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "automatable_object.h" @@ -121,7 +110,7 @@ public: private: - vlist m_buttons; + QList m_buttons; signals: diff --git a/include/automatable_object.h b/include/automatable_object.h index 46624996c..4b7f64204 100644 --- a/include/automatable_object.h +++ b/include/automatable_object.h @@ -28,19 +28,11 @@ #include -#include "qt3support.h" #include "journalling_object.h" #include "level_object.h" -#ifndef QT3 - #include -#else - -#include - -#endif class automationPattern; @@ -175,7 +167,7 @@ private: T m_oldValue; bool m_journalEntryReady; - typedef vvector autoObjVector; + typedef QVector autoObjVector; autoObjVector m_linkedObjects; inline void linkObject( autoObj * _object ); diff --git a/include/automatable_object_templates.h b/include/automatable_object_templates.h index f89f6437b..76149f936 100644 --- a/include/automatable_object_templates.h +++ b/include/automatable_object_templates.h @@ -147,7 +147,7 @@ void automatableObject::setValue( const T _value ) // for( autoObjVector::iterator it = // m_linkedObjects.begin(); // it != m_linkedObjects.end(); ++it ) - for( csize i = 0; i < m_linkedObjects.size(); ++i ) + for( int i = 0; i < m_linkedObjects.size(); ++i ) { autoObj * it = m_linkedObjects[i]; if( value() != it->value() && it->fittedValue( value() ) @@ -437,7 +437,7 @@ void automatableObject::unlinkObject( autoObj * _object ) template void automatableObject::syncAutomationPattern( void ) { - for( csize i = 0; i < m_linkedObjects.size(); ++i ) + for( int i = 0; i < m_linkedObjects.size(); ++i ) { autoObj * it = m_linkedObjects[i]; if( m_automation_pattern != it->m_automation_pattern ) diff --git a/include/automatable_slider.h b/include/automatable_slider.h index cc3c23ed1..3af21d45d 100644 --- a/include/automatable_slider.h +++ b/include/automatable_slider.h @@ -26,25 +26,13 @@ #ifndef _AUTOMATABLE_SLIDER_H #define _AUTOMATABLE_SLIDER_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif class knob; - - class automatableSlider : public QSlider { Q_OBJECT diff --git a/include/automation_editor.h b/include/automation_editor.h index 1dab3b44f..a054f4fa7 100644 --- a/include/automation_editor.h +++ b/include/automation_editor.h @@ -27,19 +27,7 @@ #ifndef _AUTOMATION_EDITOR_H #define _AUTOMATION_EDITOR_H -#include "qt3support.h" - -#ifdef QT4 - #include -#include - -#else - -#include -#include - -#endif #include "types.h" #include "journalling_object.h" diff --git a/include/automation_pattern.h b/include/automation_pattern.h index f0ad02e90..232896345 100644 --- a/include/automation_pattern.h +++ b/include/automation_pattern.h @@ -27,17 +27,10 @@ #ifndef _AUTOMATION_PATTERN_H #define _AUTOMATION_PATTERN_H -#include +#include -#include "qt3support.h" #include "journalling_object.h" -#ifdef QT3 - -#include "xqmap.h" - -#endif - class levelObject; class midiTime; @@ -50,12 +43,7 @@ class automationPattern : public QObject, public journallingObject { Q_OBJECT public: - // map negative midiTime to level -#ifdef QT3 - typedef XQMap timeMap; -#else typedef QMap timeMap; -#endif automationPattern( track * _track, levelObject * _object ); automationPattern( const automationPattern & _pat_to_copy ); diff --git a/include/base64.h b/include/base64.h index f19be109a..4b367eac6 100644 --- a/include/base64.h +++ b/include/base64.h @@ -27,21 +27,14 @@ #ifndef _BASE64_H #define _BASE64_H -#include "qt3support.h" - -#ifndef QT3 - #include - -#endif - +#include class QVariant; namespace base64 { -#ifndef QT3 inline void encode( const char * _data, const int _size, QString & _dst ) { @@ -55,10 +48,6 @@ namespace base64 *_data = new char[*_size]; memcpy( *_data, data.constData(), *_size ); } -#else - void encode( const char * _data, const int _size, QString & _dst ); - void decode( const QString & _b64, char * * _data, int * _size ); -#endif QString encode( const QVariant & _data ); QVariant decode( const QString & _b64 ); diff --git a/include/bb_editor.h b/include/bb_editor.h index 66e2eb0ff..2a46565da 100644 --- a/include/bb_editor.h +++ b/include/bb_editor.h @@ -26,7 +26,6 @@ #ifndef _BB_EDITOR_H #define _BB_EDITOR_H -#include "qt3support.h" #include "track_container.h" @@ -59,16 +58,16 @@ public: return( TRUE ); } - csize currentBB( void ) const; - tact FASTCALL lengthOfBB( const csize _bb ); + int currentBB( void ) const; + tact FASTCALL lengthOfBB( const int _bb ); inline tact lengthOfCurrentBB( void ) { return( lengthOfBB( currentBB() ) ); } - void FASTCALL removeBB( const csize _bb ); - csize numOfBBs( void ) const; + void FASTCALL removeBB( const int _bb ); + int numOfBBs( void ) const; - void FASTCALL swapBB( const csize _bb1, const csize _bb2 ); + void FASTCALL swapBB( const int _bb1, const int _bb2 ); void updateBBTrack( trackContentObject * _tco ); @@ -93,7 +92,7 @@ private: //bbEditor( const bbEditor & ); virtual ~bbEditor(); - void FASTCALL createTCOsForBB( const csize _bb ); + void FASTCALL createTCOsForBB( const int _bb ); QWidget * m_toolBar; diff --git a/include/bb_track.h b/include/bb_track.h index 9b69491db..cc65cd96d 100644 --- a/include/bb_track.h +++ b/include/bb_track.h @@ -27,21 +27,9 @@ #ifndef _BB_TRACK_H #define _BB_TRACK_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "track.h" class nameLabel; @@ -113,8 +101,8 @@ public: virtual void FASTCALL loadTrackSpecificSettings( const QDomElement & _this ); - static bbTrack * FASTCALL findBBTrack( csize _bb_num ); - static csize FASTCALL numOfBBTrack( track * _track ); + static bbTrack * FASTCALL findBBTrack( int _bb_num ); + static int FASTCALL numOfBBTrack( track * _track ); static void FASTCALL swapBBTracks( track * _track1, track * _track2 ); inline nameLabel * trackLabel( void ) @@ -149,9 +137,9 @@ protected: private: nameLabel * m_trackLabel; - vlist m_disabled_tracks; + QList m_disabled_tracks; - typedef QMap infoMap; + typedef QMap infoMap; static infoMap s_infoMap; } ; diff --git a/include/clipboard.h b/include/clipboard.h index 205b44fe9..6b7c40e39 100644 --- a/include/clipboard.h +++ b/include/clipboard.h @@ -30,21 +30,9 @@ #include #endif - -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - class journallingObject; diff --git a/include/combobox.h b/include/combobox.h index de88f8679..d15e9fbf8 100644 --- a/include/combobox.h +++ b/include/combobox.h @@ -26,26 +26,12 @@ #ifndef _COMBOBOX_H #define _COMBOBOX_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include #include -#else - -#include -#include -#include -#include -#include - -#endif - #include "automatable_object.h" @@ -95,14 +81,13 @@ private: typedef QPair item; - vvector m_items; + QVector m_items; bool m_pressed; private slots: void setItem( QAction * _item ); - void setItem( int _item ); signals: diff --git a/include/config_mgr.h b/include/config_mgr.h index fa57c9123..619c1bd41 100644 --- a/include/config_mgr.h +++ b/include/config_mgr.h @@ -31,25 +31,11 @@ #endif -#include "qt3support.h" - - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - class QLineEdit; class QLabel; @@ -201,7 +187,7 @@ protected slots: void backButtonClicked( void ); void nextButtonClicked( void ); - void switchPage( csize _pg ); + void switchPage( int _pg ); void switchPage( QWidget * _pg ); @@ -237,7 +223,7 @@ private: QStringList m_recentlyOpenedProjects; - typedef vvector > stringPairVector; + typedef QVector > stringPairVector; typedef QMap settingsMap; settingsMap m_settings; @@ -253,8 +239,8 @@ private: QLineEdit * m_wdLineEdit; // wizard stuff - vlist > m_pages; - csize m_currentPage; + QList > m_pages; + int m_currentPage; QFrame * m_hbar; QWidget * m_contentWidget; QLabel * m_title; diff --git a/include/cpuload_widget.h b/include/cpuload_widget.h index ee5c38995..d31b9798c 100644 --- a/include/cpuload_widget.h +++ b/include/cpuload_widget.h @@ -27,22 +27,10 @@ #ifndef _CPULOAD_WIDGET_H #define _CPULOAD_WIDGET_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "types.h" diff --git a/include/effect_chain.h b/include/effect_chain.h index 5eb1594bd..1b6011035 100644 --- a/include/effect_chain.h +++ b/include/effect_chain.h @@ -25,11 +25,9 @@ #ifndef _EFFECT_CHAIN_H #define _EFFECT_CHAIN_H -#include "qt3support.h" - #include "effect.h" -typedef vvector effect_list_t; +typedef QVector effect_list_t; class effectChain { diff --git a/include/effect_label.h b/include/effect_label.h index a003c044a..bdf16d670 100644 --- a/include/effect_label.h +++ b/include/effect_label.h @@ -26,22 +26,10 @@ #ifndef _EFFECT_LABEL_H #define _EFFECT_LABEL_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "journalling_object.h" diff --git a/include/effect_select_dialog.h b/include/effect_select_dialog.h index ad9d9a963..bea5d4a57 100644 --- a/include/effect_select_dialog.h +++ b/include/effect_select_dialog.h @@ -26,22 +26,8 @@ #ifndef _EFFECT_SELECT_DIALOG_H #define _EFFECT_SELECT_DIALOG_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#define QListBoxItem Q3ListBoxItem - -#else - -#include -#include - -#define Q3ListBox QListBox - -#endif #include "effect.h" @@ -94,11 +80,11 @@ protected: protected slots: void onHighlighted( int _plugin ); void onAddButtonReleased(); - void onDoubleClicked( QListBoxItem * _item ); + void onDoubleClicked( Q3ListBoxItem * _item ); private: - vvector m_pluginDescriptors; + QVector m_pluginDescriptors; effectKeyList m_effectKeys; effectKey m_currentSelection; diff --git a/include/effect_tab_widget.h b/include/effect_tab_widget.h index a29fc01e8..1739418e2 100644 --- a/include/effect_tab_widget.h +++ b/include/effect_tab_widget.h @@ -27,28 +27,10 @@ #ifndef _EFFECT_TAB_WIDGET_H #define _EFFECT_TAB_WIDGET_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include -#include -#include - -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - #include "journalling_object.h" #include "rack_view.h" diff --git a/include/embed.h b/include/embed.h index a115175d9..8ff591ff5 100644 --- a/include/embed.h +++ b/include/embed.h @@ -1,7 +1,7 @@ /* * embed.h - misc. stuff for using embedded data (resources linked into binary) * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,19 +26,9 @@ #ifndef _EMBED_H #define _EMBED_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif namespace embed { diff --git a/include/envelope_and_lfo_widget.h b/include/envelope_and_lfo_widget.h index e053d4c5f..8e9d67354 100644 --- a/include/envelope_and_lfo_widget.h +++ b/include/envelope_and_lfo_widget.h @@ -28,24 +28,9 @@ #ifndef _ENVELOPE_AND_LFO_WIDGET_H #define _ENVELOPE_AND_LFO_WIDGET_H -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - #include "journalling_object.h" #include "types.h" @@ -129,7 +114,7 @@ private: static QPixmap * s_envGraph; static QPixmap * s_lfoGraph; - static vvector s_EaLWidgets; + static QVector s_EaLWidgets; bool m_used; diff --git a/include/envelope_tab_widget.h b/include/envelope_tab_widget.h index 6a11b8638..2599c1994 100644 --- a/include/envelope_tab_widget.h +++ b/include/envelope_tab_widget.h @@ -28,19 +28,8 @@ #ifndef _ENVELOPE_TAB_WIDGET_H #define _ENVELOPE_TAB_WIDGET_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "mixer.h" diff --git a/include/export_project_dialog.h b/include/export_project_dialog.h index 7cdf22c03..c51366930 100644 --- a/include/export_project_dialog.h +++ b/include/export_project_dialog.h @@ -27,22 +27,8 @@ #ifndef _EXPORT_PROJECT_DIALOG_H #define _EXPORT_PROJECT_DIALOG_H -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "export.h" @@ -81,8 +67,7 @@ private: void finishProjectExport( void ); void abortProjectExport( void ); - static fileTypes FASTCALL getFileTypeFromExtension( const QString & - _ext ); + static fileTypes getFileTypeFromExtension( const QString & _ext ); static Sint16 s_availableBitrates[]; diff --git a/include/fade_button.h b/include/fade_button.h index 2c672fbb1..44080df0e 100644 --- a/include/fade_button.h +++ b/include/fade_button.h @@ -26,21 +26,9 @@ #ifndef _FADE_BUTTON_H #define _FADE_BUTTON_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - class fadeButton : public QAbstractButton { @@ -58,11 +46,7 @@ public slots: protected: -#ifndef QT3 virtual void customEvent( QEvent * ); -#else - virtual void customEvent( QCustomEvent * ); -#endif virtual void paintEvent( QPaintEvent * _pe ); diff --git a/include/file_browser.h b/include/file_browser.h index 00339bce8..55913e9cb 100644 --- a/include/file_browser.h +++ b/include/file_browser.h @@ -26,37 +26,16 @@ #ifndef _FILE_BROWSER_H #define _FILE_BROWSER_H -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include "qt3support.h" - -#ifdef QT4 - #include #include - -#else - -#include -#include -#include - -#define cleanPath cleanDirPath - -#endif +class QColorGroup; +#include #include "side_bar_widget.h" -#ifndef QT3 class QListViewItem; -#else -class Q3ListViewItem; -#endif class QPixmap; class fileItem; @@ -138,16 +117,7 @@ private: -class directory : -#ifndef QT3 - public Q3ListViewItem -// trick moc -#if 0 - , -#endif -#else - public QListViewItem -#endif +class directory : public Q3ListViewItem { public: directory( Q3ListView * _parent, const QString & _filename, @@ -182,7 +152,7 @@ public: private: void initPixmapStuff( void ); - void FASTCALL setPixmap( const QPixmap * _px ); + void setPixmap( const QPixmap * _px ); bool addItems( const QString & _path ); @@ -201,27 +171,13 @@ private: -class fileItem : -#ifndef QT3 - public Q3ListViewItem -// trick moc -#if 0 - , -#endif -#else - public QListViewItem -#endif +class fileItem : public Q3ListViewItem { public: fileItem( Q3ListView * _parent, const QString & _name, const QString & _path ); -#ifndef QT3 fileItem( Q3ListViewItem * _parent, const QString & _name, const QString & _path ); -#else - fileItem( QListViewItem * _parent, const QString & _name, - const QString & _path ); -#endif inline QString fullName( void ) const { @@ -265,9 +221,5 @@ private: } ; -#ifdef QT3 -#undef cleanPath -#endif - #endif diff --git a/include/group_box.h b/include/group_box.h index 08767c92d..379dbc1e5 100644 --- a/include/group_box.h +++ b/include/group_box.h @@ -26,18 +26,8 @@ #ifndef _GROUP_BOX_H #define _GROUP_BOX_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "pixmap_button.h" diff --git a/include/gui_templates.h b/include/gui_templates.h index c59d24599..1bbda2cab 100644 --- a/include/gui_templates.h +++ b/include/gui_templates.h @@ -1,7 +1,7 @@ /* * gui_templates.h - GUI-specific templates * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,22 +26,10 @@ #ifndef _GUI_TEMPLATES_H #define _GUI_TEMPLATES_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include -#include - -#endif // return DPI-independent font-size - font with returned font-size has always @@ -50,13 +38,8 @@ template inline QFont pointSize( QFont _f ) { static const int DPI = 96; -#ifdef QT4 _f.setPointSizeF( (float) SIZE * DPI / QApplication::desktop()->logicalDpiY() ); -#else - _f.setPointSizeFloat( (float) SIZE * DPI / - QPaintDeviceMetrics( qApp->desktop() ).logicalDpiY() ); -#endif return( _f ); } @@ -64,13 +47,8 @@ inline QFont pointSize( QFont _f ) inline QFont pointSizeF( QFont _f, float SIZE ) { static const int DPI = 96; -#ifdef QT4 _f.setPointSizeF( SIZE * DPI / QApplication::desktop()->logicalDpiY() ); -#else - _f.setPointSizeFloat( SIZE * DPI / - QPaintDeviceMetrics( qApp->desktop() ).logicalDpiY() ); -#endif return( _f ); } diff --git a/include/import_filter.h b/include/import_filter.h index 61c05ad36..2420598df 100644 --- a/include/import_filter.h +++ b/include/import_filter.h @@ -27,23 +27,8 @@ #ifndef _IMPORT_FILTER_H #define _IMPORT_FILTER_H -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "plugin.h" @@ -82,34 +67,22 @@ protected: inline int readByte( void ) { -#ifdef QT4 char c; if( m_file.getChar( &c ) ) { return( static_cast( c ) ); } return( -1 ); -#else - return( m_file.getch() ); -#endif } inline int readBlock( char * _data, int _len ) { -#ifndef QT3 return( m_file.read( _data, _len ) ); -#else - return( m_file.readBlock( _data, _len ) ); -#endif } inline void ungetChar( int _ch ) { -#ifndef QT3 m_file.ungetChar( _ch ); -#else - m_file.ungetch( _ch ); -#endif } virtual void FASTCALL saveSettings( QDomDocument &, diff --git a/include/instrument.h b/include/instrument.h index 1f1888f35..a9a8035c5 100644 --- a/include/instrument.h +++ b/include/instrument.h @@ -28,26 +28,9 @@ #define _INSTRUMENT_H -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "plugin.h" #include "mixer.h" diff --git a/include/instrument_track.h b/include/instrument_track.h index df47fb530..3a7447587 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -27,22 +27,10 @@ #ifndef _INSTRUMENT_TRACK_H #define _INSTRUMENT_TRACK_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "midi_event_processor.h" #include "mixer.h" #include "tab_widget.h" @@ -220,7 +208,7 @@ private: tones m_baseTone; octaves m_baseOctave; - vlist m_processHandles; + QList m_processHandles; // widgets on the top of a instrument-track-window @@ -248,14 +236,10 @@ private: volumeKnob * m_tswVolumeKnob; fadeButton * m_tswActivityIndicator; instrumentTrackButton * m_tswInstrumentTrackButton; + QMenu * m_tswMidiMenu; -#ifdef QT4 QAction * m_midiInputAction; QAction * m_midiOutputAction; -#else - int m_midiInputID; - int m_midiOutputID; -#endif friend class instrumentTrackButton; friend class notePlayHandle; @@ -277,23 +261,6 @@ public: instrumentTrackButton( instrumentTrack * _instrument_track ); virtual ~instrumentTrackButton(); -#ifdef QT3 - inline void setChecked( bool _on ) - { - setOn( _on ); - } - - inline bool isChecked( void ) const - { - return( isOn() ); - } - - inline void setCheckable( bool _on ) - { - QPushButton::setToggleButton( _on ); - } -#endif - protected: // since we want to draw a special label (instrument- and instrument- diff --git a/include/journalling_object.h b/include/journalling_object.h index 0de9ced1f..48b1763ec 100644 --- a/include/journalling_object.h +++ b/include/journalling_object.h @@ -31,21 +31,11 @@ #endif #include "types.h" -#include "qt3support.h" - -#ifndef QT3 #include #include #include -#else - -#include -#include -#include - -#endif class QDomDocument; @@ -105,7 +95,7 @@ private: } ; -typedef vvector journalEntryVector; +typedef QVector journalEntryVector; @@ -209,7 +199,7 @@ private: bool m_journalling; - vstack m_journallingStateStack; + QStack m_journallingStateStack; } ; diff --git a/include/kmultitabbar-qt3.h b/include/kmultitabbar-qt3.h deleted file mode 100644 index 159ce4088..000000000 --- a/include/kmultitabbar-qt3.h +++ /dev/null @@ -1,296 +0,0 @@ -/*************************************************************************** - kmultitabbar.h - description - ------------------- - begin : 2001 - copyright : (C) 2001,2002,2003 by Joseph Wenninger - ***************************************************************************/ - -/*************************************************************************** - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301 USA. - ***************************************************************************/ - -#ifndef _KMultitabbar_qt3_h_ -#define _KMultitabbar_qt3_h_ - -#include "qt3support.h" - -#include -#include -#include -#include -#include -#include -#include - -class KMultiTabBarButton; -class KMultiTabBarTab; - -typedef QPtrList buttonList; -typedef QPtrList tabList; - - -class QPixmap; -class QPainter; -class QFrame; - -class KMultiTabBarPrivate; -class KMultiTabBarTabPrivate; -class KMultiTabBarButtonPrivate; -class KMultiTabBarInternal; - -/** - * A Widget for horizontal and vertical tabs. - * It is possible to add normal buttons to the top/left - * The handling if only one tab at a time or multiple tabs - * should be raisable is left to the "user". - *@author Joseph Wenninger - */ -class KMultiTabBar: public QWidget -{ - Q_OBJECT -public: - enum KMultiTabBarMode{ Horizontal, Vertical }; - enum KMultiTabBarPosition{Left, Right, Top, Bottom}; - - /** - * VSNET == Visual Studio .Net like (only show the text of active tabs - * KDEV3 == Kdevelop 3 like (always show the text) - * KONQSBC == konqy's classic sidebar style (unthemed), this one is disabled - * at the moment, but will be renabled soon too - */ - enum KMultiTabBarStyle{VSNET=0, KDEV3=1, KONQSBC=2, KDEV3ICON=3,STYLELAST=0xffff}; - - KMultiTabBar(KMultiTabBarMode m,QWidget *parent=0); - virtual ~KMultiTabBar(); - - /** - * append a new button to the button area. The button can later on be accessed with button(ID) - * eg for connecting signals to it - * @param pic a pixmap for the button - * @param id an arbitraty ID value. It will be emitted in the clicked signal for identifying the button - * if more than one button is connected to a signals. - * @param popup A popup menu which should be displayed if the button is clicked - * @param not_used_yet will be used for a popup text in the future - */ - int appendButton(const QPixmap &pic,int id=-1,QMenu* popup=0,const QString& not_used_yet=QString::null); - /** - * remove a button with the given ID - */ - void removeButton(int id); - /** - * append a new tab to the tab area. It can be accessed lateron with tabb(id); - * @param pic a bitmap for the tab - * @param id an arbitrary ID which can be used later on to identify the tab - * @param text if a mode with text is used it will be the tab text, otherwise a mouse over hint - */ - int appendTab(const QPixmap &pic,int id=-1,const QString& text=QString::null); - /** - * remove a tab with a given ID - */ - void removeTab(int id); - /** - * set a tab to "raised" - * @param id The ID of the tab to manipulate - * @param state true == activated/raised, false == not active - */ - void setTab(int id ,bool state); - /** - * return the state of a tab, identified by it's ID - */ - bool isTabRaised(int id) const; - /** - * get a pointer to a button within the button area identified by its ID - */ - class KMultiTabBarButton *button(int id) const; - - /** - * get a pointer to a tab within the tab area, identiifed by its ID - */ - class KMultiTabBarTab *tab(int id) const; - /** - * set the real position of the widget. - * @param pos if the mode is horizontal, only use top, bottom, if it is vertical use left or right - */ - void setPosition(KMultiTabBarPosition pos); - /** - * set the display style of the tabs - */ - void setStyle(KMultiTabBarStyle style); - /** - * be carefull, don't delete tabs yourself and don't delete the list itself - */ - tabList * tabs(); - /** - * be carefull, don't delete buttons yourself and don't delete the list itself - */ - buttonList * buttons(); - - /** - * might vanish, not sure yet - */ - void showActiveTabTexts(bool show=true); -protected: - friend class KMultiTabBarButton; - virtual void fontChange( const QFont& ); - void updateSeparator(); -private: - class KMultiTabBarInternal *m_internal; - QBoxLayout *m_l; - QFrame *m_btnTabSep; - buttonList m_buttons; - KMultiTabBarPosition m_position; - KMultiTabBarPrivate *d; -}; - -/** - * This class should never be created except with the appendButton call of KMultiTabBar - */ -class KMultiTabBarButton: public QPushButton -{ - Q_OBJECT -public: - KMultiTabBarButton(const QPixmap& pic,const QString&, QMenu *popup, - int id,QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style); - KMultiTabBarButton(const QString&, QMenu *popup, - int id,QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style); - virtual ~KMultiTabBarButton(); - int id() const; - -public slots: - /** - * this is used internaly, but can be used by the user, if (s)he wants to - * It the according call of KMultiTabBar is invoked though this modifications will be overwritten - */ - void setPosition(KMultiTabBar::KMultiTabBarPosition); - /** - * this is used internaly, but can be used by the user, if (s)he wants to - * It the according call of KMultiTabBar is invoked though this modifications will be overwritten - */ - void setStyle(KMultiTabBar::KMultiTabBarStyle); - - /** - * modify the text of the button - */ - void setText(const QString &); - - QSize sizeHint() const; - -protected: - KMultiTabBar::KMultiTabBarPosition m_position; - KMultiTabBar::KMultiTabBarStyle m_style; - QString m_text; - virtual void hideEvent( class QHideEvent*); - virtual void showEvent( class QShowEvent*); -private: - int m_id; - KMultiTabBarButtonPrivate *d; -signals: - /** - * this is emitted if the button is clicked - * @param id the ID identifying the button - */ - void clicked(int id); -protected slots: - virtual void slotClicked(); -}; - -/** - * This class should never be created except with the appendTab call of KMultiTabBar - */ -class KMultiTabBarTab: public KMultiTabBarButton -{ - Q_OBJECT -public: - KMultiTabBarTab(const QPixmap& pic,const QString&,int id,QWidget *parent, - KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style); - virtual ~KMultiTabBarTab(); - /** - * set the active state of the tab - * @param state true==active false==not active - */ - void setState(bool state); - /** - * choose if the text should always be displayed - * this is only used in classic mode if at all - */ - void showActiveTabText(bool show); - void resize(){ setSize( neededSize() ); } - virtual inline const QColorGroup & palette( void ) const - { - return( colorGroup() ); - } -private: - bool m_showActiveTabText; - int m_expandedSize; - KMultiTabBarTabPrivate *d; -protected: - friend class KMultiTabBarInternal; - void setSize(int); - int neededSize(); - void updateState(); - virtual void drawButton(QPainter *); - virtual void drawButtonLabel(QPainter *); - void drawButtonStyled(QPainter *); - void drawButtonClassic(QPainter *); -protected slots: - virtual void slotClicked(); - void setTabsPosition(KMultiTabBar::KMultiTabBarPosition); - -public slots: - virtual void setIcon(const QString&); - virtual void setIcon(const QPixmap&); -}; - - - -class KMultiTabBarInternal: public Q3ScrollView -{ - Q_OBJECT -public: - KMultiTabBarInternal(QWidget *parent, KMultiTabBar::KMultiTabBarMode m); - int appendTab(const QPixmap &,int=-1,const QString& =QString::null); - KMultiTabBarTab *tab(int) const; - void removeTab(int); - void setPosition(enum KMultiTabBar::KMultiTabBarPosition pos); - void setStyle(enum KMultiTabBar::KMultiTabBarStyle style); - void showActiveTabTexts(bool show); - tabList * tabs(){return &m_tabs;} - virtual inline const QColorGroup & palette( void ) const - { - return( colorGroup() ); - } -private: - friend class KMultiTabBar; - QWidget *box; - QBoxLayout *mainLayout; - tabList m_tabs; - enum KMultiTabBar::KMultiTabBarPosition m_position; - bool m_showActiveTabTexts; - enum KMultiTabBar::KMultiTabBarStyle m_style; - int m_expandedTabSize; - int m_lines; -protected: - /** - * [contentsM|m]ousePressEvent are reimplemented from QScrollView - * in order to ignore all mouseEvents on the viewport, so that the - * parent can handle them. - */ - virtual void contentsMousePressEvent(QMouseEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void resizeEvent(QResizeEvent *); -}; - -#endif diff --git a/include/kmultitabbar.h b/include/kmultitabbar.h index 90f47d77e..3bec1ee9d 100644 --- a/include/kmultitabbar.h +++ b/include/kmultitabbar.h @@ -25,8 +25,6 @@ #ifndef _KMultitabbar_h_ #define _KMultitabbar_h_ -#ifndef QT3 - #include #include #include @@ -307,10 +305,5 @@ protected: }; -#else - -#include "kmultitabbar-qt3.h" - -#endif #endif diff --git a/include/knob.h b/include/knob.h index 075eec18e..f614550eb 100644 --- a/include/knob.h +++ b/include/knob.h @@ -29,21 +29,9 @@ #ifndef _KNOB_H #define _KNOB_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "automatable_object.h" diff --git a/include/lcd_spinbox.h b/include/lcd_spinbox.h index b0a826038..8f788a36c 100644 --- a/include/lcd_spinbox.h +++ b/include/lcd_spinbox.h @@ -26,21 +26,9 @@ #ifndef _LCD_SPINBOX_H #define _LCD_SPINBOX_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "automatable_object.h" diff --git a/include/main_window.h b/include/main_window.h index dad08d7d6..c4fbfd94f 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -26,28 +26,11 @@ #ifndef _MAIN_WINDOW_H #define _MAIN_WINDOW_H -#include "qt3support.h" - -#ifdef QT4 - +#include #include #include #include -#else - -#include -#include -#include - -#endif - - -#ifdef HAVE_CONFIG_H -#include -#endif - - class QAction; class QDomElement; class QGridLayout; @@ -75,7 +58,7 @@ public: int addWidgetToToolBar( QWidget * _w, int _row = -1, int _col = -1 ); void addSpacingToToolBar( int _size ); - void FASTCALL resetWindowTitle( const QString & _add = "" ); + void resetWindowTitle( const QString & _add = "" ); void clearKeyModifiers( void ); @@ -110,7 +93,6 @@ public slots: } void createNewProject( void ); void createNewProjectFromTemplate( QAction * _idx ); - void createNewProjectFromTemplate( int _id ); void openProject( void ); void updateRecentlyOpenedProjectsMenu( void ); void openRecentlyOpenedProject( int ); @@ -169,7 +151,7 @@ private: } m_keyMods; QMenu * m_tools_menu; - vlist m_tools; + QList m_tools; friend class engine; @@ -179,7 +161,6 @@ private slots: void browseHelp( void ); void fillTemplatesMenu( void ); void showTool( QAction * _idx ); - void showTool( int _idx ); } ; diff --git a/include/midi_alsa_raw.h b/include/midi_alsa_raw.h index ea36e9136..33b168cc8 100644 --- a/include/midi_alsa_raw.h +++ b/include/midi_alsa_raw.h @@ -38,19 +38,8 @@ #include -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "midi_client.h" diff --git a/include/midi_alsa_seq.h b/include/midi_alsa_seq.h index 4e0d928ef..a2cc5c7bd 100644 --- a/include/midi_alsa_seq.h +++ b/include/midi_alsa_seq.h @@ -40,21 +40,9 @@ #endif -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include -#include - -#endif - #include "midi_client.h" @@ -63,11 +51,7 @@ struct pollfd; class QLineEdit; -class midiALSASeq : -#ifndef QT4 - public QObject, -#endif - public midiClient, public QThread +class midiALSASeq : public QThread, public midiClient { Q_OBJECT public: diff --git a/include/midi_client.h b/include/midi_client.h index f23258e8b..b51aa74f3 100644 --- a/include/midi_client.h +++ b/include/midi_client.h @@ -26,20 +26,9 @@ #ifndef _MIDI_CLIENT_H #define _MIDI_CLIENT_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - #include "midi.h" #include "midi_event_processor.h" @@ -116,11 +105,7 @@ public: public: setupWidget( const QString & _caption, QWidget * _parent ) : tabWidget( tabWidget::tr( "Settings for %1" ).arg( - tr( _caption -#ifndef QT3 - .toAscii() -#endif - ) ).toUpper(), _parent ) + tr( _caption.toAscii() ) ).toUpper(), _parent ) { } @@ -142,7 +127,7 @@ public: protected: - vvector m_midiPorts; + QVector m_midiPorts; } ; diff --git a/include/midi_mapper.h b/include/midi_mapper.h index e4b4e4b10..53bb60887 100644 --- a/include/midi_mapper.h +++ b/include/midi_mapper.h @@ -1,7 +1,7 @@ /* * midi_mapper.h - MIDI-mapper for any midiDevice * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,25 +26,13 @@ #ifndef _MIDI_MAPPER_H #define _MIDI_MAPPER_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include -#include - -#endif - - #include "types.h" #include "midi.h" + const Uint8 MIDI_PROGRAMS = 128; const Uint8 MIDI_KEYS = 128; diff --git a/include/midi_port.h b/include/midi_port.h index aa9b2e167..0596ef685 100644 --- a/include/midi_port.h +++ b/include/midi_port.h @@ -27,18 +27,8 @@ #ifndef _MIDI_PORT_H #define _MIDI_PORT_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #ifdef HAVE_CONFIG_H #include #endif diff --git a/include/midi_tab_widget.h b/include/midi_tab_widget.h index bff3193cd..775dcd790 100644 --- a/include/midi_tab_widget.h +++ b/include/midi_tab_widget.h @@ -27,22 +27,8 @@ #ifndef _MIDI_TAB_WIDGET_H #define _MIDI_TAB_WIDGET_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - #include "journalling_object.h" @@ -87,9 +73,6 @@ protected slots: void writeablePortsChanged( void ); void activatedReadablePort( QAction * _item ); void activatedWriteablePort( QAction * _item ); - // Qt3-version - void activatedReadablePort( int _id ); - void activatedWriteablePort( int _id ); private: instrumentTrack * m_instrumentTrack; diff --git a/include/mixer.h b/include/mixer.h index 53fba8fd6..11a04ba04 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -30,23 +30,10 @@ #include #endif -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "types.h" #include "note.h" @@ -138,7 +125,7 @@ public: inline void removeAudioPort( audioPort * _port ) { lock(); - vvector::iterator it = qFind( m_audioPorts.begin(), + QVector::iterator it = qFind( m_audioPorts.begin(), m_audioPorts.end(), _port ); if( it != m_audioPorts.end() ) @@ -352,14 +339,14 @@ private: const surroundSampleFrame * renderNextBuffer( void ); - vvector m_audioPorts; + QVector m_audioPorts; fpp_t m_framesPerPeriod; surroundSampleFrame * m_readBuf; surroundSampleFrame * m_writeBuf; - vvector m_bufferPool; + QVector m_bufferPool; Uint8 m_readBuffer; Uint8 m_writeBuffer; Uint8 m_analBuffer; diff --git a/include/mmp.h b/include/mmp.h index da7723199..9df0db683 100644 --- a/include/mmp.h +++ b/include/mmp.h @@ -26,24 +26,8 @@ #ifndef _MMP_H #define _MMP_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - -#ifdef HAVE_CONFIG_H -#include -#endif - - #include "types.h" @@ -73,7 +57,7 @@ public: multimediaProject( projectTypes _project_type ); ~multimediaProject(); - bool FASTCALL writeFile( QString & _fn, bool _overwrite_check = TRUE ); + bool writeFile( QString & _fn, bool _overwrite_check = TRUE ); inline QDomElement & content( void ) { @@ -89,12 +73,12 @@ public: return( m_type ); } - static projectTypes FASTCALL typeOfFile( const QString & _fn ); + static projectTypes typeOfFile( const QString & _fn ); private: - static projectTypes FASTCALL type( const QString & _type_name ); - static QString FASTCALL typeName( projectTypes _project_type ); + static projectTypes type( const QString & _type_name ); + static QString typeName( projectTypes _project_type ); void cleanMetaNodes( QDomElement _de ); diff --git a/include/name_label.h b/include/name_label.h index 8eede8a29..099d4dfe8 100644 --- a/include/name_label.h +++ b/include/name_label.h @@ -27,20 +27,9 @@ #ifndef _NAME_LABEL_H #define _NAME_LABEL_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - class nameLabel : public QLabel { diff --git a/include/note.h b/include/note.h index 4b7cf1b42..5d7b1110c 100644 --- a/include/note.h +++ b/include/note.h @@ -27,22 +27,8 @@ #ifndef _NOTE_H #define _NOTE_H -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "volume.h" #include "panning.h" #include "midi_time.h" @@ -216,7 +202,7 @@ private: } ; -typedef vvector noteVector; +typedef QVector noteVector; #endif diff --git a/include/note_play_handle.h b/include/note_play_handle.h index ed4f31d71..5866cedf2 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -38,8 +38,8 @@ class notePlayHandle; -typedef vvector notePlayHandleVector; -typedef vvector constNotePlayHandleVector; +typedef QVector notePlayHandleVector; +typedef QVector constNotePlayHandleVector; class notePlayHandle : public playHandle, public note diff --git a/include/nstate_button.h b/include/nstate_button.h index 0b5fcd667..b05f18242 100644 --- a/include/nstate_button.h +++ b/include/nstate_button.h @@ -30,22 +30,10 @@ #include #endif -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "tool_button.h" @@ -81,7 +69,7 @@ protected: private: - vvector > m_states; + QVector > m_states; QString m_generalToolTip; int m_curState; diff --git a/include/pattern.h b/include/pattern.h index a7f9de486..b42f27b84 100644 --- a/include/pattern.h +++ b/include/pattern.h @@ -27,26 +27,12 @@ #ifndef _PATTERN_H #define _PATTERN_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include #include -#else - -#include -#include -#include -#include -#include - -#endif - #include "note.h" #include "track.h" diff --git a/include/piano_roll.h b/include/piano_roll.h index 6f7119342..84d40d9cb 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -27,19 +27,7 @@ #ifndef _PIANO_ROLL_H #define _PIANO_ROLL_H -#include "qt3support.h" - -#ifdef QT4 - #include -#include - -#else - -#include -#include - -#endif #include "types.h" #include "note.h" diff --git a/include/piano_widget.h b/include/piano_widget.h index f54f52eb8..a5611979b 100644 --- a/include/piano_widget.h +++ b/include/piano_widget.h @@ -27,22 +27,10 @@ #ifndef _PIANO_WIDGET_H #define _PIANO_WIDGET_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "note.h" @@ -81,11 +69,7 @@ public: protected: virtual void contextMenuEvent( QContextMenuEvent * _me ); -#ifndef QT3 virtual void customEvent( QEvent * ); -#else - virtual void customEvent( QCustomEvent * ); -#endif virtual void paintEvent( QPaintEvent * ); virtual void mousePressEvent( QMouseEvent * me ); virtual void mouseReleaseEvent( QMouseEvent * me ); diff --git a/include/pixmap_button.h b/include/pixmap_button.h index 066d5da54..d34fe7c98 100644 --- a/include/pixmap_button.h +++ b/include/pixmap_button.h @@ -26,19 +26,8 @@ #ifndef _PIXMAP_BUTTON_H #define _PIXMAP_BUTTON_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "automatable_button.h" diff --git a/include/play_handle.h b/include/play_handle.h index a12a512b6..ed3ddbf61 100644 --- a/include/play_handle.h +++ b/include/play_handle.h @@ -27,22 +27,8 @@ #ifndef _PLAY_HANDLE_H #define _PLAY_HANDLE_H -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "types.h" class track; @@ -109,8 +95,8 @@ private: } ; -typedef vvector playHandleVector; -typedef vvector constPlayHandleVector; +typedef QVector playHandleVector; +typedef QVector constPlayHandleVector; #endif diff --git a/include/plugin.h b/include/plugin.h index ae2cb6f31..52b7d60fd 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -27,25 +27,10 @@ #define _PLUGIN_H -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "qt3support.h" - -#ifdef QT4 - #include +#include #include -#else - -#include -#include - -#endif - - #include "journalling_object.h" #include "base64.h" @@ -105,7 +90,7 @@ public: : desc( NULL ) { - const vlist l = + const QList l = base64::decode( _dump_data ). toList(); name = l[0].toString(); @@ -114,14 +99,14 @@ public: inline QString dumpBase64( void ) const { return( base64::encode( - vlist() + QList() << name << user ) ); } plugin::descriptor * desc; QString name; QVariant user; }; - typedef vlist keyList; + typedef QList keyList; subPluginFeatures( plugin::pluginTypes _type ) : m_type( _type ) @@ -208,7 +193,7 @@ public: // fills given vector with descriptors of all available plugins static void FASTCALL getDescriptorsOfAvailPlugins( - vvector & _plugin_descs ); + QVector & _plugin_descs ); private: const descriptor * m_descriptor; diff --git a/include/plugin_browser.h b/include/plugin_browser.h index f736f278a..f49290593 100644 --- a/include/plugin_browser.h +++ b/include/plugin_browser.h @@ -26,27 +26,10 @@ #ifndef _PLUGIN_BROWSER_H #define _PLUGIN_BROWSER_H -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "side_bar_widget.h" #include "plugin.h" @@ -64,7 +47,7 @@ public: private: - vvector m_pluginDescriptors; + QVector m_pluginDescriptors; QWidget * m_view; diff --git a/include/preset_preview_play_handle.h b/include/preset_preview_play_handle.h index 24cd7c9e9..89ac73cb6 100644 --- a/include/preset_preview_play_handle.h +++ b/include/preset_preview_play_handle.h @@ -27,9 +27,6 @@ #ifndef _PRESET_PREVIEW_PLAY_HANDLE_H #define _PRESET_PREVIEW_PLAY_HANDLE_H -#include "qt3support.h" - - #include "note_play_handle.h" diff --git a/include/project_journal.h b/include/project_journal.h index 662a085ba..782886a0e 100644 --- a/include/project_journal.h +++ b/include/project_journal.h @@ -26,22 +26,11 @@ #ifndef _PROJECT_JOURNAL_H #define _PROJECT_JOURNAL_H -#include "types.h" -#include "qt3support.h" - -#ifndef QT3 - #include #include #include -#else - -#include -#include -#include - -#endif +#include "types.h" class journallingObject; @@ -108,12 +97,8 @@ public: private: -#ifndef QT3 typedef QHash joIDMap; -#else - typedef QMap joIDMap; -#endif - typedef vvector journalEntryVector; + typedef QVector journalEntryVector; joIDMap m_joIDs; diff --git a/include/project_notes.h b/include/project_notes.h index cfcd1349e..b0e91a956 100644 --- a/include/project_notes.h +++ b/include/project_notes.h @@ -26,19 +26,8 @@ #ifndef _PROJECT_NOTES_H #define _PROJECT_NOTES_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include -#define textColor color - -#endif - #include "journalling_object.h" diff --git a/include/qt3support.h b/include/qt3support.h deleted file mode 100644 index 07e02d259..000000000 --- a/include/qt3support.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - * qt3support.h - layer for supporting Qt3 - * - * Copyright (c) 2005-2007 Tobias Doerffel - * - * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program (see COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - */ - - -#ifndef _QT3SUPPORT_H -#define _QT3SUPPORT_H - - -#include -#include - -#if QT_VERSION >= 0x040000 - -#ifndef QT4 -#define QT4 -#endif - -#else - -#ifndef QT3 -#define QT3 -#endif - -#endif - - -#ifdef QT4 - - -class QColorGroup; -#include - - -typedef int csize; - -#define vlist QList -#define vstack QStack -#define vvector QVector - -#include - -inline QString baseName( const QString & _file ) -{ - return( QFileInfo( _file ).absolutePath() + "/" + - QFileInfo( _file ).completeBaseName() ); -} - - -#else /* QT3 */ - - -#define vlist QValueList -#define vstack QValueStack -#define vvector QValueVector - -#define qSort qHeapSort - -#define QMenu QPopupMenu -#define QAbstractButton QButton -#define QScrollArea QScrollView - -#define Q3ListView QListView -#define Q3ScrollView QScrollView - -#define QMatrix QWMatrix -#define QIcon QIconSet -#define QAbstractButton QButton - - -// QWidget -#define setWindowTitle setCaption -#define setWindowIcon setIcon -#define windowIcon icon -#define isExplicitlyHidden isHidden -#define accessibleName name -#define ensurePolished constPolish - - -// QMenu/QPopupMenu -#define addAction insertItem - - -// QFile/QIODevice -#define seek at - - -// QFileDialog -#define setFileMode setMode -#define setDirectory setDir -#define selectFile setSelection - - -// QThread -#define isRunning running - - -// QScrollView/QScrollArea -#define setHorizontalScrollBarPolicy setHScrollBarMode -#define setVerticalScrollBarPolicy setVScrollBarMode - - -// QScrollBar -#define setMaximum setMaxValue -#define setMinimum setMinValue - - -// QAbstractButton/QButton -#define setShortcut setAccel - - -// QInputEvent/QKeyEvent -#define modifiers state - - -// QProgressBar -#define setTextVisible setPercentageVisible - - -// QComboBox -#define addItem insertItem - - -// QString -#define toLower lower -#define toUpper upper - -// QTextEdit -#define setLineWrapMode setWordWrap -#define setPlainText setText - - -// QSlider -#define setTickPosition setTickmarks - - -// QStatusBar/QSplashScreen -#define showMessage message -#define clearMessage clear - - -// QDir -#define NoFilter DefaultFilter -#define homePath homeDirPath -#define rootPath rootDirPath - - -// QFileInfo -#define absoluteFilePath absFilePath - - -// QToolButton -#define setMenu setPopup - - -// QPixmap -#define transformed xForm - - -// QList -#define removeAll remove - - -// QGridLayout -#define setColumnStretch setColStretch -#define columnCount numCols -#define setColumnMinimumWidth setColSpacing - - -// QPointer -#define QPointer QGuardedPtr - - -// QRect -#define normalized normalize - - -// Qt-namespace -#define ShiftModifier ShiftButton -#define ControlModifier ControlButton -#define Alignment AlignmentFlags -#define TextWordWrap WordBreak - -typedef unsigned int csize; - -// some compat-stuff for older qt-versions... -#if QT_VERSION < 0x030200 - -#define wasCanceled wasCancelled - -#endif - -#include - - -inline QString baseName( const QString & _file ) -{ - return( QFileInfo( _file ).dirPath() + "/" + - QFileInfo( _file ).baseName( TRUE ) ); -} - - - -#if QT_VERSION < 0x030100 - -#include - -// Qt 3.0.x doesn't have QMutexLocker, so we implement it on our own... -class QMutexLocker -{ -public: - QMutexLocker( QMutex * _m ) : - m_mutex( _m ) - { - m_mutex->lock(); - } - ~QMutexLocker() - { - m_mutex->unlock(); - } - -private: - QMutex * m_mutex; - -} ; - - -#endif - - -#endif - - -#endif diff --git a/include/qxembed.h b/include/qxembed.h deleted file mode 100644 index f1c2b90b4..000000000 --- a/include/qxembed.h +++ /dev/null @@ -1,238 +0,0 @@ -/**************************************************************************** - Definition of QXEmbed class - - Copyright (C) 1999-2000 Troll Tech AS - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*****************************************************************************/ - -#ifndef QXEMBED_H -#define QXEMBED_H - -#include "qt3support.h" - -#ifndef QT4 - -#include - - -#ifdef Q_WS_X11 - -class QXEmbedData; - -/** - * A QXEmbed widget serves as an embedder that can manage one single embedded - * X-window. These so-called client windows can be arbitrary Qt or non Qt - * applications. - * - * There are two different ways of using QXEmbed, - * from the client side or from the embedder's side. - * - * Embedding from the client's side requires that the client knows the - * window identifier of the respective embedder widget. Use either - * embedClientIntoWindow() or the high-level wrapper processClientCmdline(). - * This is only possible when the client is a Qt application. - * - * When using it from the embedder's side, you must know the window - * identifier of the window that should be embedded. Simply call embed() - * with this identifier as parameter. If the client is a Qt application, - * make sure it has called QXEmbed::initialize(). Otherwise you should - * probably call setProtocol(XPLAIN) before embed(). - * - * Reimplement the change handler windowChanged() to catch embedding or - * the destruction of embedded windows. In the latter case, the - * embedder also emits a signal embeddedWindowDestroyed() for - * convenience. - * - * @short The QXEmbed widget is a graphical socket that can embed an external X-Window. -*/ -class QXEmbed : public QWidget -{ - Q_OBJECT - -public: - - /** - * - * Constructs a xembed widget. - * - * The parent, name and f arguments are passed to the QFrame - * constructor. - */ - QXEmbed( QWidget *parent=0, const char *name=0, WFlags f = 0 ); - - /** - * Destructor. Cleans up the focus if necessary. - */ - ~QXEmbed(); - - /** - * Embedded applications should call this function to make sure - * they support the XEMBED protocol. It is called automatically - * when you use embedClientIntoWindow() or - * processClientCmdline(). Clients might have to call it - * manually when you use embed(). - */ - static void initialize(); - - enum Protocol { XEMBED, XPLAIN }; - - /** - * Sets the protocol used for embedding windows. - * This function must be called before embedding a window. - * Protocol XEMBED provides maximal functionality (focus, tabs, etc) - * but requires explicit cooperation from the embedded window. - * Protocol XPLAIN provides maximal compatibility with - * embedded applications that do not support the XEMBED protocol. - * The default is XEMBED. - * - * Non KDE applications should be embedded with protocol XPLAIN. - * This does not happen automatically yet. - * You must call setProtocol() explicitly. - */ - - void setProtocol( Protocol proto ); - - /** - * Returns the protocol used for embedding the current window. - * - * @return the protocol used by QXEmbed. - */ - - Protocol protocol(); - - /** - * Embeds the window with the identifier w into this xembed widget. - * - * This function is useful if the embedder knows about the client window - * that should be embedded. Often it is vice versa: the client knows - * about its target embedder. In that case, it is not necessary to call - * embed(). Instead, the client will call the static function - * embedClientIntoWindow(). - * - * @param w the identifier of the window to embed - * @see embeddedWinId() - */ - void embed( WId w ); - - /** - * Returns the window identifier of the embedded window, or 0 if no - * window is embedded yet. - * - * @return the id of the embedded window (0 if no window is embedded) - */ - WId embeddedWinId() const; - - /** - * A function for clients that embed themselves. The widget - * client will be embedded in the window window. The application has - * to ensure that window is the handle of the window identifier of - * an QXEmbed widget. - * - * @short #processClientCmdline() - */ - static void embedClientIntoWindow( QWidget* client, WId window ); - - /** - * A utility function for clients that embed theirselves. The widget - * client will be embedded in the window that is passed as - * -embed command line argument. - * - * The function returns true on success or false if no such command line - * parameter is specified. - * - * @see embedClientIntoWindow() - */ - static bool processClientCmdline( QWidget* client, int& argc, char ** argv ); - - /** - * Sends a WM_DELETE_WINDOW message to the embedded window. This is what - * typically happens when you click on the close button of a window - * manager decoration. This should cause the embedded application to - * cleanly close the window. Signal embeddedWindowDestroyed() can be used - * to monitor the status of the embedded window. - */ - void sendDelete( void ); - - /** - * Selects what shoud be done with the embedded window when the embedding - * window is destroyed. When the argument is true, the embedded window is - * kept alive, is hidden, and receives a WM_DELETE_WINDOW message using - * sendDelete(). This is the default. Otherwise, the destruction of the - * QXEmbed object simply destroys the embedded window. - * - * @see sendDelete() - */ - void setAutoDelete( bool ); - - /** - * Returns the value of flag indicating what shoud be done with the - * embedded window when the embedding window is destroyed. - * - * @see setAutoDelete() - */ - bool autoDelete() const; - - /* Reimp */ - QSize sizeHint() const; - QSize minimumSizeHint() const; - QSizePolicy sizePolicy() const; - bool eventFilter( QObject *, QEvent * ); - bool customWhatsThis() const; - void enterWhatsThisMode(); // temporary, fix in Qt (Matthias, Mon Jul 17 15:20:55 CEST 2000 ) - virtual void reparent( QWidget * parent, WFlags f, const QPoint & p, bool showIt = false ); - -signals: - /** - * This signal is emitted when the embedded window has been lost (destroyed or reparented away) - * - * @see embeddedWinId() - */ - // KDE4 rename to embeddedWindowLost() - void embeddedWindowDestroyed(); - -protected: - bool event( QEvent * ); - void keyPressEvent( QKeyEvent * ); - void keyReleaseEvent( QKeyEvent * ); - void focusInEvent( QFocusEvent * ); - void focusOutEvent( QFocusEvent * ); - void resizeEvent(QResizeEvent *); - void showEvent( QShowEvent * ); - bool x11Event( XEvent* ); - - /** - * A change handler that indicates that the embedded window has been - * changed. The window handle can also be retrieved with - * embeddedWinId(). - * - * @param w the handle of the window that changed - */ - virtual void windowChanged( WId w ); - - bool focusNextPrevChild( bool next ); - -private: - WId window; - QXEmbedData* d; - void checkGrab(); - void sendSyntheticConfigureNotifyEvent(); -}; - - -#endif -#endif -#endif diff --git a/include/rack_view.h b/include/rack_view.h index d90f79dc5..c83fea3ab 100644 --- a/include/rack_view.h +++ b/include/rack_view.h @@ -25,24 +25,11 @@ #ifndef _RACK_VIEW_H #define _RACK_VIEW_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "types.h" #include "journalling_object.h" @@ -85,7 +72,7 @@ private: void redraw(); - vvector m_rackInserts; + QVector m_rackInserts; QVBoxLayout * m_mainLayout; QScrollArea * m_scrollArea; diff --git a/include/rename_dialog.h b/include/rename_dialog.h index 5d053e883..0cc78fe78 100644 --- a/include/rename_dialog.h +++ b/include/rename_dialog.h @@ -27,18 +27,8 @@ #ifndef _RENAME_DIALOG_H #define _RENAME_DIALOG_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - class QLineEdit; diff --git a/include/rubberband.h b/include/rubberband.h index 4b13a7e26..01f0f6418 100644 --- a/include/rubberband.h +++ b/include/rubberband.h @@ -27,20 +27,9 @@ #ifndef _RUBBERBAND_H #define _RUBBERBAND_H -#include "qt3support.h" - -#ifndef QT3 - #include #include -#else - -#include -#include - -#endif - class selectableObject : public QWidget { @@ -90,33 +79,21 @@ private: -typedef -#ifndef QT3 - QRubberBand -#else - QWidget -#endif - rubberBandBase; - -class rubberBand : public rubberBandBase +class rubberBand : public QRubberBand { public: rubberBand( QWidget * _parent ); virtual ~rubberBand(); - vvector selectedObjects( void ) const; + QVector selectedObjects( void ) const; protected: virtual void resizeEvent( QResizeEvent * _re ); -#ifdef QT3 - virtual bool event( QEvent * _e ); - void updateMask( void ); -#endif private: - vvector selectableObjects( void ) const; + QVector selectableObjects( void ) const; }; diff --git a/include/sample_buffer.h b/include/sample_buffer.h index dd033abaa..dacc7726b 100644 --- a/include/sample_buffer.h +++ b/include/sample_buffer.h @@ -26,19 +26,8 @@ #ifndef _SAMPLE_BUFFER_H #define _SAMPLE_BUFFER_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #ifdef HAVE_CONFIG_H #include #endif diff --git a/include/sample_track.h b/include/sample_track.h index bc64f14e2..b3e3bb10f 100644 --- a/include/sample_track.h +++ b/include/sample_track.h @@ -27,19 +27,8 @@ #ifndef _SAMPLE_TRACK_H #define _SAMPLE_TRACK_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "track.h" class QLabel; diff --git a/include/setup_dialog.h b/include/setup_dialog.h index 5f0df0745..d821ff5b7 100644 --- a/include/setup_dialog.h +++ b/include/setup_dialog.h @@ -26,21 +26,9 @@ #ifndef _SETUP_DIALOG_H #define _SETUP_DIALOG_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "audio_device.h" #include "midi_client.h" diff --git a/include/side_bar.h b/include/side_bar.h index 9ff0b1fd6..6a0c39c14 100644 --- a/include/side_bar.h +++ b/include/side_bar.h @@ -26,19 +26,8 @@ #ifndef _SIDE_BAR_H #define _SIDE_BAR_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "kmultitabbar.h" diff --git a/include/side_bar_widget.h b/include/side_bar_widget.h index e86a26cd7..dd9dfe536 100644 --- a/include/side_bar_widget.h +++ b/include/side_bar_widget.h @@ -1,7 +1,7 @@ /* * side_bar_widget.h - base-class for all side-bar-widgets * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,22 +26,10 @@ #ifndef _SIDE_BAR_WIDGET_H #define _SIDE_BAR_WIDGET_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - class sideBarWidget : public QWidget { diff --git a/include/song_editor.h b/include/song_editor.h index 54d548108..9185fc700 100644 --- a/include/song_editor.h +++ b/include/song_editor.h @@ -301,7 +301,7 @@ private: ACT_STOP_PLAY, ACT_PLAY_SONG, ACT_PLAY_TRACK, ACT_PLAY_BB, ACT_PLAY_PATTERN, ACT_PAUSE, ACT_RESUME_FROM_PAUSE } ; - vvector m_actions; + QVector m_actions; friend class engine; diff --git a/include/spc_bg_hndl_widget.h b/include/spc_bg_hndl_widget.h index aaa160221..9d1d67e0d 100644 --- a/include/spc_bg_hndl_widget.h +++ b/include/spc_bg_hndl_widget.h @@ -1,7 +1,7 @@ /* * spc_bg_hndl_widget.h - class specialBgHandlingWidget * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,20 +26,10 @@ #ifndef _SPC_BG_HNDL_WIDGET_H #define _SPC_BG_HNDL_WIDGET_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include - -#endif class specialBgHandlingWidget @@ -80,16 +70,10 @@ public: const specialBgHandlingWidget *>( pw ); if( s->backgroundPixmap().isNull() == FALSE ) { -#ifdef QT4 QPainter p( &pm ); p.drawPixmap( 0, 0, s->backgroundPixmap(), _w->x(), _w->y(), _w->width(), _w->height() ); -#else - bitBlt( &pm, 0, 0, &s->backgroundPixmap(), - _w->x(), _w->y(), _w->width(), - _w->height() ); -#endif } else { @@ -98,7 +82,6 @@ public: } else { -#ifdef QT4 QPainter p( &pm ); const QBrush & br = pw->palette().brush( pw->backgroundRole() ); @@ -112,22 +95,6 @@ public: { pm.fill( br.color() ); } -#else - const QPixmap * pbp = pw->paletteBackgroundPixmap(); - if( pbp == NULL ) - { - pbp = pw->erasePixmap(); - } - if( pbp ) - { - bitBlt( &pm, 0, 0, pbp, _w->x(), _w->y(), - _w->width(), _w->height() ); - } - else - { - pm.fill( pw->paletteBackgroundColor() ); - } -#endif } return( pm ); } diff --git a/include/string_pair_drag.h b/include/string_pair_drag.h index c57fcf541..c92f1a22a 100644 --- a/include/string_pair_drag.h +++ b/include/string_pair_drag.h @@ -26,28 +26,15 @@ #ifndef _STRING_PAIR_DRAG_H #define _STRING_PAIR_DRAG_H -#include "qt3support.h" - -#ifdef QT4 - #include - -#else - -#include - -#endif +#include +#include class QPixmap; -class stringPairDrag : public -#ifdef QT4 - QDrag -#else - QStoredDrag -#endif +class stringPairDrag : public QDrag { public: stringPairDrag( const QString & _key, const QString & _value, diff --git a/include/surround_area.h b/include/surround_area.h index 78361735b..2147c9d62 100644 --- a/include/surround_area.h +++ b/include/surround_area.h @@ -28,19 +28,8 @@ #ifndef _SURROUND_AREA_H #define _SURROUND_AREA_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "mixer.h" diff --git a/include/tab_bar.h b/include/tab_bar.h index 0b97c714a..0525db9fc 100644 --- a/include/tab_bar.h +++ b/include/tab_bar.h @@ -1,7 +1,7 @@ /* * tab_bar.h - class tabBar * - * Copyright (c) 2004-2006 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -30,23 +30,10 @@ #include #endif -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - - class tabButton; diff --git a/include/tab_button.h b/include/tab_button.h index 3c6eff2fd..54d65aadf 100644 --- a/include/tab_button.h +++ b/include/tab_button.h @@ -1,7 +1,7 @@ /* * tab_button.h - declaration of class tabButton * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,19 +26,8 @@ #ifndef _TAB_BUTTON_H #define _TAB_BUTTON_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - class tabButton : public QPushButton { diff --git a/include/tab_widget.h b/include/tab_widget.h index 85fd93ac0..9b8583bdb 100644 --- a/include/tab_widget.h +++ b/include/tab_widget.h @@ -1,7 +1,7 @@ /* * tab_widget.h - LMMS-tabwidget * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,26 +26,9 @@ #ifndef _TAB_WIDGET_H #define _TAB_WIDGET_H -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "spc_bg_hndl_widget.h" @@ -56,10 +39,10 @@ public: tabWidget( const QString & _caption, QWidget * _parent ); ~tabWidget(); - void FASTCALL addTab( QWidget * _w, const QString & _name, + void addTab( QWidget * _w, const QString & _name, int _idx = -1 ); - void FASTCALL setActiveTab( int _idx ); + void setActiveTab( int _idx ); inline int activeTab( void ) const { diff --git a/include/templates.h b/include/templates.h index 81d46e097..187d68c9b 100644 --- a/include/templates.h +++ b/include/templates.h @@ -1,7 +1,7 @@ /* * templates.h - miscellanous templates and algorithms * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,18 +26,8 @@ #ifndef _TEMPLATES_H #define _TEMPLATES_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - template inline T tAbs( const T & x ) diff --git a/include/text_float.h b/include/text_float.h index 33dfb0bd6..47358173d 100644 --- a/include/text_float.h +++ b/include/text_float.h @@ -26,20 +26,9 @@ #ifndef _TEXT_FLOAT #define _TEXT_FLOAT -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - class textFloat : public QWidget { diff --git a/include/timeline.h b/include/timeline.h index 450ec209d..d100146f0 100644 --- a/include/timeline.h +++ b/include/timeline.h @@ -26,19 +26,8 @@ #ifndef _TIMELINE_H #define _TIMELINE_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "song_editor.h" diff --git a/include/tool_button.h b/include/tool_button.h index fdc536a66..a440790e9 100644 --- a/include/tool_button.h +++ b/include/tool_button.h @@ -26,20 +26,9 @@ #ifndef _TOOL_BUTTON_H #define _TOOL_BUTTON_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - class toolButton : public QToolButton { diff --git a/include/track.h b/include/track.h index 4ffcdc3ae..a4aba2a18 100644 --- a/include/track.h +++ b/include/track.h @@ -31,22 +31,10 @@ #include #endif -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #ifdef HAVE_CONFIG_H #include #endif @@ -179,14 +167,14 @@ public: trackContentWidget( trackWidget * _parent ); virtual ~trackContentWidget(); - trackContentObject * FASTCALL getTCO( csize _tco_num ); - csize numOfTCOs( void ); + trackContentObject * FASTCALL getTCO( int _tco_num ); + int numOfTCOs( void ); trackContentObject * FASTCALL addTCO( trackContentObject * _tco ); - void FASTCALL removeTCO( csize _tco_num, bool _also_delete = TRUE ); + void FASTCALL removeTCO( int _tco_num, bool _also_delete = TRUE ); void FASTCALL removeTCO( trackContentObject * _tco, bool _also_delete = TRUE ); void removeAllTCOs( void ); - void FASTCALL swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 ); + void FASTCALL swapPositionOfTCOs( int _tco_num1, int _tco_num2 ); inline Uint16 pixelsPerTact( void ) const { @@ -232,7 +220,7 @@ private: track * getTrack( void ); midiTime getPosition( int _mouse_x ); - typedef vvector tcoVector; + typedef QVector tcoVector; tcoVector m_trackContentObjects; trackWidget * m_trackWidget; @@ -451,14 +439,14 @@ public: trackContentObject * FASTCALL addTCO( trackContentObject * _tco ); - void FASTCALL removeTCO( csize _tco_num ); - csize numOfTCOs( void ); - trackContentObject * FASTCALL getTCO( csize _tco_num ); - csize FASTCALL getTCONum( trackContentObject * _tco ); - void FASTCALL getTCOsInRange( vlist & _tco_v, + void FASTCALL removeTCO( int _tco_num ); + int numOfTCOs( void ); + trackContentObject * FASTCALL getTCO( int _tco_num ); + int FASTCALL getTCONum( trackContentObject * _tco ); + void FASTCALL getTCOsInRange( QList & _tco_v, const midiTime & _start, const midiTime & _end ); - void FASTCALL swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 ); + void FASTCALL swapPositionOfTCOs( int _tco_num1, int _tco_num2 ); inline trackWidget * getTrackWidget( void ) { @@ -512,13 +500,13 @@ protected: private: trackContainer * m_trackContainer; trackWidget * m_trackWidget; - vlist m_automation_patterns; + QList m_automation_patterns; } ; -typedef vvector trackVector; -typedef vvector constTrackVector; +typedef QVector trackVector; +typedef QVector constTrackVector; #endif diff --git a/include/track_container.h b/include/track_container.h index e38b2ae5d..3541affda 100644 --- a/include/track_container.h +++ b/include/track_container.h @@ -27,22 +27,10 @@ #ifndef _TRACK_CONTAINER_H #define _TRACK_CONTAINER_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "track.h" #include "journalling_object.h" @@ -118,15 +106,15 @@ public: return( m_rubberBand->isVisible() ); } - inline vvector selectedObjects( void ) + inline QVector selectedObjects( void ) { if( allowRubberband() == TRUE ) { return( m_rubberBand->selectedObjects() ); } - //return( vvector() ); - vvector foo; - return( foo ); + return( QVector() ); +/* QVector foo; + return( foo );*/ } trackVector tracks( void ); @@ -184,7 +172,7 @@ private: scrollArea * m_scrollArea; - typedef vvector trackWidgetVector; + typedef QVector trackWidgetVector; trackWidgetVector m_trackWidgets; float m_ppt; diff --git a/include/visualization_widget.h b/include/visualization_widget.h index 761afefb9..dd94ba0eb 100644 --- a/include/visualization_widget.h +++ b/include/visualization_widget.h @@ -26,21 +26,9 @@ #ifndef _VISUALIZATION_WIDGET #define _VISUALIZATION_WIDGET -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "mixer.h" diff --git a/include/xqmap.h b/include/xqmap.h deleted file mode 100644 index 607be9c06..000000000 --- a/include/xqmap.h +++ /dev/null @@ -1,519 +0,0 @@ -/* - * XQMap.h - eXtended QMap template for Qt3 - * - * Copyright (c) 2006 Javier Serrano Polo - * - * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program (see COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - */ - - -#ifndef XQMAP_H -#define XQMAP_H - -#include - - - - -template -class XQMapPrivate : public QMapPrivate -{ -public: - typedef QMapConstIterator ConstIterator; - typedef QMapNode * NodePtr; - - XQMapPrivate( void ); - XQMapPrivate( const XQMapPrivate * _map ); - - ConstIterator lowerBound( const Key & _k ) const; - -}; - - - - -template -Q_INLINE_TEMPLATES XQMapPrivate::XQMapPrivate( void ) -{ -} - - - - -template -Q_INLINE_TEMPLATES XQMapPrivate::XQMapPrivate( - const XQMapPrivate * _map ) : - QMapPrivate( _map ) -{ -} - - - - -template -Q_INLINE_TEMPLATES Q_TYPENAME XQMapPrivate::ConstIterator - XQMapPrivate::lowerBound( const Key & _k ) const -{ - QMapNodeBase * y = QMapPrivate::header; // Last node - QMapNodeBase * x = QMapPrivate::header->parent; // Root node - - while( x != 0 ) { - // If as k <= key(x) go left - if( !( QMapPrivate::key( x ) < _k ) ) - { - y = x; - x = x->left; - } - else - { - x = x->right; - } - } - - // Was _k bigger then the biggest element of the tree? Return end() - if( y == QMapPrivate::header ) - { - return( ConstIterator( QMapPrivate::header ) ); - } - return( ConstIterator( (NodePtr)y ) ); -} - - - - -template -class XQMap -{ -public: - /** - * Typedefs - */ - typedef Key key_type; - typedef T mapped_type; - typedef QPair value_type; - typedef value_type * pointer; - typedef const value_type * const_pointer; - typedef value_type & reference; - typedef const value_type & const_reference; -#ifndef QT_NO_STL - typedef ptrdiff_t difference_type; -#else - typedef int difference_type; -#endif - typedef size_t size_type; - typedef QMapIterator iterator; - typedef QMapConstIterator const_iterator; - typedef QPair insert_pair; - - typedef QMapIterator Iterator; - typedef QMapConstIterator ConstIterator; - typedef T ValueType; - typedef XQMapPrivate Priv; - - /** - * API - */ - XQMap( void ) - { - m_sh = new XQMapPrivate; - } - XQMap( const XQMap & _m ) - { - m_sh = _m.m_sh; - m_sh->ref(); - } - -#ifndef QT_NO_STL - XQMap( const std::map & _m ) - { - m_sh = new XQMapPrivate; - Q_TYPENAME std::map::const_iterator it = _m.begin(); - for( ; it != _m.end(); ++it ) - { - value_type p( ( *it ).first, ( *it ).second ); - insert( p ); - } - } -#endif - ~XQMap() - { - if( m_sh->deref() ) - { - delete m_sh; - } - } - XQMap & operator=( const XQMap & _m ); -#ifndef QT_NO_STL - XQMap & operator=( const std::map & _m ) - { - clear(); - Q_TYPENAME std::map::const_iterator it = _m.begin(); - for( ; it != _m.end(); ++it ) - { - value_type p( ( *it ).first, ( *it ).second ); - insert( p ); - } - return( *this ); - } -#endif - - iterator begin( void ) - { - detach(); - return( m_sh->begin() ); - } - iterator end( void ) - { - detach(); - return( m_sh->end() ); - } - const_iterator begin( void ) const - { - return( ( (const Priv *)m_sh )->begin() ); - } - const_iterator end( void ) const - { - return( ( (const Priv *)m_sh )->end() ); - } - const_iterator constBegin( void ) const - { - return( begin() ); - } - const_iterator constEnd( void ) const - { - return( end() ); - } - - iterator replace( const Key & _k, const T & _v ) - { - remove( _k ); - return( insert( _k, _v ) ); - } - - size_type size( void ) const - { - return( m_sh->node_count ); - } - bool empty( void ) const - { - return( m_sh->node_count == 0 ); - } - QPair insert( const value_type & _x ); - - void erase( iterator _it ) - { - detach(); - m_sh->remove( _it ); - } - void erase( const key_type & _k ); - size_type count( const key_type & _k ) const; - T & operator[]( const Key & _k ); - void clear( void ); - - iterator find( const Key & _k ) - { - detach(); - return( iterator( m_sh->find( _k ).node ) ); - } - - iterator lowerBound( const Key & _k ) - { - detach(); - return( iterator( m_sh->lowerBound( _k ).node ) ); - } - - const_iterator find( const Key & _k ) const - { - return( m_sh->find( _k ) ); - } - - const_iterator lowerBound( const Key & _k ) const - { - return( m_sh->lowerBound( _k ) ); - } - - const T & operator[]( const Key & _k ) const - { - QT_CHECK_INVALID_MAP_ELEMENT; - return( m_sh->find( _k ).data() ); - } - bool contains( const Key & _k ) const - { - return( find( _k ) != end() ); - } - - size_type count( void ) const - { - return( m_sh->node_count ); - } - - QValueList keys( void ) const - { - QValueList r; - for( const_iterator i = begin(); i != end(); ++i ) - { - r.append( i.key() ); - } - return( r ); - } - - QValueList values( void ) const - { - QValueList r; - for( const_iterator i = begin(); i != end(); ++i ) - r.append( *i ); - return( r ); - } - - bool isEmpty( void ) const - { - return( m_sh->node_count == 0 ); - } - - iterator insert( const Key & _key, const T & _value, - bool _overwrite = TRUE ); - void remove( iterator _it ) - { - detach(); - m_sh->remove( _it ); - } - void remove( const Key & _k ); - -#if defined( Q_FULL_TEMPLATE_INSTANTIATION ) - bool operator==( const XQMap & ) const - { - return( FALSE ); - } -#ifndef QT_NO_STL - bool operator==( const std::map & ) const - { - return( FALSE ); - } -#endif -#endif - - -protected: - /** - * Helpers - */ - void detach( void ) - { - if( m_sh->count > 1 ) - { - detachInternal(); - } - } - - Priv * m_sh; - - -private: - void detachInternal( void ); - - friend class QDeepCopy< XQMap >; - -} ; - - - - -template -Q_INLINE_TEMPLATES XQMap & XQMap::operator=( - const XQMap & _m ) -{ - _m.m_sh->ref(); - if( m_sh->deref() ) - { - delete m_sh; - } - m_sh = _m.m_sh; - return( *this ); -} - - - - -template -Q_INLINE_TEMPLATES Q_TYPENAME XQMap::insert_pair - XQMap::insert( const Q_TYPENAME XQMap::value_type & _x ) -{ - detach(); - size_type n = size(); - iterator it = m_sh->insertSingle( _x.first ); - bool inserted = FALSE; - if( n < size() ) - { - inserted = TRUE; - it.data() = _x.second; - } - return( QPair( it, inserted ) ); -} - - - - -template -Q_INLINE_TEMPLATES void XQMap::erase( const Key & _k ) -{ - detach(); - iterator it( m_sh->find( _k ).node ); - if( it != end() ) - { - m_sh->remove( it ); - } -} - -template -Q_INLINE_TEMPLATES Q_TYPENAME XQMap::size_type - XQMap::count( const Key & _k ) const -{ - const_iterator it( m_sh->find( _k ).node ); - if( it != end() ) - { - size_type c = 0; - while( it != end() ) - { - ++it; - ++c; - } - return( c ); - } - return( 0 ); -} - - - - -template -Q_INLINE_TEMPLATES T & XQMap::operator[]( const Key & _k ) -{ - detach(); - QMapNode * p = m_sh->find( _k ).node; - if( p != m_sh->end().node ) - { - return( p->data ); - } - return( insert( _k, T() ).data() ); -} - - - - -template -Q_INLINE_TEMPLATES void XQMap::clear( void ) -{ - if( m_sh->count == 1 ) - { - m_sh->clear(); - } - else - { - m_sh->deref(); - m_sh = new XQMapPrivate; - } -} - - - - -template -Q_INLINE_TEMPLATES Q_TYPENAME XQMap::iterator XQMap::insert( - const Key & _key, const T & _value, bool _overwrite ) -{ - detach(); - size_type n = size(); - iterator it = m_sh->insertSingle( _key ); - if( _overwrite || n < size() ) - { - it.data() = _value; - } - return( it ); -} - - - - -template -Q_INLINE_TEMPLATES void XQMap::remove( const Key & _k ) -{ - detach(); - iterator it( m_sh->find( _k ).node ); - if( it != end() ) - { - m_sh->remove( it ); - } -} - - - - -template -Q_INLINE_TEMPLATES void XQMap::detachInternal( void ) -{ - m_sh->deref(); - m_sh = new XQMapPrivate( m_sh ); -} - - - - -#ifndef QT_NO_DATASTREAM -template -Q_INLINE_TEMPLATES QDataStream & operator>>( QDataStream & _s, - XQMap & _m ) -{ - _m.clear(); - Q_UINT32 c; - _s >> c; - for( Q_UINT32 i = 0; i < c; ++i ) - { - Key k; - T t; - _s >> k >> t; - _m.insert( k, t ); - if( _s.atEnd() ) - { - break; - } - } - return( _s ); -} - - - - -template -Q_INLINE_TEMPLATES QDataStream & operator<<( QDataStream & _s, - const XQMap & _m ) -{ - _s << (Q_UINT32)_m.size(); - QMapConstIterator it = _m.begin(); - for( ; it != _m.end(); ++it ) - { - _s << it.key() << it.data(); - } - return( _s ); -} -#endif - - - - -#endif diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 6a851ee47..045efe4f6 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -3,7 +3,7 @@ VST_DIRS=vst_base vst_effect vestige endif if LADSPA_SUPPORT -LADSPA_DIRS=ladspa_base ladspa_effect +LADSPA_DIRS=ladspa_effect endif if STK_SUPPORT diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 6ab09416c..da8a30903 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -23,27 +23,12 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include #include -#else - -#include -#include -#include -#include -#include -#include - -#endif - #include "audio_file_processor.h" #include "engine.h" @@ -118,11 +103,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : SLOT( openAudioFile() ) ); toolTip::add( m_openAudioFileButton, tr( "Open other sample" ) ); -#ifdef QT4 m_openAudioFileButton->setWhatsThis( -#else - QWhatsThis::add( m_openAudioFileButton, -#endif tr( "Click here, if you want to open another audio-file. After " "clicking on this button, a file-open-dialog appears " "and you can select your file. Settings like Looping-" @@ -141,11 +122,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : connect( m_reverseButton, SIGNAL( toggled( bool ) ), this, SLOT( reverseBtnToggled( bool ) ) ); toolTip::add( m_reverseButton, tr( "Reverse sample" ) ); -#ifdef QT4 m_reverseButton->setWhatsThis( -#else - QWhatsThis::add( m_reverseButton, -#endif tr( "If you enable this button, the whole sample is reversed. " "This is useful for cool effects, e.g. a reversed " "crash." ) ); @@ -160,11 +137,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : m_loopButton->setBgGraphic( getBackground( m_loopButton ) ); toolTip::add( m_loopButton, tr( "Loop sample at start- and end-point" ) ); -#ifdef QT4 m_loopButton->setWhatsThis( -#else - QWhatsThis::add( m_loopButton, -#endif tr( "Here you can set, whether Looping-Mode is enabled. If " "enabled, AudioFileProcessor loops between start- and " "end-point of a sample until the whole note is played. " @@ -179,11 +152,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : m_ampKnob->setLabel( tr( "AMP" ) ); connect( m_ampKnob, SIGNAL( valueChanged( float ) ), this, SLOT( ampKnobChanged( float ) ) ); -#ifdef QT4 m_ampKnob->setWhatsThis( -#else - QWhatsThis::add( m_ampKnob, -#endif tr( "With this knob you can set the amplify-ratio. When you " "set a value of 100% your sample isn't changed. " "Otherwise it will be amplified up or down (your " @@ -198,11 +167,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : m_startKnob->setLabel( tr( "START" ) ); connect( m_startKnob, SIGNAL( valueChanged( float ) ), this, SLOT( startKnobChanged( float ) ) ); -#ifdef QT4 m_startKnob->setWhatsThis( -#else - QWhatsThis::add( m_startKnob, -#endif tr( "With this knob you can set the point where " "AudioFileProcessor should begin playing your sample. " "If you enable Looping-Mode, this is the point to " @@ -218,11 +183,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : m_endKnob->setLabel( tr( "END" ) ); connect( m_endKnob, SIGNAL( valueChanged( float ) ), this, SLOT( endKnobChanged( float ) ) ); -#ifdef QT4 m_endKnob->setWhatsThis( -#else - QWhatsThis::add( m_endKnob, -#endif tr( "With this knob you can set the point where " "AudioFileProcessor should stop playing your sample. " "If you enable Looping-Mode, this is the point where " @@ -238,11 +199,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : } connect( m_viewLinesPB, SIGNAL( toggled( bool ) ), this, SLOT( lineDrawBtnToggled( bool ) ) ); -#ifdef QT4 m_viewLinesPB->setWhatsThis( -#else - QWhatsThis::add( m_viewLinesPB, -#endif tr( "Activate this button, if your sample should be drawn " "with connected lines. This doesn't change the " "sound itself. It just gives you another view to your " @@ -257,11 +214,7 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : } connect( m_viewDotsPB, SIGNAL( toggled( bool ) ), this, SLOT( dotDrawBtnToggled( bool ) ) ); -#ifdef QT4 m_viewDotsPB->setWhatsThis( -#else - QWhatsThis::add( m_viewDotsPB, -#endif tr( "Activate this button, if your sample should be drawn " "with dots. This doesn't change the sound itself. " "It just gives you another view to your sample." ) ); @@ -271,9 +224,6 @@ audioFileProcessor::audioFileProcessor( instrumentTrack * _channel_track ) : view_group->addButton( m_viewLinesPB ); view_group->addButton( m_viewDotsPB ); -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif setAcceptDrops( TRUE ); } @@ -422,7 +372,6 @@ void audioFileProcessor::deleteNotePluginData( notePlayHandle * _n ) void audioFileProcessor::dragEnterEvent( QDragEnterEvent * _dee ) { -#ifdef QT4 if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) ) { QString txt = _dee->mimeData()->data( @@ -445,41 +394,6 @@ void audioFileProcessor::dragEnterEvent( QDragEnterEvent * _dee ) { _dee->ignore(); } -#else - QString txt = _dee->encodedData( stringPairDrag::mimeType() ); - if( txt != "" ) - { - if( txt.section( ':', 0, 0 ) == QString( "tco_%1" ).arg( - track::SAMPLE_TRACK ) ) - { - _dee->accept(); - return; - } - if( txt.section( ':', 0, 0 ) == "samplefile" - && subPluginFeatures::supported_extensions().contains( - fileItem::extension( txt.section( ':', 1 ) ) ) ) - { - _dee->accept(); - return; - } - _dee->ignore(); - return; - } - - txt = QString( _dee->encodedData( "text/plain" ) ); - if( txt != "" ) - { - QString file = QUriDrag::uriToLocalFile( - txt.stripWhiteSpace() ); - if( file && subPluginFeatures::supported_extensions().contains( - fileItem::extension( file ) ) ) - { - _dee->accept(); - return; - } - } - _dee->ignore(); -#endif } @@ -504,17 +418,6 @@ void audioFileProcessor::dropEvent( QDropEvent * _de ) return; } -#ifndef QT4 - QString txt = _de->encodedData( "text/plain" ); - if( txt != "" ) - { - setAudioFile( QUriDrag::uriToLocalFile( - txt.stripWhiteSpace() ) ); - _de->accept(); - return; - } -#endif - _de->ignore(); } @@ -523,14 +426,7 @@ void audioFileProcessor::dropEvent( QDropEvent * _de ) void audioFileProcessor::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap pm( rect().size() ); - pm.fill( this, rect().topLeft() ); - - QPainter p( &pm, this ); -#endif p.drawPixmap( 0, 0, *s_artwork ); @@ -544,13 +440,8 @@ void audioFileProcessor::paintEvent( QPaintEvent * ) // simple algorithm for creating a text from the filename that // matches in the white rectangle -#ifdef QT4 while( idx > 0 && fm.size( Qt::TextSingleLine, file_name + "..." ).width() < 210 ) -#else - while( idx > 0 && - fm.size( Qt::SingleLine, file_name + "..." ).width() < 210 ) -#endif { file_name = m_sampleBuffer.audioFile()[--idx] + file_name; } @@ -582,9 +473,6 @@ void audioFileProcessor::paintEvent( QPaintEvent * ) end_frame_x + graph_rect.x(), graph_rect.height() + graph_rect.y() ); -#ifndef QT4 - bitBlt( this, rect().topLeft(), &pm ); -#endif } @@ -593,14 +481,8 @@ void audioFileProcessor::paintEvent( QPaintEvent * ) void audioFileProcessor::sampleUpdated( void ) { m_graph = QPixmap( 245, 75 ); -#ifdef QT4 QPainter p( &m_graph ); p.drawPixmap( 2, 172, m_graph ); -#else - copyBlt( &m_graph, 0, 0, s_artwork, 2, 172, m_graph.width(), - m_graph.height() ); - QPainter p( &m_graph ); -#endif p.setPen( QColor( 64, 255, 160 ) ); m_sampleBuffer.visualize( p, QRect( 2, 2, m_graph.width() - 4, m_graph.height() - 4 ), diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index 97766ff10..7bde61318 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -27,18 +27,8 @@ #ifndef _AUDIO_FILE_PROCESSOR_H #define _AUDIO_FILE_PROCESSOR_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "instrument.h" #include "sample_buffer.h" #include "spc_bg_hndl_widget.h" diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index c925e729d..4b793cf31 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -23,27 +23,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - #include #include #include @@ -333,16 +316,11 @@ bitInvader::bitInvader( instrumentTrack * _channel_track ) : this, SLOT ( smoothClicked( void ) ) ); -#ifdef QT4 setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); -#else - setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); -#endif - sample_length = 128; sample_shape = new float[128]; diff --git a/plugins/bit_invader/graph.cpp b/plugins/bit_invader/graph.cpp index ada8fc6d5..098ded342 100644 --- a/plugins/bit_invader/graph.cpp +++ b/plugins/bit_invader/graph.cpp @@ -23,23 +23,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - - #include "graph.h" #include "string_pair_drag.h" #include "sample_buffer.h" @@ -60,11 +47,6 @@ graph::graph( QWidget * _parent ) : setFixedSize( 132, 104 ); setAcceptDrops( TRUE ); - -#ifndef QT4 - setBackgroundMode( NoBackground ); -#endif - } @@ -145,11 +127,7 @@ void graph::mousePressEvent( QMouseEvent * _me ) // toggle mouse state m_mouseDown = true; -#ifndef QT3 setCursor( Qt::BlankCursor ); -#else - setCursor( QCursor::BlankCursor ); -#endif m_lastCursorX = x; } @@ -177,11 +155,7 @@ void graph::mouseReleaseEvent( QMouseEvent * _me ) { // toggle mouse state m_mouseDown = false; -#ifndef QT3 setCursor( Qt::ArrowCursor ); -#else - setCursor( QCursor::ArrowCursor ); -#endif update(); } @@ -190,14 +164,7 @@ void graph::mouseReleaseEvent( QMouseEvent * _me ) void graph::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( rect().size() ); -// draw_pm.fill( this, rect().topLeft() ); - - QPainter p( &draw_pm, this ); -#endif // if (m_background != NULL) { p.drawPixmap( 0, 0, m_background ); @@ -226,12 +193,6 @@ void graph::paintEvent( QPaintEvent * ) p.drawLine( 2, cursor.y(), 130, cursor.y() ); p.drawLine( cursor.x(), 2, cursor.x(), 102 ); } - -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif - } diff --git a/plugins/bit_invader/graph.h b/plugins/bit_invader/graph.h index 55848fff3..a652d0d2f 100644 --- a/plugins/bit_invader/graph.h +++ b/plugins/bit_invader/graph.h @@ -26,22 +26,10 @@ #ifndef _GRAPH_H #define _GRAPH_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - class graph : public QWidget { diff --git a/plugins/flp_import/flp_import.cpp b/plugins/flp_import/flp_import.cpp index da3cfc300..b46ac5053 100644 --- a/plugins/flp_import/flp_import.cpp +++ b/plugins/flp_import/flp_import.cpp @@ -23,6 +23,12 @@ */ +#include +#include +#include +#include +#include + #include "flp_import.h" #include "arp_and_chords_tab_widget.h" #include "basic_filters.h" @@ -47,23 +53,8 @@ #include "tempo_sync_knob.h" #include "track_container.h" - -#ifdef QT4 - -#include -#include -#include -#include -#include - -#else - -#include -#include -#include -#include -#include - +#ifdef HAVE_CONFIG_H +#include #endif #ifdef HAVE_CTYPE_H @@ -185,14 +176,8 @@ bool flpImport::tryImport( trackContainer * _tc ) return( FALSE ); } -#ifdef QT4 QProgressDialog pd( trackContainer::tr( "Importing FLP-file..." ), trackContainer::tr( "Cancel" ), 0, num_channels ); -#else - QProgressDialog pd( trackContainer::tr( "Importing FLP-file..." ), - trackContainer::tr( "Cancel" ), num_channels, - 0, 0, TRUE ); -#endif pd.setWindowTitle( trackContainer::tr( "Please wait..." ) ); pd.show(); @@ -237,7 +222,7 @@ bool flpImport::tryImport( trackContainer * _tc ) int current_pattern = 0; char * text = NULL; Uint32 text_len = 0; - vlist i_tracks; + QList i_tracks; int project_cur_pat = 0; int step_pattern = 0; @@ -257,13 +242,8 @@ bool flpImport::tryImport( trackContainer * _tc ) if( ++ev_cnt > 100 ) { ev_cnt = 0; -#ifdef QT4 qApp->processEvents( QEventLoop::AllEvents, 100 ); pd.setValue( i_tracks.size() ); -#else - qApp->processEvents( 100 ); - pd.setProgress( i_tracks.size() ); -#endif if( pd.wasCanceled() ) { @@ -510,16 +490,9 @@ bool flpImport::tryImport( trackContainer * _tc ) case FLP_Text_CommentRTF: { -#ifndef QT3 QByteArray ba( text, text_len ); QBuffer buf( &ba ); buf.open( QBuffer::ReadOnly ); -#else - QByteArray ba; - ba.setRawData( text, text_len ); - QBuffer buf( ba ); - buf.open( IO_ReadOnly ); -#endif lineno = 0; attr_clear_all(); op = html_init(); @@ -529,9 +502,6 @@ bool flpImport::tryImport( trackContainer * _tc ) word_print( word, out ); word_free( word ); op_free( op ); -#ifdef QT3 - ba.resetRawData( text, text_len ); -#endif engine::getProjectNotes()->setText( out ); outstring = ""; @@ -814,8 +784,8 @@ bool flpImport::tryImport( trackContainer * _tc ) it != m_steps.end(); ++it ) { const int ch = ( *it ) >> 16; - const csize pat = ( ( *it ) & 0xffff ) / 16; - const csize pos = ( ( ( *it ) & 0xffff ) % 16 ) * 4; + const int pat = ( ( *it ) & 0xffff ) / 16; + const int pos = ( ( ( *it ) & 0xffff ) % 16 ) * 4; while( engine::getBBEditor()->numOfBBs() <= pat ) { track::create( track::BB_TRACK, @@ -836,7 +806,7 @@ bool flpImport::tryImport( trackContainer * _tc ) { const int where = ( *it ).first; const int ch = where % num_channels; - const csize pat = where / num_channels; + const int pat = where / num_channels; if( pat > 100 ) { continue; @@ -845,11 +815,7 @@ bool flpImport::tryImport( trackContainer * _tc ) { track::create( track::BB_TRACK, engine::getSongEditor() ); -#ifdef QT4 qApp->processEvents( QEventLoop::AllEvents, 100 ); -#else - qApp->processEvents( 100 ); -#endif } pattern * p = dynamic_cast( i_tracks[ch]->getTCO( pat ) ); @@ -863,7 +829,7 @@ bool flpImport::tryImport( trackContainer * _tc ) for( playListItems::const_iterator it = m_plItems.begin(); it != m_plItems.end(); ++it ) { - csize pat_num = ( ( *it ) >> 16 ) - 1; + int pat_num = ( ( *it ) >> 16 ) - 1; if( pat_num > 100 ) { continue; @@ -872,11 +838,7 @@ bool flpImport::tryImport( trackContainer * _tc ) { track::create( track::BB_TRACK, engine::getSongEditor() ); -#ifdef QT4 qApp->processEvents( QEventLoop::AllEvents, 100 ); -#else - qApp->processEvents( 100 ); -#endif } bbTrack * bbt = bbTrack::findBBTrack( pat_num ); @@ -884,7 +846,7 @@ bool flpImport::tryImport( trackContainer * _tc ) tco->movePosition( midiTime( ( ( *it ) & 0xffff ) * 64 ) ); } - if( (csize) project_cur_pat < engine::getBBEditor()->numOfBBs() ) + if( project_cur_pat < engine::getBBEditor()->numOfBBs() ) { engine::getBBEditor()->setCurrentBB( project_cur_pat ); } diff --git a/plugins/flp_import/flp_import.h b/plugins/flp_import/flp_import.h index c5df82117..4db1607ae 100644 --- a/plugins/flp_import/flp_import.h +++ b/plugins/flp_import/flp_import.h @@ -26,28 +26,10 @@ #ifndef _FLP_IMPORT_H #define _FLP_IMPORT_H -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - - #include "import_filter.h" #include "note.h" @@ -239,13 +221,13 @@ private: } - typedef vlist > patternNoteVector; + typedef QList > patternNoteVector; patternNoteVector m_notes; - typedef vlist stepVector; + typedef QList stepVector; stepVector m_steps; - typedef vlist playListItems; + typedef QList playListItems; playListItems m_plItems; } ; diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index 2b21c0a3e..d2e738a8c 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -23,21 +23,9 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #include "kicker.h" #include "engine.h" #include "instrument_track.h" @@ -115,15 +103,12 @@ kickerInstrument::kickerInstrument( instrumentTrack * _instrument_track ) : hl->addWidget( m_gainKnob ); vl->addLayout( hl ); -#ifdef QT4 + setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); -#else - setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); -#endif } diff --git a/plugins/ladspa_base/ladspa_2_lmms.cpp b/plugins/ladspa_base/ladspa_2_lmms.cpp index 3c091e89d..edb691849 100644 --- a/plugins/ladspa_base/ladspa_2_lmms.cpp +++ b/plugins/ladspa_base/ladspa_2_lmms.cpp @@ -26,9 +26,6 @@ #include "ladspa_2_lmms.h" -#ifdef QT3 -#define indexOf find -#endif ladspa2LMMS::ladspa2LMMS( void ) { @@ -103,11 +100,7 @@ QString ladspa2LMMS::getShortName( const ladspa_key_t & _key ) { name = name.left( name.indexOf( " " ) ); } -#ifndef QT3 Qt::CaseSensitivity cs = Qt::CaseInsensitive; -#else - bool cs = FALSE; -#endif if( name.indexOf( " with ", 0, cs ) > 0 ) { name = name.left( name.indexOf( " with ", 0, cs ) ); @@ -133,6 +126,3 @@ QString ladspa2LMMS::getShortName( const ladspa_key_t & _key ) return( name ); } - -#undef indexOf - diff --git a/plugins/ladspa_base/ladspa_2_lmms.h b/plugins/ladspa_base/ladspa_2_lmms.h index 8b6ca35bd..15fbbe933 100644 --- a/plugins/ladspa_base/ladspa_2_lmms.h +++ b/plugins/ladspa_base/ladspa_2_lmms.h @@ -32,7 +32,6 @@ class ladspa2LMMS: public ladspaManager { - public: inline l_sortable_plugin_t getInstruments( void ) diff --git a/plugins/ladspa_base/ladspa_control.cpp b/plugins/ladspa_base/ladspa_control.cpp index 665951f9a..70573d08e 100644 --- a/plugins/ladspa_base/ladspa_control.cpp +++ b/plugins/ladspa_base/ladspa_control.cpp @@ -23,19 +23,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "ladspa_control.h" #include "automatable_object_templates.h" #include "ladspa_base.h" @@ -48,22 +37,14 @@ ladspaControl::ladspaControl( QWidget * _parent, port_desc_t * _port, track * _track, bool _link) : - QWidget( _parent -#ifdef QT3 - , "ladspaControl" -#endif - ), + QWidget( _parent ), m_port( _port ), m_track( _track ), m_link( NULL ), m_toggle( NULL ), m_knob( NULL ) { - m_layout = new QHBoxLayout( this -#ifdef QT3 - , 0, 0, "ladspaControlLayout" -#endif - ); + m_layout = new QHBoxLayout( this ); if( _link ) { @@ -109,11 +90,7 @@ ladspaControl::ladspaControl( QWidget * _parent, static_cast( m_port->def ) ); setFixedSize( m_knob->width(), m_knob->height() ); m_knob->setHintText( tr( "Value:" ) + " ", "" ); -#ifdef QT4 m_knob->setWhatsThis( -#else - QWhatsThis::add( m_knob, -#endif tr( "Sorry, no help available." ) ); if( _link ) { @@ -136,11 +113,7 @@ ladspaControl::ladspaControl( QWidget * _parent, 400.0f ) ); m_knob->setInitValue( m_port->def ); m_knob->setHintText( tr( "Value:" ) + " ", "" ); -#ifdef QT4 m_knob->setWhatsThis( -#else - QWhatsThis::add( m_knob, -#endif tr( "Sorry, no help available." ) ); setFixedSize( m_knob->width(), m_knob->height() ); if( _link ) @@ -162,11 +135,7 @@ ladspaControl::ladspaControl( QWidget * _parent, m_port->min ) / 400.0f ); m_knob->setInitValue( m_port->def ); m_knob->setHintText( tr( "Value:" ) + " ", "" ); -#ifdef QT4 m_knob->setWhatsThis( -#else - QWhatsThis::add( m_knob, -#endif tr( "Sorry, no help available." ) ); setFixedSize( m_knob->width(), m_knob->height() ); if( _link ) diff --git a/plugins/ladspa_base/ladspa_control.h b/plugins/ladspa_base/ladspa_control.h index 59001487b..66ce7efe5 100644 --- a/plugins/ladspa_base/ladspa_control.h +++ b/plugins/ladspa_base/ladspa_control.h @@ -25,21 +25,9 @@ #ifndef _LADSPA_CONTROL_H #define _LADSPA_CONTROL_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - - #ifdef HAVE_CONFIG_H #include #endif diff --git a/plugins/ladspa_base/ladspa_manager.cpp b/plugins/ladspa_base/ladspa_manager.cpp index 273ac2b6b..2e3b3eb5e 100644 --- a/plugins/ladspa_base/ladspa_manager.cpp +++ b/plugins/ladspa_base/ladspa_manager.cpp @@ -24,25 +24,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#define value data - -#endif - - #include #include "config_mgr.h" @@ -52,17 +37,10 @@ ladspaManager::ladspaManager( void ) { -#ifdef QT4 QStringList ladspaDirectories = QString( getenv( "LADSPA_PATH" ) ). split( ':' ); ladspaDirectories += configManager::inst()->ladspaDir().split( ':' ); -#else - QStringList ladspaDirectories = QStringList::split( ':', - QString( getenv( "LADSPA_PATH" ) ) ); - ladspaDirectories += QStringList::split( ':', - configManager::inst()->ladspaDir() ); -#endif - + ladspaDirectories.push_back( "/usr/lib/lmms/ladspa" ); /* // set default-directory if nothing is specified... if( ladspaDirectories.isEmpty() ) @@ -74,26 +52,11 @@ ladspaManager::ladspaManager( void ) it != ladspaDirectories.end(); ++it ) { QDir directory( ( *it ) ); -#ifdef QT4 QFileInfoList list = directory.entryInfoList(); -#else - const QFileInfoList * lp = directory.entryInfoList(); - // if directory doesn't exist or isn't readable, we get NULL - // which would crash LMMS... - if( lp == NULL ) - { - continue; - } - QFileInfoList list = *lp; -#endif for( QFileInfoList::iterator file = list.begin(); file != list.end(); ++file ) -{ -#ifdef QT4 + { const QFileInfo & f = *file; -#else - const QFileInfo & f = **file; -#endif if( !f.isFile() || f.fileName().right(2) != "so" ) { continue; @@ -108,9 +71,6 @@ ladspaManager::ladspaManager( void ) "ladspa_descriptor" ); if( descriptorFunction != NULL ) { -#ifndef QT4 - plugin_lib.setAutoUnload( FALSE ); -#endif addPlugins( descriptorFunction, f.fileName() ); } @@ -135,11 +95,7 @@ ladspaManager::~ladspaManager() for( ladspaManagerMapType::iterator it = m_ladspaManagerMap.begin(); it != m_ladspaManagerMap.end(); ++it ) { -#ifndef QT3 delete it.value(); -#else - delete it.data(); -#endif } } diff --git a/plugins/ladspa_base/ladspa_manager.h b/plugins/ladspa_base/ladspa_manager.h index 7f171e3c4..29baf27f8 100644 --- a/plugins/ladspa_base/ladspa_manager.h +++ b/plugins/ladspa_base/ladspa_manager.h @@ -39,35 +39,21 @@ #endif -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "types.h" -//#include "qt3support.h" const float NOHINT = -99342.2243f; typedef QPair ladspa_key_t; typedef QPair sortable_plugin_t; -typedef vlist l_sortable_plugin_t; -typedef vlist l_ladspa_key_t; +typedef QList l_sortable_plugin_t; +typedef QList l_ladspa_key_t; /* ladspaManager provides a database of LADSPA plug-ins. Upon instantiation, it loads all of the plug-ins found in the LADSPA_PATH environmental variable diff --git a/plugins/ladspa_base/ladspa_port_dialog.cpp b/plugins/ladspa_base/ladspa_port_dialog.cpp index f170c1dc6..059062e81 100644 --- a/plugins/ladspa_base/ladspa_port_dialog.cpp +++ b/plugins/ladspa_base/ladspa_port_dialog.cpp @@ -22,22 +22,10 @@ * */ -#include "qt3support.h" - -#ifdef QT4 #include #include -#else - -#include -#include - -#define QTableWidget QTable - -#endif - #include "ladspa_port_dialog.h" #include "embed.h" @@ -76,74 +64,41 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key ) : { port_nums.append( QString::number( row ) ); Uint8 col = 0; -#ifdef QT3 - display->setText( row, col, m_ladspa->getPortName( - m_key, row ) ); -#else display->item( row, col )->setText( m_ladspa->getPortName( m_key, row ) ); -#endif col++; if( m_ladspa->isPortAudio( m_key, row ) ) { -#ifdef QT3 - display->setText( row, col, tr( "Audio" ) ); -#else display->item( row, col )->setText( tr( "Audio" ) ); -#endif } else { -#ifdef QT3 - display->setText( row, col, tr( "Control" ) ); -#else display->item( row, col )->setText( tr( "Control" ) ); -#endif } col++; if( m_ladspa->isPortInput( m_key, row ) ) { -#ifdef QT3 - display->setText( row, col, tr( "Input" ) ); -#else display->item( row, col )->setText( tr( "Input" ) ); -#endif } else { -#ifdef QT3 - display->setText( row, col, tr( "Output" ) ); -#else display->item( row, col )->setText( tr( "Output" ) ); -#endif } col++; if( m_ladspa->isPortToggled( m_key, row ) ) { -#ifdef QT3 - display->setText( row, col, tr( "Toggled" ) ); -#else display->item( row, col )->setText( tr( "Toggled" ) ); -#endif } else if( m_ladspa->isInteger( m_key, row ) ) { -#ifdef QT3 - display->setText( row, col, tr( "Integer" ) ); -#else display->item( row, col )->setText( tr( "Integer" ) ); -#endif } else { -#ifdef QT3 - display->setText( row, col, tr( "Float" ) ); -#else display->item( row, col )->setText( tr( "Float" ) ); -#endif } col++; @@ -210,45 +165,23 @@ ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key ) : { range = ""; } -#ifdef QT3 - display->setText( row, col, range ); -#else display->item( row, col )->setText( range ); -#endif col++; if( m_ladspa->isLogarithmic( m_key, row ) ) { -#ifdef QT3 - display->setText( row, col, tr( "Yes" ) ); -#else display->item( row, col )->setText( tr( "Yes" ) ); -#endif } col++; if( m_ladspa->areHintsSampleRateDependent( m_key, row ) ) { -#ifdef QT3 - display->setText( row, col, tr( "Yes" ) ); -#else display->item( row, col )->setText( tr( "Yes" ) ); -#endif } col++; } -#ifdef QT3 - display->setColumnLabels( ports ); - display->setRowLabels( port_nums ); - display->setReadOnly( true ); - for(Uint8 col = 0; col < ports.count(); col++ ) - { - display->adjustColumn( col ); - } -#endif - vlayout->addWidget( settings ); setFixedSize( display->width(), display->height() ); diff --git a/plugins/ladspa_base/ladspa_port_dialog.h b/plugins/ladspa_base/ladspa_port_dialog.h index 22c2f02ee..86a2f0508 100644 --- a/plugins/ladspa_base/ladspa_port_dialog.h +++ b/plugins/ladspa_base/ladspa_port_dialog.h @@ -25,20 +25,8 @@ #ifndef _LADSPA_PORT_DIALOG_H #define _LADSPA_PORT_DIALOG_H -#include "qt3support.h" - - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "ladspa_2_lmms.h" diff --git a/plugins/ladspa_effect/ladspa_control_dialog.cpp b/plugins/ladspa_effect/ladspa_control_dialog.cpp index 9f26d0434..713888036 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.cpp +++ b/plugins/ladspa_effect/ladspa_control_dialog.cpp @@ -24,18 +24,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "ladspa_effect.h" @@ -49,13 +39,9 @@ ladspaControlDialog::ladspaControlDialog( QWidget * _parent, m_noLink( FALSE ) { m_mainLay = new QVBoxLayout( this ); -#ifdef QT3 - m_effectLay = new QHBoxLayout( m_mainLay ); -#else m_effectLay = new QHBoxLayout(); m_mainLay->addLayout( m_effectLay ); -#endif - + multi_proc_t controls = m_effect->getControls(); m_controlCount = controls.count(); @@ -73,16 +59,10 @@ ladspaControlDialog::ladspaControlDialog( QWidget * _parent, QGroupBox * grouper; if( m_processors > 1 ) { -#ifdef QT3 - grouper = new QGroupBox( rows, Qt::Vertical, - tr( "Channel " ) + QString::number( proc + 1 ), - this ); -#else grouper = new QGroupBox( tr( "Channel " ) + QString::number( proc + 1 ), this ); grouper->setAlignment( Qt::Vertical ); -#endif if( proc == 0 ) { linked_control = TRUE; @@ -90,13 +70,8 @@ ladspaControlDialog::ladspaControlDialog( QWidget * _parent, } else { -#ifdef QT3 - grouper = new QGroupBox( rows, Qt::Vertical, - "", this ); -#else grouper = new QGroupBox( this ); grouper->setAlignment( Qt::Vertical ); -#endif } for( multi_proc_t::iterator it = controls.begin(); @@ -155,12 +130,8 @@ ladspaControlDialog::ladspaControlDialog( QWidget * _parent, if( m_processors > 1 ) { m_mainLay->addSpacing( 3 ); -#ifdef QT3 - QHBoxLayout * center = new QHBoxLayout( m_mainLay ); -#else QHBoxLayout * center = new QHBoxLayout(); m_mainLay->addLayout( center ); -#endif m_stereoLink = new ledCheckBox( tr( "Link Channels" ), this, NULL, NULL ); connect( m_stereoLink, SIGNAL( toggled( bool ) ), diff --git a/plugins/ladspa_effect/ladspa_control_dialog.h b/plugins/ladspa_effect/ladspa_control_dialog.h index cbeff4165..5013e6810 100644 --- a/plugins/ladspa_effect/ladspa_control_dialog.h +++ b/plugins/ladspa_effect/ladspa_control_dialog.h @@ -26,26 +26,15 @@ #ifndef _LADSPA_CONTROL_DIALOG_H #define _LADSPA_CONTROL_DIALOG_H -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - #include "effect_control_dialog.h" #include "ladspa_control.h" #include "led_checkbox.h" -typedef vvector control_list_t; +typedef QVector control_list_t; class ladspaEffect; @@ -85,8 +74,8 @@ private: bool m_noLink; audioPort * m_port; ledCheckBox * m_stereoLink; - vvector m_blanks; - vvector m_controls; + QVector m_blanks; + QVector m_controls; QVBoxLayout * m_mainLay; QHBoxLayout * m_effectLay; diff --git a/plugins/ladspa_effect/ladspa_effect.cpp b/plugins/ladspa_effect/ladspa_effect.cpp index 9f16eef2a..6699d1ead 100644 --- a/plugins/ladspa_effect/ladspa_effect.cpp +++ b/plugins/ladspa_effect/ladspa_effect.cpp @@ -23,20 +23,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include "qmessagebox.h" -#define indexOf find - -#endif - - #include "ladspa_effect.h" #include "mixer.h" #include "config_mgr.h" diff --git a/plugins/ladspa_effect/ladspa_effect.h b/plugins/ladspa_effect/ladspa_effect.h index 3faccfada..4ddd5030e 100644 --- a/plugins/ladspa_effect/ladspa_effect.h +++ b/plugins/ladspa_effect/ladspa_effect.h @@ -25,12 +25,6 @@ #ifndef _LADSPA_EFFECT_H #define _LADSPA_EFFECT_H -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "qt3support.h" - #include "effect.h" #include "engine.h" #include "ladspa_2_lmms.h" @@ -41,7 +35,7 @@ #include "main_window.h" -typedef vvector multi_proc_t; +typedef QVector multi_proc_t; class ladspaEffect : public effect { @@ -92,9 +86,9 @@ private: fpp_t m_bufferSize; const LADSPA_Descriptor * m_descriptor; - vvector m_handles; + QVector m_handles; - vvector m_ports; + QVector m_ports; multi_proc_t m_controls; } ; diff --git a/plugins/ladspa_effect/ladspa_subplugin_features.cpp b/plugins/ladspa_effect/ladspa_subplugin_features.cpp index 6c5017d70..e18844c75 100644 --- a/plugins/ladspa_effect/ladspa_subplugin_features.cpp +++ b/plugins/ladspa_effect/ladspa_subplugin_features.cpp @@ -26,23 +26,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -//#include -#include -#include - -#endif - #include "ladspa_subplugin_features.h" #include "ladspa_2_lmms.h" @@ -68,51 +55,34 @@ void ladspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, QLabel * label = new QLabel( _parent ); label->setText( QWidget::tr( "Name: " ) + lm->getName( lkey ) ); -#ifndef QT3 QWidget * maker = new QWidget( _parent ); QHBoxLayout * l = new QHBoxLayout( maker ); l->setMargin( 0 ); l->setSpacing( 0 ); -#else - QHBox * maker = new QHBox( _parent ); -#endif QLabel * maker_label = new QLabel( maker ); maker_label->setText( QWidget::tr( "Maker: " ) ); maker_label->setAlignment( Qt::AlignTop ); QLabel * maker_content = new QLabel( maker ); maker_content->setText( lm->getMaker( lkey ) ); -#ifndef QT3 maker_content->setWordWrap( TRUE ); l->setStretchFactor( maker_content, 100 ); -#else - maker_content->setAlignment( Qt::WordBreak ); - maker->setStretchFactor( maker_content, 100 ); -#endif -#ifndef QT3 QWidget * copyright = new QWidget( _parent ); l = new QHBoxLayout( copyright ); l->setMargin( 0 ); l->setSpacing( 0 ); -#else - QHBox * copyright = new QHBox( _parent ); -#endif copyright->setMinimumWidth( _parent->minimumWidth() ); QLabel * copyright_label = new QLabel( copyright ); copyright_label->setText( QWidget::tr( "Copyright: " ) ); copyright_label->setAlignment( Qt::AlignTop ); + QLabel * copyright_content = new QLabel( copyright ); copyright_content->setText( lm->getCopyright( lkey ) ); -#ifndef QT3 copyright_content->setWordWrap( TRUE ); l->setStretchFactor( copyright_content, 100 ); -#else - copyright_content->setAlignment( Qt::WordBreak ); - copyright->setStretchFactor( copyright_content, 100 ); -#endif QLabel * requiresRealTime = new QLabel( _parent ); requiresRealTime->setText( QWidget::tr( "Requires Real Time: " ) + diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index fab44cae5..42f1c4d1d 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -28,19 +28,9 @@ * */ -#include "qt3support.h" - -#ifdef QT4 #include -#else - -#include - -#endif - - #include "lb302.h" #include "engine.h" #include "instrument_play_handle.h" @@ -437,15 +427,11 @@ lb302Synth::lb302Synth( instrumentTrack * _channel_track ) : connect( wave_knob, SIGNAL( valueChanged(float) ), this, SLOT ( waveChanged( float ))); -#ifdef QT4 setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); -#else - setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); -#endif // SYNTH diff --git a/plugins/live_tool/live_tool.cpp b/plugins/live_tool/live_tool.cpp index 0d6bd3675..84217a619 100644 --- a/plugins/live_tool/live_tool.cpp +++ b/plugins/live_tool/live_tool.cpp @@ -23,19 +23,8 @@ */ -#include "qt3support.h" - -#ifndef QT3 - #include -#else - -#include - -#endif - - #include "live_tool.h" #include "bb_editor.h" #include "engine.h" @@ -78,22 +67,14 @@ liveTool::liveTool( mainWindow * _window ) : tool( _window, &live_tool_plugin_descriptor ) { const QPixmap background = PLUGIN_NAME::getIconPixmap( "artwork" ); -#ifndef QT3 + setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), background ); setPalette( pal ); -#else - setPaletteBackgroundPixmap( background ); -#endif setFixedSize( background.size() ); -#ifdef QT4 - setWhatsThis( -#else - QWhatsThis::add( this, -#endif - tr( + setWhatsThis( tr( "This tool is intended to be used in live performances, though " "you can use it for music production as well.\n" "The following keys will work only if this window is active.\n" @@ -174,20 +155,11 @@ bool liveTool::x11Event( XEvent * _xe ) void liveTool::toggleInstrument( int _n ) { -#ifndef QT3 if( _n > 0 && _n < engine::getBBEditor()->tracks().count() ) { track * t = engine::getBBEditor()->tracks().at( _n ); t->setMuted( !t->muted() ); } -#else - bool track_exists; - track * t = engine::getBBEditor()->tracks().at( _n, &track_exists ); - if( track_exists ) - { - t->setMuted( !t->muted() ); - } -#endif } diff --git a/plugins/midi_import/midi_import.cpp b/plugins/midi_import/midi_import.cpp index f393d3e1c..c10058040 100644 --- a/plugins/midi_import/midi_import.cpp +++ b/plugins/midi_import/midi_import.cpp @@ -23,6 +23,10 @@ */ +#include +#include +#include + #include "midi_import.h" #include "track_container.h" #include "instrument_track.h" @@ -32,24 +36,6 @@ #include "debug.h" - -#ifdef QT4 - -#include -#include -#include - -#else - -#include -#include -#include - -#define pos at -#define setValue setProgress - -#endif - #define makeID(_c0, _c1, _c2, _c3) \ ( ( _c0 ) | ( ( _c1 ) << 8 ) | ( ( _c2 ) << 16 ) | ( ( _c3 ) << 24 ) ) @@ -176,14 +162,8 @@ invalid_format: printf( "time-division: %d\n", time_division ); #endif -#ifdef QT4 QProgressDialog pd( trackContainer::tr( "Importing MIDI-file..." ), trackContainer::tr( "Cancel" ), 0, num_tracks ); -#else - QProgressDialog pd( trackContainer::tr( "Importing MIDI-file..." ), - trackContainer::tr( "Cancel" ), num_tracks, - 0, 0, TRUE ); -#endif pd.setWindowTitle( trackContainer::tr( "Please wait..." ) ); pd.show(); @@ -207,11 +187,7 @@ invalid_format: for( int i = 0; i < num_tracks; ++i ) { pd.setValue( i ); -#ifdef QT4 qApp->processEvents( QEventLoop::AllEvents, 100 ); -#else - qApp->processEvents( 100 ); -#endif if( pd.wasCanceled() ) { diff --git a/plugins/midi_import/midi_import.h b/plugins/midi_import/midi_import.h index 1e0b9aa71..9fed65c53 100644 --- a/plugins/midi_import/midi_import.h +++ b/plugins/midi_import/midi_import.h @@ -30,24 +30,10 @@ #include #endif - -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - - #include "midi.h" #include "import_filter.h" @@ -131,7 +117,7 @@ private: } - typedef vvector > eventVector; + typedef QVector > eventVector; eventVector m_events; int m_timingDivision; diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index 245162221..fb04a8f02 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -23,25 +23,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include -#include -#include -#include - -#endif - #include #include #include @@ -214,15 +199,11 @@ organicInstrument::organicInstrument( instrumentTrack * _channel_track ) : -#ifdef QT4 setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); -#else - setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); -#endif } diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 46a58e9ef..d0f7f485d 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -23,23 +23,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "patman.h" #include "endian_handling.h" #include "engine.h" @@ -89,15 +76,12 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) : instrument( _track, &patman_plugin_descriptor ), specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ) { -#ifndef QT3 setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); -#else - setPaletteBackgroundPixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); -#endif + m_openFileButton = new pixmapButton( this, NULL, NULL ); m_openFileButton->setCursor( QCursor( Qt::PointingHandCursor ) ); m_openFileButton->move( 200, 90 ); @@ -111,11 +95,7 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) : SLOT( openFile() ) ); toolTip::add( m_openFileButton, tr( "Open other patch" ) ); -#ifdef QT4 m_openFileButton->setWhatsThis( -#else - QWhatsThis::add( m_openFileButton, -#endif tr( "Click here to open another patch-file. Loop and Tune " "settings are not reset." ) ); @@ -128,11 +108,7 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) : "loop_off" ) ); m_loopButton->setBgGraphic( getBackground( m_loopButton ) ); toolTip::add( m_loopButton, tr( "Loop mode" ) ); -#ifdef QT4 m_loopButton->setWhatsThis( -#else - QWhatsThis::add( m_loopButton, -#endif tr( "Here you can toggle the Loop mode. If enabled, PatMan " "will use the loop information available in the " "file." ) ); @@ -147,11 +123,7 @@ patmanSynth::patmanSynth( instrumentTrack * _track ) : "tune_off" ) ); m_tuneButton->setBgGraphic( getBackground( m_tuneButton ) ); toolTip::add( m_tuneButton, tr( "Tune mode" ) ); -#ifdef QT4 m_tuneButton->setWhatsThis( -#else - QWhatsThis::add( m_tuneButton, -#endif tr( "Here you can toggle the Tune mode. If enabled, PatMan " "will tune the sample to match the note's " "frequency." ) ); @@ -249,7 +221,6 @@ void patmanSynth::deleteNotePluginData( notePlayHandle * _n ) void patmanSynth::dragEnterEvent( QDragEnterEvent * _dee ) { -#ifdef QT4 if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) ) { QString txt = _dee->mimeData()->data( @@ -267,35 +238,6 @@ void patmanSynth::dragEnterEvent( QDragEnterEvent * _dee ) { _dee->ignore(); } -#else - QString txt = _dee->encodedData( stringPairDrag::mimeType() ); - if( txt != "" ) - { - if( txt.section( ':', 0, 0 ) == "samplefile" - && subPluginFeatures::supported_extensions().contains( - fileItem::extension( txt.section( ':', 1 ) ) ) ) - { - _dee->accept(); - return; - } - _dee->ignore(); - return; - } - - txt = QString( _dee->encodedData( "text/plain" ) ); - if( txt != "" ) - { - QString file = QUriDrag::uriToLocalFile( - txt.stripWhiteSpace() ); - if( file && subPluginFeatures::supported_extensions().contains( - fileItem::extension( file ) ) ) - { - _dee->accept(); - return; - } - } - _dee->ignore(); -#endif } @@ -312,16 +254,6 @@ void patmanSynth::dropEvent( QDropEvent * _de ) return; } -#ifndef QT4 - QString txt = _de->encodedData( "text/plain" ); - if( txt != "" ) - { - setFile( QUriDrag::uriToLocalFile( txt.stripWhiteSpace() ) ); - _de->accept(); - return; - } -#endif - _de->ignore(); } @@ -330,22 +262,11 @@ void patmanSynth::dropEvent( QDropEvent * _de ) void patmanSynth::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap pm( rect().size() ); - pm.fill( this, rect().topLeft() ); - - QPainter p( &pm, this ); -#endif p.setFont( pointSize<8>( font() ) ); p.setPen( QColor( 0x66, 0xFF, 0x66 ) ); p.drawText( 8, 140, m_display_filename ); - -#ifndef QT4 - bitBlt( this, rect().topLeft(), &pm ); -#endif } @@ -353,22 +274,12 @@ void patmanSynth::paintEvent( QPaintEvent * ) void patmanSynth::openFile( void ) { -#ifdef QT4 QFileDialog ofd( NULL, tr( "Open patch file" ) ); -#else - QFileDialog ofd( QString::null, QString::null, NULL, "", TRUE ); - ofd.setWindowTitle( tr( "Open patch file" ) ); -#endif ofd.setFileMode( QFileDialog::ExistingFiles ); - // set filters -#ifdef QT4 QStringList types; types << tr( "Patch-Files (*.pat)" ); ofd.setFilters( types ); -#else - ofd.addFilter( tr( "Patch-Files (*.pat)" ) ); -#endif if( m_patchFile == "" ) { @@ -442,12 +353,7 @@ void patmanSynth::setFile( const QString & _patch_file, bool _rename ) // simple algorithm for creating a text from the filename that // matches in the white rectangle - while( idx > 0 && fm.size( -#ifdef QT4 - Qt::TextSingleLine, -#else - Qt::SingleLine, -#endif + while( idx > 0 && fm.size( Qt::TextSingleLine, m_display_filename + "..." ).width() < 225 ) { m_display_filename = m_patchFile[--idx] + m_display_filename; @@ -468,11 +374,7 @@ patmanSynth::load_error patmanSynth::load_patch( const QString & _filename ) { unload_current_patch(); - FILE * fd = fopen( _filename -#ifndef QT3 - .toAscii().constData() -#endif - , "rb" ); + FILE * fd = fopen( _filename.toAscii().constData() , "rb" ); if( !fd ) { perror( "fopen" ); @@ -653,7 +555,7 @@ void patmanSynth::select_sample( notePlayHandle * _n ) float min_dist = HUGE_VALF; sampleBuffer * sample = NULL; - for( vvector::iterator it = m_patch_samples.begin(); + for( QVector::iterator it = m_patch_samples.begin(); it != m_patch_samples.end(); ++it ) { float patch_freq = ( *it )->frequency(); diff --git a/plugins/patman/patman.h b/plugins/patman/patman.h index 07dc3f2a9..51f8d116d 100644 --- a/plugins/patman/patman.h +++ b/plugins/patman/patman.h @@ -102,7 +102,7 @@ private: } handle_data; QString m_patchFile; - vvector m_patch_samples; + QVector m_patch_samples; pixmapButton * m_openFileButton; pixmapButton * m_loopButton; diff --git a/plugins/singerbot/singerbot.cpp b/plugins/singerbot/singerbot.cpp index d7a6fdf73..0e3bbc6f5 100644 --- a/plugins/singerbot/singerbot.cpp +++ b/plugins/singerbot/singerbot.cpp @@ -23,24 +23,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "singerbot.h" #include "engine.h" #include "instrument_track.h" @@ -99,15 +86,11 @@ singerBot::singerBot( instrumentTrack * _track ) : s_thread->start(); } -#ifndef QT3 setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); -#else - setPaletteBackgroundPixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); -#endif QVBoxLayout * vbox = new QVBoxLayout( this ); vbox->setMargin( 10 ); @@ -115,14 +98,9 @@ singerBot::singerBot( instrumentTrack * _track ) : vbox->addSpacing( 45 ); m_lyrics = new QTextEdit( this ); -#ifdef QT4 m_lyrics->setAutoFillBackground( TRUE ); pal.setColor( m_lyrics->backgroundRole(), QColor( 64, 64, 64 ) ); m_lyrics->setPalette( pal ); -#else - m_lyrics->setTextFormat( PlainText ); - m_lyrics->setPaletteBackgroundColor( QColor( 64, 64, 64 ) ); -#endif m_lyrics->setText( "Hello, world!" ); connect( m_lyrics, SIGNAL( textChanged( void ) ), @@ -182,12 +160,8 @@ void singerBot::saveSettings( QDomDocument & _doc, QDomElement & _this ) { QDomElement element = _doc.createElement( "lyrics" ); _this.appendChild( element ); -#ifdef QT4 QDomCDATASection ds = _doc.createCDATASection( m_lyrics->toPlainText() ); -#else - QDomCDATASection ds = _doc.createCDATASection( m_lyrics->text() ); -#endif element.appendChild( ds ); } @@ -196,12 +170,8 @@ void singerBot::saveSettings( QDomDocument & _doc, QDomElement & _this ) void singerBot::loadSettings( const QDomElement & _this ) { -#ifdef QT4 m_lyrics->setPlainText( _this.namedItem( "lyrics" ).toElement().text() ); -#else - m_lyrics->setText( _this.namedItem( "lyrics" ).toElement().text() ); -#endif } @@ -225,13 +195,8 @@ void singerBot::lyricsChanged( void ) void singerBot::updateWords( void ) { -#ifndef QT3 m_words = m_lyrics->toPlainText().simplified().toLower(). split( ' ' ); -#else - m_words = QStringList::split( ' ', - m_lyrics->text().simplifyWhiteSpace().lower() ); -#endif m_words_dirty = FALSE; } @@ -261,12 +226,7 @@ void singerBot::createWave( notePlayHandle * _n ) / 64.0f / engine::getSongEditor()->getTempo() : 0; int word_index = _n->patternIndex() % m_words.size(); - hdata->text = m_words[word_index]. -#ifndef QT3 - toAscii().constData(); -#else - ascii(); -#endif + hdata->text = m_words[word_index].toAscii().constData(); s_thread->set_data( hdata ); s_thread->unlock_synth(); @@ -373,13 +333,8 @@ singerBot::synThread::synThread( void ) : m_handle_semaphore( 1 ), m_synth_semaphore( 1 ) { -#ifndef QT3 m_handle_semaphore.acquire(); m_synth_semaphore.acquire(); -#else - m_handle_semaphore++; - m_synth_semaphore++; -#endif } @@ -387,13 +342,8 @@ singerBot::synThread::synThread( void ) : singerBot::synThread::~synThread() { -#ifndef QT3 m_handle_semaphore.release(); m_synth_semaphore.release(); -#else - m_handle_semaphore--; - m_synth_semaphore--; -#endif } @@ -424,11 +374,7 @@ void singerBot::synThread::run( void ) for( ; ; ) { -#ifndef QT3 m_synth_semaphore.acquire(); -#else - m_synth_semaphore++; -#endif text_to_wave(); if( !m_data->wave ) { @@ -439,11 +385,7 @@ void singerBot::synThread::run( void ) printf( "Unsupported frequency?\n" ); } } -#ifndef QT3 m_handle_semaphore.release(); -#else - m_handle_semaphore--; -#endif } } diff --git a/plugins/singerbot/singerbot.h b/plugins/singerbot/singerbot.h index bb4e878ce..513d2b4c9 100644 --- a/plugins/singerbot/singerbot.h +++ b/plugins/singerbot/singerbot.h @@ -26,16 +26,8 @@ #ifndef _SINGERBOT_H #define _SINGERBOT_H -#ifndef QT3 - #include -#else - -#include - -#endif - #ifdef HAVE_CONFIG_H #include #endif @@ -104,19 +96,11 @@ private: void unlock_synth( void ) { -#ifndef QT3 m_synth_semaphore.release(); -#else - m_synth_semaphore--; -#endif } void lock_handle( void ) { -#ifndef QT3 m_handle_semaphore.acquire(); -#else - m_handle_semaphore++; -#endif } diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index 4e40bd58e..5c5a12170 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -23,20 +23,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include -#include -#include - -#endif - #include "BandedWG.h" #include "ModalBar.h" #include "TubeBell.h" @@ -128,15 +116,11 @@ mallets::~mallets() void mallets::setWidgetBackground( QWidget * _widget, const QString & _pic ) { -#ifdef QT4 _widget->setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( _widget->backgroundRole(), PLUGIN_NAME::getIconPixmap( _pic.toAscii().constData() ) ); _widget->setPalette( pal ); -#else - _widget->setErasePixmap( PLUGIN_NAME::getIconPixmap( _pic ) ); -#endif } @@ -541,10 +525,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch, { Stk::setSampleRate( _sample_rate ); Stk::setRawwavePath( configManager::inst()->stkDir() -#ifndef QT3 - .toAscii().constData() -#endif - ); + .toAscii().constData() ); m_voice = new ModalBar(); @@ -591,10 +572,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch, { Stk::setSampleRate( _sample_rate ); Stk::setRawwavePath( configManager::inst()->stkDir() -#ifndef QT3 - .toAscii().constData() -#endif - ); + .toAscii().constData() ); m_voice = new TubeBell(); @@ -639,10 +617,7 @@ malletsSynth::malletsSynth( const StkFloat _pitch, { Stk::setSampleRate( _sample_rate ); Stk::setRawwavePath( configManager::inst()->stkDir() -#ifndef QT3 - .toAscii().constData() -#endif - ); + .toAscii().constData() ); m_voice = new BandedWG(); diff --git a/plugins/stk/mallets/mallets.h b/plugins/stk/mallets/mallets.h index 5a6d41703..8bdc56d5b 100644 --- a/plugins/stk/mallets/mallets.h +++ b/plugins/stk/mallets/mallets.h @@ -170,7 +170,7 @@ private: comboBox * m_presets; knob * m_spread; - vvector m_scalers; + QVector m_scalers; sampleFrame * m_buffer; bool m_filesMissing; diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index a6afba3a6..700587383 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -23,26 +23,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include -#include - -#define setChecked setOn - -#endif - - #include "triple_oscillator.h" #include "automatable_button.h" #include "debug.h" @@ -84,15 +68,11 @@ plugin::descriptor tripleoscillator_plugin_descriptor = tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) : instrument( _channel_track, &tripleoscillator_plugin_descriptor ) { -#ifdef QT4 setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); -#else - setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); -#endif pixmapButton * pm_osc1_btn = new pixmapButton( this, NULL, NULL ); pm_osc1_btn->move( 46, 50 ); @@ -247,11 +227,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) : / NUM_OF_OSCILLATORS ); m_osc[i].m_volKnob->setHintText( tr( "Osc %1 volume:" ).arg( i+1 ) + " ", "%" ); -#ifdef QT4 m_osc[i].m_volKnob->setWhatsThis( -#else - QWhatsThis::add( m_osc[i].m_volKnob, -#endif tr( "With this knob you can set the volume of " "oscillator %1. When setting a value of 0 the " "oscillator is turned off. Otherwise you can " @@ -269,11 +245,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) : m_osc[i].m_panKnob->setHintText( tr("Osc %1 panning:").arg( i + 1 ) + " ", "" ); -#ifdef QT4 m_osc[i].m_panKnob->setWhatsThis( -#else - QWhatsThis::add( m_osc[i].m_panKnob, -#endif tr( "With this knob you can set the panning of the " "oscillator %1. A value of -100 means 100% " "left and a value of 100 moves oscillator-" @@ -290,11 +262,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) : m_osc[i].m_coarseKnob->setHintText( tr( "Osc %1 coarse detuning:" ).arg( i + 1 ) + " ", " " + tr( "semitones" ) ); -#ifdef QT4 m_osc[i].m_coarseKnob->setWhatsThis( -#else - QWhatsThis::add( m_osc[i].m_coarseKnob, -#endif tr( "With this knob you can set the coarse detuning of " "oscillator %1. You can detune the oscillator " "12 semitones (1 octave) up and down. This is " @@ -312,11 +280,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) : "left:" ).arg( i + 1 ) + " ", " " + tr( "cents" ) ); -#ifdef QT4 m_osc[i].m_fineLKnob->setWhatsThis( -#else - QWhatsThis::add( m_osc[i].m_fineLKnob, -#endif tr( "With this knob you can set the fine detuning of " "oscillator %1 for the left channel. The fine-" "detuning is ranged between -100 cents and " @@ -334,11 +298,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) : m_osc[i].m_fineRKnob->setHintText( tr( "Osc %1 fine detuning " "right:").arg( i + 1 ) + " ", " " + tr( "cents" ) ); -#ifdef QT4 m_osc[i].m_fineRKnob->setWhatsThis( -#else - QWhatsThis::add( m_osc[i].m_fineRKnob, -#endif tr( "With this knob you can set the fine detuning of " "oscillator %1 for the right channel. The " "fine-detuning is ranged between -100 cents " @@ -357,11 +317,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) : "offset:" ). arg( i + 1 ) + " ", " " + tr( "degrees" ) ); -#ifdef QT4 m_osc[i].m_phaseOffsetKnob->setWhatsThis( -#else - QWhatsThis::add( m_osc[i].m_phaseOffsetKnob, -#endif tr( "With this knob you can set the phase-offset of " "oscillator %1. That means you can move the " "point within an oscillation where the " @@ -386,11 +342,7 @@ tripleOscillator::tripleOscillator( instrumentTrack * _channel_track ) : arg( i + 1 ) + " ", " " + tr( "degrees" ) ); -#ifdef QT4 m_osc[i].m_stereoPhaseDetuningKnob->setWhatsThis( -#else - QWhatsThis::add( m_osc[i].m_stereoPhaseDetuningKnob, -#endif tr( "With this knob you can set the stereo phase-" "detuning of oscillator %1. The stereo phase-" "detuning specifies the size of the difference " diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 15eabdb85..7cb1ddc24 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -23,12 +23,6 @@ */ -#include "vestige.h" - -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -37,21 +31,8 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - - #include "engine.h" +#include "vestige.h" #include "gui_templates.h" #include "instrument_play_handle.h" #include "instrument_track.h" @@ -102,14 +83,6 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) : "artwork" ) ); } -#ifdef QT4 -/* QPalette pal; - pal.setBrush( backgroundRole(), *s_artwork); - setPalette( pal );*/ -#else - setErasePixmap( *s_artwork ); -#endif - m_openPluginButton = new pixmapButton( this, NULL, NULL ); m_openPluginButton->setCheckable( FALSE ); m_openPluginButton->setCursor( Qt::PointingHandCursor ); @@ -124,11 +97,7 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) : SLOT( openPlugin() ) ); toolTip::add( m_openPluginButton, tr( "Open other VST-plugin" ) ); -#ifdef QT4 m_openPluginButton->setWhatsThis( -#else - QWhatsThis::add( m_openPluginButton, -#endif tr( "Click here, if you want to open another VST-plugin. After " "clicking on this button, a file-open-dialog appears " "and you can select your file." ) ); @@ -139,11 +108,7 @@ vestigeInstrument::vestigeInstrument( instrumentTrack * _instrument_track ) : m_toggleGUIButton->setFont( pointSize<8>( m_toggleGUIButton->font() ) ); connect( m_toggleGUIButton, SIGNAL( clicked() ), this, SLOT( toggleGUI() ) ); -#ifdef QT4 m_toggleGUIButton->setWhatsThis( -#else - QWhatsThis::add( m_toggleGUIButton, -#endif tr( "Click here to show or hide the graphical user interface " "(GUI) of your VST-plugin." ) ); @@ -276,13 +241,8 @@ void vestigeInstrument::setParameter( const QString & _param, } if( m_plugin->pluginWidget() != NULL ) { -#ifdef QT4 m_plugin->pluginWidget()->setWindowIcon( getInstrumentTrack()->windowIcon() ); -#else - m_plugin->pluginWidget()->setWindowIcon( - *( getInstrumentTrack()->windowIcon() ) ); -#endif } m_pluginMutex.unlock(); update(); @@ -408,21 +368,12 @@ bool vestigeInstrument::handleMidiEvent( const midiEvent & _me, void vestigeInstrument::openPlugin( void ) { -#ifdef QT4 QFileDialog ofd( NULL, tr( "Open VST-plugin" ) ); -#else - QFileDialog ofd( QString::null, QString::null, NULL, "", TRUE ); - ofd.setWindowTitle( tr( "Open VST-plugin" ) ); -#endif QString dir; if( m_pluginDLL != "" ) { -#ifdef QT4 dir = QFileInfo( m_pluginDLL ).absolutePath(); -#else - dir = QFileInfo( m_pluginDLL ).dirPath( TRUE ); -#endif } else { @@ -433,17 +384,11 @@ void vestigeInstrument::openPlugin( void ) ofd.setFileMode( QFileDialog::ExistingFiles ); // set filters -#ifdef QT4 QStringList types; types << tr( "DLL-files (*.dll)" ) << tr( "EXE-files (*.exe)" ) ; ofd.setFilters( types ); -#else - ofd.addFilter( tr( "DLL-files (*.dll)" ) ); - ofd.addFilter( tr( "EXE-files (*.exe)" ) ); - ofd.setSelectedFilter( tr( "DLL-files (*.dll)" ) ); -#endif if( m_pluginDLL != "" ) { // select previously opened file @@ -520,14 +465,7 @@ void vestigeInstrument::changeTempo( bpm_t _new_tempo ) void vestigeInstrument::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap pm( rect().size() ); - pm.fill( this, rect().topLeft() ); - - QPainter p( &pm, this ); -#endif p.drawPixmap( 0, 0, *s_artwork ); @@ -553,10 +491,6 @@ void vestigeInstrument::paintEvent( QPaintEvent * ) m_plugin->vendorString() ); } // m_pluginMutex.unlock(); - -#ifndef QT4 - bitBlt( this, rect().topLeft(), &pm ); -#endif } diff --git a/plugins/vibed/graph.cpp b/plugins/vibed/graph.cpp index 366e5e0f9..c66726dc4 100644 --- a/plugins/vibed/graph.cpp +++ b/plugins/vibed/graph.cpp @@ -23,23 +23,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - - #include "graph.h" #include "string_pair_drag.h" #include "sample_buffer.h" @@ -58,11 +45,6 @@ graph::graph( QWidget * _parent ) : setFixedSize( 132, 104 ); setAcceptDrops( TRUE ); - -#ifndef QT4 - setBackgroundMode( NoBackground ); -#endif - } @@ -149,11 +131,7 @@ void graph::mousePressEvent( QMouseEvent * _me ) // toggle mouse state m_mouseDown = true; -#ifndef QT3 setCursor( Qt::BlankCursor ); -#else - setCursor( QCursor::BlankCursor ); -#endif m_lastCursorX = x; } } @@ -184,11 +162,7 @@ void graph::mouseReleaseEvent( QMouseEvent * _me ) { // toggle mouse state m_mouseDown = false; -#ifndef QT3 setCursor( Qt::ArrowCursor ); -#else - setCursor( QCursor::ArrowCursor ); -#endif update(); } } @@ -198,14 +172,7 @@ void graph::mouseReleaseEvent( QMouseEvent * _me ) void graph::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( rect().size() ); - draw_pm.fill( this, rect().topLeft() ); - - QPainter p( &draw_pm, this ); -#endif p.setPen( QColor( 0xFF, 0xAA, 0x00 ) ); @@ -230,15 +197,11 @@ void graph::paintEvent( QPaintEvent * ) p.drawLine( cursor.x(), 2, cursor.x(), 102 ); } p.drawPixmap( 0, 0, m_foreground ); - -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif - } + + void graph::dropEvent( QDropEvent * _de ) { QString type = stringPairDrag::decodeKey( _de ); diff --git a/plugins/vibed/graph.h b/plugins/vibed/graph.h index 75e0ae391..9e8147542 100644 --- a/plugins/vibed/graph.h +++ b/plugins/vibed/graph.h @@ -26,22 +26,10 @@ #ifndef _GRAPH_H #define _GRAPH_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - class graph : public QWidget { diff --git a/plugins/vibed/impulse_editor.cpp b/plugins/vibed/impulse_editor.cpp index 1fedb82e0..804393c13 100644 --- a/plugins/vibed/impulse_editor.cpp +++ b/plugins/vibed/impulse_editor.cpp @@ -22,9 +22,6 @@ * */ -#include "qt3support.h" - -#ifdef QT4 #include #include @@ -33,18 +30,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include - -#endif - #include "impulse_editor.h" #include "embed.h" #include "engine.h" @@ -63,15 +48,11 @@ impulseEditor::impulseEditor( QWidget * _parent, int _x, int _y, track * _track, { setFixedSize( 153, 124 ); m_base = QPixmap::grabWidget( _parent, _x, _y ); -#ifndef QT3 setAutoFillBackground( TRUE ); QPalette pal = palette(); pal.setBrush( backgroundRole(), m_base ); setPalette( pal ); -#else - setPaletteBackgroundPixmap( m_base ); -#endif - + m_graph = new graph( this ); m_graph->setForeground( PLUGIN_NAME::getIconPixmap( "wavegraph4" ) ); m_graph->move( 0, 0 ); @@ -458,9 +439,9 @@ void impulseEditor::setOn( bool _on ) void impulseEditor::contextMenuEvent( QContextMenuEvent * ) { QMenu contextMenu( this ); -#ifdef QT4 contextMenu.setTitle( accessibleName() ); -#else +#warning TODO: css-formatting +#if 0 QLabel * caption = new QLabel( "" + QString( "Impulse Editor" ) + "", this ); caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); @@ -477,13 +458,8 @@ void impulseEditor::contextMenuEvent( QContextMenuEvent * ) void impulseEditor::displayHelp( void ) { -#ifdef QT4 QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), - whatsThis() ); -#else - QWhatsThis::display( QWhatsThis::textFor( this ), mapToGlobal( - rect().bottomRight() ) ); -#endif + whatsThis() ); } diff --git a/plugins/vibed/impulse_editor.h b/plugins/vibed/impulse_editor.h index 447808e94..28751ef7f 100644 --- a/plugins/vibed/impulse_editor.h +++ b/plugins/vibed/impulse_editor.h @@ -24,28 +24,17 @@ #ifndef _IMPULSE_EDITOR_H #define _IMPULSE_EDITOR_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "config.h" #include "types.h" #include "graph.h" #include "pixmap_button.h" #include "led_checkbox.h" + class impulseEditor: public QWidget { Q_OBJECT diff --git a/plugins/vibed/nine_button_selector.cpp b/plugins/vibed/nine_button_selector.cpp index 67dd1cb29..a97a8eef3 100644 --- a/plugins/vibed/nine_button_selector.cpp +++ b/plugins/vibed/nine_button_selector.cpp @@ -22,27 +22,15 @@ * */ -#include "qt3support.h" - -#ifdef QT4 #include #include #include -#else - -#include -#include -#include -#include - -#endif - - #include "nine_button_selector.h" #include "embed.h" + nineButtonSelector::nineButtonSelector( QPixmap _button0_on, QPixmap _button0_off, QPixmap _button1_on, @@ -71,14 +59,11 @@ nineButtonSelector::nineButtonSelector( QPixmap _button0_on, setFixedSize( 50, 50 ); m_base = QPixmap::grabWidget( _parent, _x, _y ); move( _x, _y ); -#ifndef QT3 + setAutoFillBackground( TRUE ); QPalette pal = palette(); pal.setBrush( backgroundRole(), m_base ); setPalette( pal ); -#else - setPaletteBackgroundPixmap( m_base ); -#endif m_button = new pixmapButton( this, NULL, _track ); m_button->move( 1, 1 ); @@ -266,9 +251,9 @@ void FASTCALL nineButtonSelector::setSelected( Uint8 _new_button ) void nineButtonSelector::contextMenuEvent( QContextMenuEvent * ) { QMenu contextMenu( this ); -#ifdef QT4 contextMenu.setTitle( accessibleName() ); -#else +#warning TODO: CSS-formatting +#if 0 QLabel * caption = new QLabel( "" + QString( "Selector" ) + "", this ); caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); @@ -285,13 +270,8 @@ void nineButtonSelector::contextMenuEvent( QContextMenuEvent * ) void nineButtonSelector::displayHelp( void ) { -#ifdef QT4 QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), - whatsThis() ); -#else - QWhatsThis::display( QWhatsThis::textFor( this ), mapToGlobal( - rect().bottomRight() ) ); -#endif + whatsThis() ); } diff --git a/plugins/vibed/nine_button_selector.h b/plugins/vibed/nine_button_selector.h index 34fd4db88..3dc21a2f4 100644 --- a/plugins/vibed/nine_button_selector.h +++ b/plugins/vibed/nine_button_selector.h @@ -24,7 +24,6 @@ #ifndef _NINE_BUTTON_SELECTOR_H #define _NINE_BUTTON_SELECTOR_H -#include "qt3support.h" #include "config.h" #include "types.h" #include "pixmap_button.h" @@ -79,7 +78,7 @@ signals: void nineButtonSelection( Uint8 ); private: - vlist m_buttons; + QList m_buttons; pixmapButton * m_button; pixmapButton * m_lastBtn; QPixmap m_base; diff --git a/plugins/vibed/string_container.h b/plugins/vibed/string_container.h index c5749ef65..bc35f28ca 100644 --- a/plugins/vibed/string_container.h +++ b/plugins/vibed/string_container.h @@ -20,23 +20,12 @@ * Boston, MA 02110-1301 USA. * */ -#ifndef _TWO_STRINGS_H -#define _TWO_STRINGS_H - -#include "qt3support.h" - -#ifndef QT3 +#ifndef _STRING_CONTAINER_H +#define _STRING_CONTAINER_H #include -#else - -#include - -#endif - - #include "config.h" #include "types.h" #include "vibrating_string.h" @@ -82,11 +71,11 @@ public: } private: - vvector m_strings; + QVector m_strings; const float m_pitch; const sample_rate_t m_sampleRate; const Uint32 m_bufferLength; - vvector m_exists; + QVector m_exists; } ; #endif diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 635ac0f98..fa305b65f 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -22,9 +22,6 @@ * */ -#include "qt3support.h" - -#ifdef QT4 #include #include @@ -32,18 +29,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include - -#endif - - #include "vibed.h" #include "base64.h" #include "engine.h" @@ -80,32 +65,23 @@ plugin::descriptor vibedstrings_plugin_descriptor = } -vibed::vibed( instrumentTrack * _channel_track ) : - instrument( _channel_track, &vibedstrings_plugin_descriptor ), +vibed::vibed( instrumentTrack * instrument_track ) : + instrument( instrument_track, &vibedstrings_plugin_descriptor ), m_sampleLength( 128 ) { -#ifdef QT4 setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); -#else - setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); -#endif for( Uint8 harm = 0; harm < 9; harm++ ) { - m_editor = new impulseEditor( this, 76, 21, _channel_track ); + m_editor = new impulseEditor( this, 76, 21, instrument_track ); m_editor->setOn( FALSE ); m_editor->hide(); m_editors.append( m_editor ); -#ifdef QT4 - m_editor->setWhatsThis( -#else - QWhatsThis::add( m_editor, -#endif - tr( + m_editor->setWhatsThis( tr( "The waveform editor provides control over the initial state or impulse " "that is used to start the string vibrating. The buttons to the right of " "the graph will initialize the waveform to the selected type. The '?' " @@ -119,24 +95,19 @@ vibed::vibed( instrumentTrack * _channel_track ) : "The 'N' button will normalize the waveform.") ); m_volumeKnob = new volumeKnob( knobBright_26, this, - tr( "Volume" ), _channel_track ); + tr( "Volume" ), instrument_track ); m_volumeKnob->setRange( MIN_VOLUME, MAX_VOLUME, 1.0f ); m_volumeKnob->setInitValue( DEFAULT_VOLUME ); m_volumeKnob->move( 103, 142 ); m_volumeKnob->setHintText( tr( "Volume:" ) + " ", "" ); m_volumeKnob->hide(); m_volumeKnobs.append( m_volumeKnob ); -#ifdef QT4 - m_volumeKnob->setWhatsThis( -#else - QWhatsThis::add( m_volumeKnob, -#endif - tr( -"The 'V' knob sets the volume of the selected string." ) ); + m_volumeKnob->setWhatsThis( tr( "The 'V' knob sets the volume " + "of the selected string." ) ); m_stiffnessKnob = new knob( knobBright_26, this, - tr( "String stiffness" ), - _channel_track ); + tr( "String stiffness" ), + instrument_track ); m_stiffnessKnob->setRange( 0.0f, 0.05f, 0.001f ); m_stiffnessKnob->setInitValue( 0.0f ); m_stiffnessKnob->move( 129, 142 ); @@ -144,12 +115,7 @@ vibed::vibed( instrumentTrack * _channel_track ) : " ", "" ); m_stiffnessKnob->hide(); m_stiffnessKnobs.append( m_stiffnessKnob ); -#ifdef QT4 - m_stiffnessKnob->setWhatsThis( -#else - QWhatsThis::add( m_stiffnessKnob, -#endif - tr( + m_stiffnessKnob->setWhatsThis( tr( "The 'S' knob sets the stiffness of the selected string. The stiffness " "of the string affects how long the string will ring out. The lower " "the setting, the longer the string will ring." ) ); @@ -157,25 +123,20 @@ vibed::vibed( instrumentTrack * _channel_track ) : m_pickKnob = new knob( knobBright_26, this, tr( "Pick position" ), - _channel_track ); + instrument_track ); m_pickKnob->setRange( 0.0f, 0.5f, 0.005f ); m_pickKnob->setInitValue( 0.0f ); m_pickKnob->move( 153, 142 ); m_pickKnob->setHintText( tr( "Pick position:" ) + " ", "" ); m_pickKnob->hide(); m_pickKnobs.append( m_pickKnob ); -#ifdef QT4 - m_pickKnob->setWhatsThis( -#else - QWhatsThis::add( m_pickKnob, -#endif - tr( + m_pickKnob->setWhatsThis( tr( "The 'P' knob sets the position where the selected string will be 'picked'. " "The lower the setting the closer the pick is to the bridge." ) ); m_pickupKnob = new knob( knobBright_26, this, tr( "Pickup position" ), - _channel_track ); + instrument_track ); m_pickupKnob->setRange( 0.0f, 0.5f, 0.005f ); m_pickupKnob->setInitValue( 0.05f ); m_pickupKnob->move( 177, 142 ); @@ -183,53 +144,38 @@ vibed::vibed( instrumentTrack * _channel_track ) : " ", "" ); m_pickupKnob->hide(); m_pickupKnobs.append( m_pickupKnob ); -#ifdef QT4 - m_pickupKnob->setWhatsThis( -#else - QWhatsThis::add( m_pickupKnob, -#endif - tr( + m_pickupKnob->setWhatsThis( tr( "The 'PU' knob sets the position where the vibrations will be monitored " "for the selected string. The lower the setting, the closer the " "pickup is to the bridge." ) ); m_panKnob = new knob( knobBright_26, this, tr( "Pan" ), - _channel_track ); + instrument_track ); m_panKnob->setRange( -1.0f, 1.0f, 0.01f ); m_panKnob->setInitValue( 0.0f ); m_panKnob->move( 105, 187 ); m_panKnob->setHintText( tr( "Pan:" ) + " ", "" ); m_panKnob->hide(); m_panKnobs.append( m_panKnob ); -#ifdef QT4 - m_panKnob->setWhatsThis( -#else - QWhatsThis::add( m_panKnob, -#endif - tr( + m_panKnob->setWhatsThis( tr( "The Pan knob determines the location of the selected string in the stereo " "field." ) ); m_detuneKnob = new knob( knobBright_26, this, tr( "Detune" ), - _channel_track ); + instrument_track ); m_detuneKnob->setRange( -0.1f, 0.1f, 0.001f ); m_detuneKnob->setInitValue( 0.0f ); m_detuneKnob->move( 150, 187 ); m_detuneKnob->setHintText( tr( "Detune:" ) + " ", "" ); m_detuneKnob->hide(); m_detuneKnobs.append( m_detuneKnob ); -#ifdef QT4 - m_detuneKnob->setWhatsThis( -#else - QWhatsThis::add( m_detuneKnob, -#endif - tr( + m_detuneKnob->setWhatsThis( tr( "The Detune knob modifies the pitch of the selected string. Settings less " "than zero will cause the string to sound flat. Settings greater than zero " "will cause the string to sound sharp." ) ); m_randomKnob = new knob( knobBright_26, this, tr( "Fuzziness" ), - _channel_track ); + instrument_track ); m_randomKnob->setRange( 0.0f, 0.75f, 0.01f ); m_randomKnob->setInitValue( 0.0f ); m_randomKnob->move( 194, 187 ); @@ -237,18 +183,13 @@ vibed::vibed( instrumentTrack * _channel_track ) : " ", "" ); m_randomKnob->hide(); m_randomKnobs.append( m_randomKnob ); -#ifdef QT4 - m_randomKnob->setWhatsThis( -#else - QWhatsThis::add( m_randomKnob, -#endif - tr( + m_randomKnob->setWhatsThis( tr( "The Slap knob adds a bit of fuzz to the selected string which is most " "apparent during the attack, though it can also be used to make the string " "sound more 'metallic'.") ); m_lengthKnob = new knob( knobBright_26, this, tr( "Length" ), - _channel_track ); + instrument_track ); m_lengthKnob->setRange( 1, 16, 1 ); m_lengthKnob->setInitValue( 1 ); m_lengthKnob->move( 23, 193 ); @@ -256,30 +197,20 @@ vibed::vibed( instrumentTrack * _channel_track ) : " ", "" ); m_lengthKnob->hide(); m_lengthKnobs.append( m_lengthKnob ); -#ifdef QT4 - m_lengthKnob->setWhatsThis( -#else - QWhatsThis::add( m_lengthKnob, -#endif - tr( + m_lengthKnob->setWhatsThis( tr( "The Length knob sets the length of the selected string. Longer strings " "will both ring longer and sound brighter, however, they will also eat up " "more CPU cycles." ) ); m_impulse = new ledCheckBox( "", this, tr( "Impulse" ), - _channel_track ); + instrument_track ); m_impulse->move( 23, 94 ); m_impulse->setChecked( FALSE ); toolTip::add( m_impulse, tr( "Impulse or initial state" ) ); m_impulse->hide(); m_impulses.append( m_impulse ); -#ifdef QT4 - m_impulse->setWhatsThis( -#else - QWhatsThis::add( m_impulse, -#endif - tr( + m_impulse->setWhatsThis( tr( "The 'Imp' selector determines whether the waveform in the graph is to be " "treated as an impulse imparted to the string by the pick or the initial " "state of the string." ) ); @@ -309,12 +240,7 @@ vibed::vibed( instrumentTrack * _channel_track ) : NULL ); m_harmonic->hide(); m_harmonics.append( m_harmonic ); -#ifdef QT4 - m_harmonic->setWhatsThis( -#else - QWhatsThis::add( m_harmonic, -#endif - tr( + m_harmonic->setWhatsThis( tr( "The Octave selector is used to choose which harmonic of the note the " "string will ring at. For example, '-2' means the string will ring two " "octaves below the fundamental, 'F' means the string will ring at the " @@ -347,12 +273,7 @@ vibed::vibed( instrumentTrack * _channel_track ) : NULL ); connect( m_stringSelector, SIGNAL( nineButtonSelection( Uint8 ) ), this, SLOT( showString( Uint8 ) ) ); -#ifdef QT4 - m_stringSelector->setWhatsThis( -#else - QWhatsThis::add( m_stringSelector, -#endif - tr( + m_stringSelector->setWhatsThis( tr( "The String selector is used to choose which string the controls are " "editting. A Vibed instrument can contain up to nine independently " "vibrating strings. The LED in the lower right corner of the " @@ -373,12 +294,7 @@ vibed::vibed( instrumentTrack * _channel_track ) : m_editor->setOn( TRUE ); showString( 0 ); -#ifdef QT4 - this->setWhatsThis( -#else - QWhatsThis::add( this, -#endif - tr( + setWhatsThis( tr( "Vibed models up to nine independently vibrating strings. The 'String' " "selector allows you to choose which string is being edited. The 'Imp' " "selector chooses whether the graph represents an impulse or the initial " "state of the string. The 'Octave' selector chooses which harmonic the " @@ -673,9 +589,9 @@ void vibed::showString( Uint8 _string ) void vibed::contextMenuEvent( QContextMenuEvent * ) { QMenu contextMenu( this ); -#ifdef QT4 contextMenu.setTitle( accessibleName() ); -#else +#warning TODO: CSS-formatting +#if 0 QLabel * caption = new QLabel( "" + QString( "Vibed" ) + "", this ); caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); @@ -692,13 +608,8 @@ void vibed::contextMenuEvent( QContextMenuEvent * ) void vibed::displayHelp( void ) { -#ifdef QT4 QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), - whatsThis() ); -#else - QWhatsThis::display( QWhatsThis::textFor( this ), mapToGlobal( - rect().bottomRight() ) ); -#endif + whatsThis() ); } diff --git a/plugins/vibed/vibed.h b/plugins/vibed/vibed.h index 690eb7698..4a14c819f 100644 --- a/plugins/vibed/vibed.h +++ b/plugins/vibed/vibed.h @@ -23,8 +23,6 @@ #ifndef _VIBED_STRINGS_H #define _VIBED_STRINGS_H -#include "qt3support.h" - #include "instrument.h" #include "sample_buffer.h" #include "graph.h" @@ -64,17 +62,17 @@ public slots: void displayHelp( void ); private: - vlist m_pickKnobs; - vlist m_pickupKnobs; - vlist m_stiffnessKnobs; - vlist m_volumeKnobs; - vlist m_panKnobs; - vlist m_detuneKnobs; - vlist m_randomKnobs; - vlist m_lengthKnobs; - vlist m_editors; - vlist m_impulses; - vlist m_harmonics; + QList m_pickKnobs; + QList m_pickupKnobs; + QList m_stiffnessKnobs; + QList m_volumeKnobs; + QList m_panKnobs; + QList m_detuneKnobs; + QList m_randomKnobs; + QList m_lengthKnobs; + QList m_editors; + QList m_impulses; + QList m_harmonics; knob * m_pickKnob; knob * m_pickupKnob; diff --git a/plugins/vst_base/lvsl_client.cpp b/plugins/vst_base/lvsl_client.cpp index 3954c944d..60127d6c9 100644 --- a/plugins/vst_base/lvsl_client.cpp +++ b/plugins/vst_base/lvsl_client.cpp @@ -23,29 +23,13 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include +#include #include #include #include -#else - -#include -#include -#include - -#include "qxembed.h" - -#define QX11EmbedContainer QXEmbed -#define embedClient embed - -#endif - #ifdef HAVE_CONFIG_H #include #endif @@ -122,18 +106,8 @@ remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin ) : QString lvsl_server_exec = configManager::inst()->pluginDir() + QDir::separator() + "lvsl_server"; - execlp( lvsl_server_exec. -#ifdef QT4 - toAscii().constData(), -#else - ascii(), -#endif - lvsl_server_exec. -#ifdef QT4 - toAscii().constData(), -#else - ascii(), -#endif + execlp( lvsl_server_exec.toAscii().constData(), + lvsl_server_exec.toAscii().constData(), "", NULL ); return; } @@ -162,13 +136,7 @@ remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin ) : } writeValueS( VST_LOAD_PLUGIN ); - writeStringS( p. -#ifdef QT4 - toAscii().constData() -#else - ascii() -#endif - ); + writeStringS( p.toAscii().constData() ); unlock(); while( 1 ) @@ -187,11 +155,7 @@ remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin ) : { break; } -#ifdef QT4 QApplication::processEvents( QEventLoop::AllEvents, 50 ); -#else - qApp->processEvents( 50 ); -#endif } } @@ -256,9 +220,7 @@ void remoteVSTPlugin::showEditor( void ) m_pluginWidget = new QWidget( engine::getMainWindow()->workspace() ); m_pluginWidget->setFixedSize( m_pluginGeometry ); m_pluginWidget->setWindowTitle( name() ); -#ifndef QT3 engine::getMainWindow()->workspace()->addWindow( m_pluginWidget ); -#endif m_pluginWidget->show(); QX11EmbedContainer * xe = new QX11EmbedContainer( m_pluginWidget ); @@ -431,11 +393,7 @@ void remoteVSTPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this ) for( QMap::const_iterator it = dump.begin(); it != dump.end(); ++it ) { -#ifdef QT4 _this.setAttribute( it.key(), it.value() ); -#else - _this.setAttribute( it.key(), it.data() ); -#endif } } diff --git a/plugins/vst_base/lvsl_client.h b/plugins/vst_base/lvsl_client.h index d3c0f8f97..f1914685d 100644 --- a/plugins/vst_base/lvsl_client.h +++ b/plugins/vst_base/lvsl_client.h @@ -26,23 +26,10 @@ #ifndef _LVSL_CLIENT_H #define _LVSL_CLIENT_H -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - - #include "mixer.h" #include "communication.h" #include "midi.h" diff --git a/plugins/vst_effect/vst_effect.h b/plugins/vst_effect/vst_effect.h index 1b27bd4f5..ec35feb0c 100644 --- a/plugins/vst_effect/vst_effect.h +++ b/plugins/vst_effect/vst_effect.h @@ -26,19 +26,8 @@ #ifndef _VST_EFFECT_H #define _VST_EFFECT_H -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "effect.h" #include "engine.h" #include "main_window.h" diff --git a/src/audio/audio_alsa.cpp b/src/audio/audio_alsa.cpp index 41a69874b..9b2d68d54 100644 --- a/src/audio/audio_alsa.cpp +++ b/src/audio/audio_alsa.cpp @@ -26,21 +26,9 @@ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include -#include - -#endif - #include "audio_alsa.h" @@ -71,11 +59,7 @@ audioALSA::audioALSA( const sample_rate_t _sample_rate, bool & _success_ful, int err; if( ( err = snd_pcm_open( &m_handle, -#ifdef QT4 probeDevice().toAscii().constData(), -#else - probeDevice().ascii(), -#endif SND_PCM_STREAM_PLAYBACK, 0 ) ) < 0 ) { diff --git a/src/audio/audio_file_device.cpp b/src/audio/audio_file_device.cpp index 83bfccb58..906d39913 100644 --- a/src/audio/audio_file_device.cpp +++ b/src/audio/audio_file_device.cpp @@ -26,18 +26,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "audio_file_device.h" #include "export_project_dialog.h" @@ -58,11 +48,7 @@ audioFileDevice::audioFileDevice( const sample_rate_t _sample_rate, m_minBitrate( _min_bitrate ), m_maxBitrate( _max_bitrate ) { -#ifdef QT4 if( m_outputFile.open( QFile::WriteOnly | QFile::Truncate ) == FALSE ) -#else - if( m_outputFile.open( IO_WriteOnly | IO_Truncate ) == FALSE ) -#endif { QMessageBox::critical( NULL, exportProjectDialog::tr( "Could not open file" ), @@ -91,11 +77,7 @@ audioFileDevice::~audioFileDevice() Sint32 audioFileDevice::writeData( const void * _data, Sint32 _len ) { -#ifdef QT4 return( m_outputFile.write( (const char *) _data, _len ) ); -#else - return( m_outputFile.writeBlock( (const char *) _data, _len ) ); -#endif } diff --git a/src/audio/audio_jack.cpp b/src/audio/audio_jack.cpp index a27d0f22d..7012ea845 100644 --- a/src/audio/audio_jack.cpp +++ b/src/audio/audio_jack.cpp @@ -30,20 +30,10 @@ #ifdef JACK_SUPPORT -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include @@ -83,12 +73,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful, #ifndef OLD_JACK const char * server_name = NULL; jack_status_t status; - m_client = jack_client_open( client_name. -#ifdef QT4 - toAscii().constData(), -#else - ascii(), -#endif + m_client = jack_client_open( client_name.toAscii().constData(), JackNullOption, &status, server_name ); if( m_client == NULL ) @@ -104,23 +89,13 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful, { printf( "there's already a client with name '%s', so unique " "name '%s' was assigned\n", client_name. -#ifdef QT4 toAscii().constData(), -#else - ascii(), -#endif jack_get_client_name( m_client ) ); } #else /* OLD_JACK */ - m_client = jack_client_new( client_name. -#ifdef QT4 - toAscii().constData() -#else - ascii() -#endif - ); + m_client = jack_client_new( client_name.toAscii().constData() ); if( m_client == NULL ) { printf( "jack_client_new() failed\n" ); @@ -150,11 +125,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful, ( ( ch % 2 ) ? "R" : "L" ) + QString::number( ch / 2 + 1 ); m_outputPorts.push_back( jack_port_register( m_client, -#ifdef QT4 name.toAscii().constData(), -#else - name.ascii(), -#endif JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 ) ); if( m_outputPorts.back() == NULL ) @@ -164,12 +135,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful, } } -#ifndef QT3 m_stop_semaphore.acquire(); -#else - m_stop_semaphore++; -#endif - _success_ful = TRUE; } @@ -179,11 +145,7 @@ audioJACK::audioJACK( const sample_rate_t _sample_rate, bool & _success_ful, audioJACK::~audioJACK() { -#ifndef QT3 m_stop_semaphore.release(); -#else - m_stop_semaphore--; -#endif while( m_portMap.size() ) { @@ -267,11 +229,7 @@ void audioJACK::startProcessing( void ) void audioJACK::stopProcessing( void ) { -#ifndef QT3 m_stop_semaphore.acquire(); -#else - m_stop_semaphore++; -#endif } @@ -288,14 +246,9 @@ void audioJACK::registerPort( audioPort * _port ) for( Uint8 ch = 0; ch < DEFAULT_CHANNELS; ++ch ) { m_portMap[_port].ports[ch] = jack_port_register( m_client, - name[ch]. -#ifdef QT4 - toAscii().constData(), -#else - ascii(), -#endif - JACK_DEFAULT_AUDIO_TYPE, - JackPortIsOutput, 0 ); + name[ch].toAscii().constData(), + JACK_DEFAULT_AUDIO_TYPE, + JackPortIsOutput, 0 ); } #endif } @@ -334,13 +287,7 @@ void audioJACK::renamePort( audioPort * _port ) for( Uint8 ch = 0; ch < DEFAULT_CHANNELS; ++ch ) { jack_port_set_name( m_portMap[_port].ports[ch], - name[ch]. -#ifdef QT4 - toAscii().constData() -#else - ascii() -#endif - ) ; + name[ch].toAscii().constData() ); } } #endif @@ -361,10 +308,10 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata ) jack_transport_state_t ts = jack_transport_query( _this->m_client, NULL ); - vvector outbufs( _this->channels(), + QVector outbufs( _this->channels(), NULL ); Uint8 chnl = 0; - for( vvector::iterator it = + for( QVector::iterator it = outbufs.begin(); it != outbufs.end(); ++it, ++chnl ) { *it = (jack_default_audio_sample_t *) jack_port_get_buffer( @@ -424,11 +371,7 @@ int audioJACK::processCallback( jack_nframes_t _nframes, void * _udata ) if( !_this->m_framesToDoInCurBuf ) { _this->m_stopped = TRUE; -#ifndef QT3 _this->m_stop_semaphore.release(); -#else - _this->m_stop_semaphore--; -#endif } _this->m_framesDoneInCurBuf = 0; } diff --git a/src/audio/audio_oss.cpp b/src/audio/audio_oss.cpp index 7ae9c12a3..654926532 100644 --- a/src/audio/audio_oss.cpp +++ b/src/audio/audio_oss.cpp @@ -30,23 +30,10 @@ #ifdef OSS_SUPPORT -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - - #include "endian_handling.h" #include "lcd_spinbox.h" #include "gui_templates.h" @@ -102,13 +89,7 @@ audioOSS::audioOSS( const sample_rate_t _sample_rate, bool & _success_ful, { _success_ful = FALSE; - m_audioFD = open( -#ifdef QT4 - probeDevice().toAscii().constData(), -#else - probeDevice().ascii(), -#endif - O_WRONLY, 0 ); + m_audioFD = open( probeDevice().toAscii().constData(), O_WRONLY, 0 ); if( m_audioFD == -1 ) { @@ -286,15 +267,7 @@ void audioOSS::startProcessing( void ) { if( !isRunning() ) { - start( -#ifdef QT4 - QThread::HighPriority -#else -#if QT_VERSION >= 0x030505 - QThread::HighestPriority -#endif -#endif - ); + start( QThread::HighPriority ); } } diff --git a/src/core/about_dialog.cpp b/src/core/about_dialog.cpp index 0ea952235..d71827578 100644 --- a/src/core/about_dialog.cpp +++ b/src/core/about_dialog.cpp @@ -25,25 +25,12 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - #ifdef HAVE_CONFIG_H #include diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index 1fdb36b50..85198c1fe 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -26,21 +26,9 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include -#include - -#endif - #include "arp_and_chords_tab_widget.h" #include "combobox.h" @@ -208,10 +196,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( for( int i = 0; s_chords[i].interval[0] != -1; ++i ) { m_chordsComboBox->addItem( tr( s_chords[i].name -#ifdef QT4 - .toAscii().constData() -#endif - ) ); + .toAscii().constData() ) ); } m_chordRangeKnob = new knob( knobBright_26, m_chordsGroupBox, @@ -223,11 +208,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( m_chordRangeKnob->move( 164, 24 ); m_chordRangeKnob->setHintText( tr( "Chord range:" ) + " ", " " + tr( "octave(s)" ) ); -#ifdef QT4 m_chordRangeKnob->setWhatsThis( -#else - QWhatsThis::add( m_chordRangeKnob, -#endif tr( "Use this knob for setting the chord range in octaves. " "The selected chord will be played within specified " "amount of octaves." ) ); @@ -241,11 +222,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( ARP_GROUPBOX_WIDTH, ARP_GROUPBOX_HEIGHT ); -#ifdef QT4 m_arpGroupBox->setWhatsThis( -#else - QWhatsThis::add( m_arpGroupBox, -#endif tr( "An arpeggio is a type of playing (especially plucked) " "instruments, which makes the music much livelier. " "The strings of such instruments (e.g. harps) are " @@ -262,10 +239,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( for( int i = 0; s_chords[i].interval[0] != -1; ++i ) { m_arpComboBox->addItem( tr( s_chords[i].name -#ifdef QT4 - .toAscii().constData() -#endif - ) ); + .toAscii().constData() ) ); } @@ -278,11 +252,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( m_arpRangeKnob->move( 164, 24 ); m_arpRangeKnob->setHintText( tr( "Arpeggio range:" ) + " ", " " + tr( "octave(s)" ) ); -#ifdef QT4 m_arpRangeKnob->setWhatsThis( -#else - QWhatsThis::add( m_arpRangeKnob, -#endif tr( "Use this knob for setting the arpeggio range in octaves. " "The selected arpeggio will be played within specified " "amount of octaves." ) ); @@ -296,11 +266,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( m_arpTimeKnob->move( 164, 70 ); m_arpTimeKnob->setHintText( tr( "Arpeggio time:" ) + " ", " " + tr( "ms" ) ); -#ifdef QT4 m_arpTimeKnob->setWhatsThis( -#else - QWhatsThis::add( m_arpTimeKnob, -#endif tr( "Use this knob for setting the arpeggio time in " "milliseconds. The arpeggio time specifies how long " "each arpeggio-tone should be played." ) ); @@ -313,11 +279,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( m_arpGateKnob->setInitValue( 100.0f ); m_arpGateKnob->move( 204, 70 ); m_arpGateKnob->setHintText( tr( "Arpeggio gate:" ) + " ", tr( "%" ) ); -#ifdef QT4 m_arpGateKnob->setWhatsThis( -#else - QWhatsThis::add( m_arpGateKnob, -#endif tr( "Use this knob for setting the arpeggio gate. The " "arpeggio gate specifies the percent of a whole " "arpeggio-tone that should be played. With this you " @@ -334,9 +296,6 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( arp_up_btn->move( 10, 74 ); arp_up_btn->setActiveGraphic( embed::getIconPixmap( "arp_up_on" ) ); arp_up_btn->setInactiveGraphic( embed::getIconPixmap( "arp_up_off" ) ); -#ifdef QT3 - arp_up_btn->setBackgroundMode( Qt::PaletteBackground ); -#endif toolTip::add( arp_up_btn, tr( "arpeggio direction = up" ) ); @@ -346,9 +305,6 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( arp_down_btn->setActiveGraphic( embed::getIconPixmap( "arp_down_on" ) ); arp_down_btn->setInactiveGraphic( embed::getIconPixmap( "arp_down_off" ) ); -#ifdef QT3 - arp_down_btn->setBackgroundMode( Qt::PaletteBackground ); -#endif toolTip::add( arp_down_btn, tr( "arpeggio direction = down" ) ); @@ -359,9 +315,6 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( "arp_up_and_down_on" ) ); arp_up_and_down_btn->setInactiveGraphic( embed::getIconPixmap( "arp_up_and_down_off" ) ); -#ifdef QT3 - arp_up_and_down_btn->setBackgroundMode( Qt::PaletteBackground ); -#endif toolTip::add( arp_up_and_down_btn, tr( "arpeggio direction = up and down" ) ); @@ -373,9 +326,6 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( "arp_random_on" ) ); arp_random_btn->setInactiveGraphic( embed::getIconPixmap( "arp_random_off" ) ); -#ifdef QT3 - arp_random_btn->setBackgroundMode( Qt::PaletteBackground ); -#endif toolTip::add( arp_random_btn, tr( "arpeggio direction = random" ) ); m_arpDirectionBtnGrp = new automatableButtonGroup( this, diff --git a/src/core/automation_editor.cpp b/src/core/automation_editor.cpp index 2b7a6fda3..495945072 100644 --- a/src/core/automation_editor.cpp +++ b/src/core/automation_editor.cpp @@ -26,10 +26,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -38,20 +34,7 @@ #include #include #include - -#else - -#include -#include -#include -#include -#include -#include - -#define addButton insert -#define setCheckable setToggleButton - -#endif +#include #ifndef __USE_XOPEN @@ -127,10 +110,8 @@ automationEditor::automationEditor( void ) : "edit_move" ) ); } -#ifdef QT4 // add us to workspace engine::getMainWindow()->workspace()->addWindow( this ); -#endif // add time-line m_timeLine = new timeLine( VALUES_WIDTH, 32, m_ppt, @@ -146,16 +127,11 @@ automationEditor::automationEditor( void ) : m_toolBar = new QWidget( this ); m_toolBar->setFixedHeight( 32 ); m_toolBar->move( 0, 0 ); -#ifdef QT4 m_toolBar->setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( m_toolBar->backgroundRole(), embed::getIconPixmap( "toolbar_bg" ) ); m_toolBar->setPalette( pal ); -#else - m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap( - "toolbar_bg" ) ); -#endif QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar ); tb_layout->setMargin( 0 ); @@ -172,19 +148,11 @@ automationEditor::automationEditor( void ) : tr( "Stop playing of current pattern (Space)" ), this, SLOT( stop() ), m_toolBar ); -#ifdef QT4 m_playButton->setWhatsThis( -#else - QWhatsThis::add( m_playButton, -#endif tr( "Click here, if you want to play the current pattern. " "This is useful while editing it. The pattern is " "automatically looped when its end is reached." ) ); -#ifdef QT4 m_stopButton->setWhatsThis( -#else - QWhatsThis::add( m_stopButton, -#endif tr( "Click here, if you want to stop playing of current " "pattern." ) ); @@ -233,43 +201,24 @@ automationEditor::automationEditor( void ) : tool_button_group->addButton( m_selectButton ); tool_button_group->addButton( m_moveButton ); tool_button_group->setExclusive( TRUE ); -#ifndef QT4 - tool_button_group->hide(); -#endif -#ifdef QT4 m_drawButton->setWhatsThis( -#else - QWhatsThis::add( m_drawButton, -#endif tr( "If you click here, draw-mode will be activated. In this " "mode you can add and move single values. This " "is the default-mode which is used most of the time. " "You can also press 'Shift+D' on your keyboard to " "activate this mode." ) ); -#ifdef QT4 m_eraseButton->setWhatsThis( -#else - QWhatsThis::add( m_eraseButton, -#endif tr( "If you click here, erase-mode will be activated. In this " "mode you can erase single values. You can also press " "'Shift+E' on your keyboard to activate this mode." ) ); -#ifdef QT4 m_selectButton->setWhatsThis( -#else - QWhatsThis::add( m_selectButton, -#endif tr( "If you click here, select-mode will be activated. In this " "mode you can select values. This is neccessary " "if you want to cut, copy, paste, delete or move " "values. You can also press 'Shift+S' on your keyboard " "to activate this mode." ) ); -#ifdef QT4 m_moveButton->setWhatsThis( -#else - QWhatsThis::add( m_moveButton, -#endif tr( "If you click here, move-mode will be activated. In this " "mode you can move the values you selected in select-" "mode. You can also press 'Shift+M' on your keyboard " @@ -291,27 +240,15 @@ automationEditor::automationEditor( void ) : this, SLOT( pasteValues() ), m_toolBar ); -#ifdef QT4 m_cutButton->setWhatsThis( -#else - QWhatsThis::add( m_cutButton, -#endif tr( "If you click here, selected values will be cut into the " "clipboard. You can paste them anywhere in any pattern " "by clicking on the paste-button." ) ); -#ifdef QT4 m_copyButton->setWhatsThis( -#else - QWhatsThis::add( m_copyButton, -#endif tr( "If you click here, selected values will be copied into " "the clipboard. You can paste them anywhere in any " "pattern by clicking on the paste-button." ) ); -#ifdef QT4 m_pasteButton->setWhatsThis( -#else - QWhatsThis::add( m_pasteButton, -#endif tr( "If you click here, the values from the clipboard will be " "pasted at the first visible tact." ) ); @@ -393,9 +330,6 @@ automationEditor::automationEditor( void ) : resize( INITIAL_WIDTH, INITIAL_HEIGHT ); setCurrentPattern( NULL ); -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif setMouseTracking( TRUE ); hide(); @@ -439,11 +373,7 @@ void automationEditor::setCurrentPattern( automationPattern * _new_pattern ) for( timeMap::iterator it = time_map.begin(); it != time_map.end(); ++it ) { -#ifdef QT3 - central_key += it.data(); -#else central_key += it.value(); -#endif ++total_values; } @@ -679,11 +609,7 @@ void automationEditor::updatePaintPixmap( QPixmap & _p ) --it; Sint32 len_tact_64th = 4; -#ifdef QT3 - const int level = it.data(); -#else const int level = it.value(); -#endif Sint32 pos_tact_64th = -it.key(); @@ -813,12 +739,8 @@ void automationEditor::updatePaintPixmap( QPixmap & _p ) // reset scroll-range m_leftRightScroll->setRange( 0, l ); -#ifdef QT4 m_leftRightScroll->setSingleStep( 1 ); m_leftRightScroll->setPageStep( l ); -#else - m_leftRightScroll->setSteps( 1, l ); -#endif } @@ -1048,11 +970,7 @@ void automationEditor::mousePressEvent( QMouseEvent * _me ) if( pos_tact_64th >= -it.key() && len > 0 && pos_tact_64th <= -it.key() + len && -#ifdef QT3 - it.data() == level ) -#else it.value() == level ) -#endif { break; } @@ -1187,13 +1105,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me ) } x -= VALUES_WIDTH; - if( -#ifdef QT4 - _me->buttons() & -#else - _me->state() == -#endif - Qt::LeftButton && m_editMode == DRAW ) + if( _me->buttons() & Qt::LeftButton && m_editMode == DRAW ) { if( m_action == MOVE_VALUE ) { @@ -1221,13 +1133,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me ) engine::getSongEditor()->setModified(); } - else if( -#ifdef QT4 - _me->buttons() & -#else - _me->state() == -#endif - Qt::NoButton && m_editMode == DRAW ) + else if( _me->buttons() & Qt::NoButton && m_editMode == DRAW ) { // set move- or resize-cursor @@ -1249,12 +1155,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me ) if( pos_tact_64th >= -it.key() && pos_tact_64th <= -it.key() + //TODO: Add constant - 4 && -#ifdef QT3 - it.data() == level ) -#else - it.value() == level ) -#endif + 4 && it.value() == level ) { break; } @@ -1295,13 +1196,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me ) } } } - else if( -#ifdef QT4 - _me->buttons() & -#else - _me->modifiers() == -#endif - Qt::LeftButton && + else if( _me->buttons() & Qt::LeftButton && m_editMode == SELECT && m_action == SELECT_VALUES ) { @@ -1350,13 +1245,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me ) --m_selectedLevels; } } - else if( -#ifdef QT4 - _me->buttons() & -#else - _me->modifiers() == -#endif - Qt::LeftButton && + else if( _me->buttons() & Qt::LeftButton && m_editMode == MOVE && m_action == MOVE_SELECTION ) { @@ -1452,19 +1341,11 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me ) new_value_pos = midiTime( value_tact, value_tact_64th ); } -#ifdef QT3 - new_selValuesForMove[ - -m_pattern->putValue( new_value_pos, - it.data () + level_diff, - FALSE )] - = it.data() + level_diff; -#else new_selValuesForMove[ -m_pattern->putValue( new_value_pos, it.value () + level_diff, FALSE )] = it.value() + level_diff; -#endif } m_selValuesForMove = new_selValuesForMove; @@ -1474,13 +1355,7 @@ void automationEditor::mouseMoveEvent( QMouseEvent * _me ) } else { - if( -#ifdef QT4 - _me->buttons() & -#else - _me->modifiers() == -#endif - Qt::LeftButton && + if( _me->buttons() & Qt::LeftButton && m_editMode == SELECT && m_action == SELECT_VALUES ) { @@ -1581,14 +1456,7 @@ void automationEditor::paintEvent( QPaintEvent * ) { QPixmap paintPixmap( size() ); updatePaintPixmap( paintPixmap ); -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( size() ); - draw_pm.fill( QColor( 0, 0, 0 ) ); - - QPainter p( &draw_pm, this ); -#endif p.drawPixmap( 0, 0, paintPixmap ); p.setClipRect( VALUES_WIDTH, TOP_MARGIN, width() - VALUES_WIDTH, @@ -1611,10 +1479,6 @@ void automationEditor::paintEvent( QPaintEvent * ) p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ), *cursor ); -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } @@ -1646,12 +1510,8 @@ void automationEditor::resizeEvent( QResizeEvent * ) m_topBottomScroll->setRange( m_scroll_level, m_scroll_level ); } -#ifdef QT4 m_topBottomScroll->setSingleStep( 1 ); m_topBottomScroll->setPageStep( 20 ); -#else - m_topBottomScroll->setSteps( 1, 20 ); -#endif m_topBottomScroll->setValue( m_scroll_level ); @@ -1915,20 +1775,12 @@ void automationEditor::selectAll( void ) timeMap::iterator it = time_map.begin(); m_selectStartTact64th = 0; m_selectedTact64th = -it.key() + len_tact_64th; -#ifdef QT3 - m_selectStartLevel = it.data(); -#else m_selectStartLevel = it.value(); -#endif m_selectedLevels = 1; while( ++it != time_map.end() ) { -#ifdef QT3 - const int level = it.data(); -#else const int level = it.value(); -#endif if( level < m_selectStartLevel ) { // if we move start-level down, we have to add @@ -1978,11 +1830,7 @@ void automationEditor::getSelectedValues( timeMap & _selected_values ) //TODO: Add constant Sint32 len_tact_64th = 4; -#ifdef QT3 - int level = it.data(); -#else int level = it.value(); -#endif Sint32 pos_tact_64th = -it.key(); if( level >= sel_level_start && level <= sel_level_end && @@ -2009,11 +1857,7 @@ void automationEditor::copySelectedValues( void ) for( timeMap::iterator it = selected_values.begin(); it != selected_values.end(); ++it ) { -#ifdef QT3 - m_valuesToCopy[it.key()] = it.data(); -#else m_valuesToCopy[it.key()] = it.value(); -#endif } textFloat::displayMessage( tr( "Values copied" ), tr( "All selected values were copied to the " @@ -2044,11 +1888,7 @@ void automationEditor::cutSelectedValues( void ) for( timeMap::iterator it = selected_values.begin(); it != selected_values.end(); ++it ) { -#ifdef QT3 - m_valuesToCopy[it.key()] = it.data(); -#else m_valuesToCopy[it.key()] = it.value(); -#endif m_pattern->removeValue( -it.key() ); } } @@ -2073,11 +1913,7 @@ void automationEditor::pasteValues( void ) it != m_valuesToCopy.end(); ++it ) { m_pattern->putValue( -it.key() + m_currentPosition, -#ifdef QT3 - it.data() ); -#else it.value() ); -#endif } // we only have to do the following lines if we pasted at @@ -2247,10 +2083,4 @@ void automationEditor::update( void ) #include "automation_editor.moc" -#ifdef QT3 -#undef addButton -#undef setCheckable -#endif - - #endif diff --git a/src/core/automation_pattern.cpp b/src/core/automation_pattern.cpp index f2761fd68..950e9e8ca 100644 --- a/src/core/automation_pattern.cpp +++ b/src/core/automation_pattern.cpp @@ -26,19 +26,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include -#define value data - -#endif - #include "automation_pattern.h" #include "automation_editor.h" diff --git a/src/core/bb_editor.cpp b/src/core/bb_editor.cpp index eb7c51249..185ae4c8f 100644 --- a/src/core/bb_editor.cpp +++ b/src/core/bb_editor.cpp @@ -25,23 +25,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include - -#endif - #include "bb_editor.h" #include "song_editor.h" @@ -69,16 +57,11 @@ bbEditor::bbEditor( void ) m_toolBar = new QWidget( this ); m_toolBar->setFixedHeight( 32 ); m_toolBar->move( 0, 0 ); -#ifdef QT4 m_toolBar->setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( m_toolBar->backgroundRole(), embed::getIconPixmap( "toolbar_bg" ) ); m_toolBar->setPalette( pal ); -#else - m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap( - "toolbar_bg" ) ); -#endif QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar ); tb_layout->setMargin( 0 ); @@ -121,19 +104,11 @@ bbEditor::bbEditor( void ) m_toolBar ); -#ifdef QT4 m_playButton->setWhatsThis( -#else - QWhatsThis::add( m_playButton, -#endif tr( "Click here, if you want to play the current " "beat/bassline. The beat/bassline is automatically " "looped when its end is reached." ) ); -#ifdef QT4 m_stopButton->setWhatsThis( -#else - QWhatsThis::add( m_stopButton, -#endif tr( "Click here, if you want to stop playing of current " "beat/bassline." ) ); @@ -169,9 +144,9 @@ bbEditor::~bbEditor() -csize bbEditor::currentBB( void ) const +int bbEditor::currentBB( void ) const { - return( static_cast( currentPosition().getTact() ) ); + return( static_cast( currentPosition().getTact() ) ); } @@ -185,25 +160,25 @@ void bbEditor::setCurrentBB( int _bb ) } // first make sure, all channels have a TCO at current BB - createTCOsForBB( static_cast( _bb ) ); + createTCOsForBB( static_cast( _bb ) ); realignTracks(); // now update all track-labels (the current one has to become white, // the others green) - for( csize i = 0; i < numOfBBs(); ++i ) + for( int i = 0; i < numOfBBs(); ++i ) { bbTrack::findBBTrack( i )->trackLabel()->update(); } emit positionChanged( m_currentPosition = midiTime( - static_cast( _bb ), 0 ) ); + static_cast( _bb ), 0 ) ); } -tact bbEditor::lengthOfBB( csize _bb ) +tact bbEditor::lengthOfBB( int _bb ) { midiTime max_length; @@ -255,7 +230,7 @@ bool FASTCALL bbEditor::play( midiTime _start, fpp_t _frames, -csize bbEditor::numOfBBs( void ) const +int bbEditor::numOfBBs( void ) const { return( engine::getSongEditor()->countTracks( track::BB_TRACK ) ); } @@ -263,7 +238,7 @@ csize bbEditor::numOfBBs( void ) const -void bbEditor::removeBB( csize _bb ) +void bbEditor::removeBB( int _bb ) { trackVector tv = tracks(); for( trackVector::iterator it = tv.begin(); it != tv.end(); ++it ) @@ -296,11 +271,11 @@ void bbEditor::updateComboBox( void ) disconnect( m_bbComboBox, SIGNAL( valueChanged( int ) ), this, SLOT( setCurrentBB( int ) ) ); - csize current_bb = currentBB(); + int current_bb = currentBB(); m_bbComboBox->clear(); - for( csize i = 0; i < numOfBBs(); ++i ) + for( int i = 0; i < numOfBBs(); ++i ) { bbTrack * bbt = bbTrack::findBBTrack( i ); m_bbComboBox->addItem( bbt->trackLabel()->text(), @@ -451,7 +426,7 @@ void bbEditor::loadSettings( const QDomElement & _this ) void bbEditor::updateAfterTrackAdd( void ) { // make sure, new track(s) have TCOs for every beat/bassline - for( csize i = 0; i < tMax( 1, numOfBBs() ); ++i ) + for( int i = 0; i < tMax( 1, numOfBBs() ); ++i ) { createTCOsForBB( i ); } @@ -460,7 +435,7 @@ void bbEditor::updateAfterTrackAdd( void ) -void bbEditor::createTCOsForBB( csize _bb ) +void bbEditor::createTCOsForBB( int _bb ) { if( numOfBBs() == 0 ) { @@ -484,7 +459,7 @@ void bbEditor::createTCOsForBB( csize _bb ) -void bbEditor::swapBB( csize _bb1, csize _bb2 ) +void bbEditor::swapBB( int _bb1, int _bb2 ) { trackVector tv = tracks(); for( trackVector::iterator it = tv.begin(); it != tv.end(); ++it ) diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index 76037bd20..13aad1c16 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -29,10 +29,6 @@ #include #endif -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -46,34 +42,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define absolutePath absPath -#define addButton insert - -#ifndef __USE_XOPEN_EXTENDED -#define __USE_XOPEN_EXTENDED -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#endif - #include "config_mgr.h" #include "embed.h" @@ -81,29 +49,11 @@ -void mkPath( const QString & _path ) +inline void mkPath( const QString & _path ) { -#ifdef QT4 +#warning TODO: directly integrate // simple clean solution with Qt4... QDir().mkpath( _path ); -#else - // ...but Qt3 needs additional code... - QDir d( _path ); - vlist dirs; - dirs.push_front( _path ); - QString dir = _path; - while( !QDir( dir ).exists() ) - { - dir = dir.section( '/', 0, -2 ); - dirs.push_front( dir ); - } - while( !dirs.isEmpty() ) - { - d.mkdir( dirs.front() ); - d.setPath( dirs.front() ); - dirs.erase( dirs.begin() ); - } -#endif } @@ -160,25 +110,11 @@ configManager::configManager( void ) : QDialog(), m_lmmsRcFile( QDir::home().absolutePath() + "/.lmmsrc.xml" ), m_workingDir( QDir::home().absolutePath() + "/lmms" ), -#if QT_VERSION >= 0x030200 m_dataDir( qApp->applicationDirPath().section( '/', 0, -2 ) + "/share/lmms/" ), -#else - // hardcode since qt < 3.2 doesn't know something like - // applicationDirPath and implementing own function would be senseless - // since real support for qt < 3.2 is senseless too ;-) - m_dataDir( "/usr/share/lmms/" ), -#endif m_artworkDir( defaultArtworkDir() ), -#if QT_VERSION >= 0x030200 m_pluginDir( qApp->applicationDirPath().section( '/', 0, -2 ) + "/lib/lmms/" ), -#else - // hardcode since qt < 3.2 doesn't know something like - // applicationDirPath and implementing own function would be senseless - // since real support for qt < 3.2 is senseless too ;-) - m_pluginDir( "/usr/lib/lmms" ), -#endif m_vstDir( QDir::home().absolutePath() ), m_flDir( QDir::home().absolutePath() ), m_currentPage( 0 ), @@ -203,18 +139,14 @@ void configManager::createWidgets( void ) m_mainLayout->setMargin( 0 ); m_mainLayout->setSpacing( 10 ); m_mainLayout->addSpacing( 8 ); -#ifdef QT4 setLayout( m_mainLayout ); -#endif m_contentWidget = new QWidget( this ); m_contentLayout = new QVBoxLayout( m_contentWidget ); m_contentLayout->setMargin( 0 ); m_contentLayout->setSpacing( 10 ); m_contentLayout->addSpacing( 8 ); -#ifdef QT4 m_contentWidget->setLayout( m_contentLayout ); -#endif m_mainLayout->addWidget( m_contentWidget ); m_mainLayout->addSpacing( 8 ); @@ -235,9 +167,7 @@ void configManager::createWidgets( void ) m_buttonLayout->setMargin( 0 ); m_buttonLayout->setSpacing( 0 ); m_buttonLayout->addStretch( 1 ); -#ifdef QT4 button_widget->setLayout( m_buttonLayout ); -#endif m_cancelButton = new QPushButton( tr( "&Cancel" ), button_widget ); m_backButton = new QPushButton( tr( "< &Back" ), button_widget ); @@ -270,9 +200,7 @@ void configManager::createWidgets( void ) QHBoxLayout * intro_layout = new QHBoxLayout( m_pageIntro ); intro_layout->setMargin( 0 ); intro_layout->setSpacing( 15 ); -#ifdef QT4 m_pageIntro->setLayout( intro_layout ); -#endif QLabel * intro_logo_lbl = new QLabel( m_pageIntro ); intro_logo_lbl->setPixmap( embed::getIconPixmap( "wizard_intro" ) ); @@ -292,11 +220,7 @@ void configManager::createWidgets( void ) "Now click on 'Next' to get to " "the next page." ), m_pageIntro ); -#ifdef QT4 intro_txt_lbl->setWordWrap( TRUE ); -#else - intro_txt_lbl->setAlignment( intro_txt_lbl->alignment() | WordBreak ); -#endif intro_layout->addWidget( intro_logo_lbl ); intro_layout->addWidget( intro_txt_lbl ); @@ -326,12 +250,7 @@ void configManager::createWidgets( void ) "projects, presets, samples etc.\n\n\n" "Please select a directory:" ), workingdir_content ); -#ifdef QT4 workingdir_txt_lbl->setWordWrap( TRUE ); -#else - workingdir_txt_lbl->setAlignment( workingdir_txt_lbl->alignment() | - WordBreak ); -#endif QWidget * workingdir_input_fields = new QWidget( workingdir_content ); QHBoxLayout * workingdir_input_fields_layout = new QHBoxLayout( @@ -413,7 +332,7 @@ void configManager::createWidgets( void ) samples_txt_lbl->setFixedWidth( 144 ); QButtonGroup * samples_bg = new QButtonGroup( samples_widget ); -#ifndef QT4 +#ifndef qt4 samples_bg->hide(); #endif m_samplesCopyRB = new QRadioButton( tr( "copy" ), samples_widget ); @@ -509,7 +428,7 @@ void configManager::createWidgets( void ) addPage( m_pageIntro, tr( "Welcome to LMMS" ) ); addPage( m_pageWorkingDir, tr( "Select working directory" ) ); //addPage( m_pageFiles, tr( "Copy or link files" ) ); - switchPage( static_cast( 0 ) ); + switchPage( static_cast( 0 ) ); } @@ -517,15 +436,9 @@ void configManager::createWidgets( void ) void configManager::openWorkingDir( void ) { -#ifdef QT4 QString new_dir = QFileDialog::getExistingDirectory( this, tr( "Choose LMMS working directory" ), m_workingDir ); -#else - QString new_dir = QFileDialog::getExistingDirectory( m_workingDir, 0, 0, - tr( "Choose LMMS working directory" ), - TRUE ); -#endif if( new_dir != QString::null ) { m_wdLineEdit->setText( new_dir ); @@ -595,12 +508,7 @@ void configManager::accept( void ) } if( !QDir( m_workingDir ).exists() ) { - if( QMessageBox:: -#if QT_VERSION >= 0x030200 - question -#else - information -#endif + if( QMessageBox::question ( 0, tr( "Directory not existing" ), tr( "The directory you " "specified does not " @@ -659,24 +567,12 @@ void configManager::nextButtonClicked( void ) -void configManager::switchPage( csize _pg ) +void configManager::switchPage( int _pg ) { -#ifdef QT4 if( m_currentPage >= 0 && m_currentPage < m_pages.size() ) -#else - if( m_currentPage < m_pages.size() ) -#endif { m_pages[m_currentPage].first->hide(); -#ifdef QT4 m_contentLayout->removeWidget( m_pages[m_currentPage].first ); -#else -#if QT_VERSION >= 0x030100 - m_contentLayout->remove( m_pages[m_currentPage].first ); -#else - m_pages[m_currentPage].first->hide(); -#endif -#endif } if( _pg < m_pages.size() ) { @@ -707,7 +603,7 @@ void configManager::switchPage( csize _pg ) void configManager::switchPage( QWidget * _pg ) { - for( csize i = 0; i < m_pages.size(); ++i ) + for( int i = 0; i < m_pages.size(); ++i ) { if( m_pages[i].first == _pg ) { @@ -731,16 +627,10 @@ void configManager::addPage( QWidget * _w, const QString & _title ) void configManager::addRecentlyOpenedProject( const QString & _file ) { + m_recentlyOpenedProjects.removeAll( _file ); if( m_recentlyOpenedProjects.size() > 15 ) { - m_recentlyOpenedProjects.remove( - m_recentlyOpenedProjects.last() ); - } - QStringList::iterator it; - while( ( it = m_recentlyOpenedProjects.find( _file ) ) != - m_recentlyOpenedProjects.end() ) - { - m_recentlyOpenedProjects.remove( it ); + m_recentlyOpenedProjects.removeLast(); } m_recentlyOpenedProjects.push_front( _file ); } @@ -802,17 +692,9 @@ bool configManager::loadConfigFile( void ) // read the XML file and create DOM tree QFile cfg_file( m_lmmsRcFile ); -#ifdef QT4 if( !cfg_file.open( QIODevice::ReadOnly ) ) -#else - if( !cfg_file.open( IO_ReadOnly ) ) -#endif { -#ifdef QT4 if( !( exec() && cfg_file.open( QIODevice::ReadOnly ) ) ) -#else - if( !( exec() && cfg_file.open( IO_ReadOnly ) ) ) -#endif { return( FALSE ); } @@ -852,7 +734,7 @@ bool configManager::loadConfigFile( void ) stringPairVector attr; QDomNamedNodeMap node_attr = node.toElement().attributes(); - for( csize i = 0; i < node_attr.count(); ++i ) + for( int i = 0; i < node_attr.count(); ++i ) { QDomNode n = node_attr.item( i ); if( n.isAttr() ) @@ -934,12 +816,7 @@ bool configManager::loadConfigFile( void ) QString cfg_file_ver = root.toElement().attribute( "version" ); if( ( cfg_file_ver.length() == 0 || cfg_file_ver != VERSION ) && value( "app", "nowizard" ).toInt() == FALSE && - QMessageBox:: -#if QT_VERSION >= 0x030200 - question -#else - information -#endif + QMessageBox::question ( 0, tr( "Version mismatches" ), tr( "Accordingly to the information in " "your LMMS-configuration-file " @@ -1011,18 +888,10 @@ void configManager::saveConfigFile( void ) } lmms_config.appendChild( recent_files ); -#if QT_VERSION >= 0x030100 QString xml = "\n" + doc.toString( 2 ); -#else - QString xml = "\n" + doc.toString(); -#endif QFile outfile( m_lmmsRcFile ); -#ifdef QT4 if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) ) -#else - if( !outfile.open( IO_WriteOnly | IO_Truncate ) ) -#endif { QMessageBox::critical( NULL, tr( "Could not save config-file" ), tr( "Could not save configuration " @@ -1036,12 +905,7 @@ void configManager::saveConfigFile( void ) return; } -#ifdef QT4 outfile.write( xml.toUtf8().constData(), xml.length() ); -#else - QCString xml_utf8 = xml.utf8(); - outfile.writeBlock( xml_utf8.data(), xml_utf8.length() ); -#endif outfile.close(); } diff --git a/src/core/effect_control_dialog.cpp b/src/core/effect_control_dialog.cpp index 910a97a8b..42f17f664 100644 --- a/src/core/effect_control_dialog.cpp +++ b/src/core/effect_control_dialog.cpp @@ -26,29 +26,15 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include - -#endif - #include "effect_control_dialog.h" #include "effect.h" effectControlDialog::effectControlDialog( QWidget * _parent, effect * _eff ) : - QWidget( _parent -#ifdef QT3 - , "effectControlDialog" -#endif - ), + QWidget( _parent ), m_effect( _eff ) { setWindowTitle( m_effect->publicName() ); diff --git a/src/core/effect_select_dialog.cpp b/src/core/effect_select_dialog.cpp index 4d5794c8a..84858609e 100644 --- a/src/core/effect_select_dialog.cpp +++ b/src/core/effect_select_dialog.cpp @@ -25,24 +25,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "effect_select_dialog.h" #include "gui_templates.h" @@ -166,7 +153,7 @@ effectList::effectList( QWidget * _parent ) : { plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors ); - for( vvector::iterator it = + for( QVector::iterator it = m_pluginDescriptors.begin(); it != m_pluginDescriptors.end(); ++it ) { @@ -207,26 +194,14 @@ effectList::effectList( QWidget * _parent ) : m_pluginList->insertStringList( plugin_names ); connect( m_pluginList, SIGNAL( highlighted( int ) ), SLOT( onHighlighted( int ) ) ); - connect( m_pluginList, SIGNAL( doubleClicked( QListBoxItem * ) ), - SLOT( onDoubleClicked( QListBoxItem * ) ) ); + connect( m_pluginList, SIGNAL( doubleClicked( Q3ListBoxItem * ) ), + SLOT( onDoubleClicked( Q3ListBoxItem * ) ) ); -#ifndef QT3 QGroupBox * groupbox = new QGroupBox( tr( "Description" ), this ); -#else - QGroupBox * groupbox = new QGroupBox( 1, Qt::Vertical, - tr( "Description" ), this ); -#endif groupbox->setFixedHeight( 200 ); -#ifdef QT3 - groupbox->setInsideMargin( 2 ); -#endif QScrollArea * scrollArea = new QScrollArea( groupbox ); scrollArea->setFrameStyle( 0 ); -#ifdef QT3 - scrollArea->setMargin( 10 ); -#endif -#ifndef QT3 m_descriptionWidget = new QWidget; QVBoxLayout * l = new QVBoxLayout( m_descriptionWidget ); l->setMargin( 0 ); @@ -235,10 +210,6 @@ effectList::effectList( QWidget * _parent ) : scrollArea->setWidget( m_descriptionWidget ); m_descriptionWidget->show(); m_descriptionWidget->setFixedSize( 200, 200 ); -#else - m_descriptionWidget = new QVBox( scrollArea->viewport() ); - scrollArea->addChild( m_descriptionWidget ); -#endif QVBoxLayout * vboxl = new QVBoxLayout( this ); vboxl->setMargin( 0 ); @@ -265,19 +236,11 @@ effectList::~effectList() void effectList::onHighlighted( int _pluginIndex ) { -#ifndef QT3 QLayoutItem * i; while( ( i = m_descriptionWidget->layout() ) != 0 ) { delete i; } -#else - QLayoutIterator it = m_descriptionWidget->layout()->iterator(); - while( it.current() ) - { - it.deleteCurrent(); - } -#endif m_descriptionWidget->hide(); m_currentSelection = m_effectKeys[_pluginIndex]; @@ -295,7 +258,7 @@ void effectList::onHighlighted( int _pluginIndex ) -void effectList::onDoubleClicked( QListBoxItem * _item ) +void effectList::onDoubleClicked( Q3ListBoxItem * _item ) { emit( doubleClicked( m_currentSelection ) ); } diff --git a/src/core/effect_tab_widget.cpp b/src/core/effect_tab_widget.cpp index a9a1f9ab1..2fb3498d3 100644 --- a/src/core/effect_tab_widget.cpp +++ b/src/core/effect_tab_widget.cpp @@ -26,23 +26,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include - -#endif - #include "effect_tab_widget.h" #include "instrument_track.h" diff --git a/src/core/engine.cpp b/src/core/engine.cpp index d5efa4559..6984f8b2a 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -137,9 +137,9 @@ void engine::updateFramesPerTact64th( void ) void engine::load_extensions( void ) { - vvector pluginDescriptors; + QVector pluginDescriptors; plugin::getDescriptorsOfAvailPlugins( pluginDescriptors ); - for( vvector::iterator it = + for( QVector::iterator it = pluginDescriptors.begin(); it != pluginDescriptors.end(); ++it ) { diff --git a/src/core/envelope_and_lfo_widget.cpp b/src/core/envelope_and_lfo_widget.cpp index 6525c3af4..c8fc97546 100644 --- a/src/core/envelope_and_lfo_widget.cpp +++ b/src/core/envelope_and_lfo_widget.cpp @@ -26,25 +26,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include -#include - -#endif - #include "envelope_and_lfo_widget.h" #include "song_editor.h" @@ -101,7 +87,7 @@ const int LFO_SHAPES_Y = LFO_GRAPH_Y + 50; QPixmap * envelopeAndLFOWidget::s_envGraph = NULL; QPixmap * envelopeAndLFOWidget::s_lfoGraph = NULL; -vvector envelopeAndLFOWidget::s_EaLWidgets; +QVector envelopeAndLFOWidget::s_EaLWidgets; @@ -109,11 +95,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, QWidget * _parent, track * _track ) : QWidget( _parent ), -#ifdef QT4 specialBgHandlingWidget( palette().color( backgroundRole() ) ), -#else - specialBgHandlingWidget( paletteBackgroundColor() ), -#endif m_used( FALSE ), m_valueForZeroAmount( _value_for_zero_amount ), m_pahdEnv( NULL ), @@ -143,11 +125,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_predelayKnob->setInitValue( 0.0 ); m_predelayKnob->move( PREDELAY_KNOB_X, ENV_KNOBS_Y ); m_predelayKnob->setHintText( tr( "Predelay:" ) + " ", "" ); -#ifdef QT4 m_predelayKnob->setWhatsThis( -#else - QWhatsThis::add( m_predelayKnob, -#endif tr( "Use this knob for setting predelay of the current " "envelope. The bigger this value the longer the time " "before start of actual envelope." ) ); @@ -161,11 +139,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_attackKnob->setInitValue( 0.0 ); m_attackKnob->move( ATTACK_KNOB_X, ENV_KNOBS_Y ); m_attackKnob->setHintText( tr( "Attack:" )+" ", "" ); -#ifdef QT4 m_attackKnob->setWhatsThis( -#else - QWhatsThis::add( m_attackKnob, -#endif tr( "Use this knob for setting attack-time of the current " "envelope. The bigger this value the longer the " "envelope needs to increase to attack-level. " @@ -180,11 +154,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_holdKnob->setInitValue( 0.5 ); m_holdKnob->move( HOLD_KNOB_X, ENV_KNOBS_Y ); m_holdKnob->setHintText( tr( "Hold:" ) + " ", "" ); -#ifdef QT4 m_holdKnob->setWhatsThis( -#else - QWhatsThis::add( m_holdKnob, -#endif tr( "Use this knob for setting hold-time of the current " "envelope. The bigger this value the longer the " "envelope holds attack-level before it begins to " @@ -199,11 +169,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_decayKnob->setInitValue( 0.5 ); m_decayKnob->move( DECAY_KNOB_X, ENV_KNOBS_Y ); m_decayKnob->setHintText( tr( "Decay:" ) + " ", "" ); -#ifdef QT4 m_decayKnob->setWhatsThis( -#else - QWhatsThis::add( m_decayKnob, -#endif tr( "Use this knob for setting decay-time of the current " "envelope. The bigger this value the longer the " "envelope needs to decrease from attack-level to " @@ -219,11 +185,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_sustainKnob->setInitValue( 0.5 ); m_sustainKnob->move( SUSTAIN_KNOB_X, ENV_KNOBS_Y ); m_sustainKnob->setHintText( tr( "Sustain:" ) + " ", "" ); -#ifdef QT4 m_sustainKnob->setWhatsThis( -#else - QWhatsThis::add( m_sustainKnob, -#endif tr( "Use this knob for setting sustain-level of the current " "envelope. The bigger this value the higher the level " "on which the envelope stays before going down to " @@ -238,11 +200,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_releaseKnob->setInitValue( 0.1 ); m_releaseKnob->move( RELEASE_KNOB_X, ENV_KNOBS_Y ); m_releaseKnob->setHintText( tr( "Release:" ) + " ", "" ); -#ifdef QT4 m_releaseKnob->setWhatsThis( -#else - QWhatsThis::add( m_releaseKnob, -#endif tr( "Use this knob for setting release-time of the current " "envelope. The bigger this value the longer the " "envelope needs to decrease from sustain-level to " @@ -259,11 +217,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_amountKnob->setInitValue( 0.0 ); m_amountKnob->move( AMOUNT_KNOB_X, ENV_GRAPH_Y ); m_amountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" ); -#ifdef QT4 m_amountKnob->setWhatsThis( -#else - QWhatsThis::add( m_amountKnob, -#endif tr( "Use this knob for setting modulation amount of the " "current envelope. The bigger this value the more the " "according size (e.g. volume or cutoff-frequency) " @@ -281,11 +235,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_lfoPredelayKnob->setInitValue( 0.0 ); m_lfoPredelayKnob->move( LFO_PREDELAY_KNOB_X, LFO_KNOB_Y ); m_lfoPredelayKnob->setHintText( tr( "LFO-predelay:" ) + " ", "" ); -#ifdef QT4 m_lfoPredelayKnob->setWhatsThis( -#else - QWhatsThis::add( m_lfoPredelayKnob, -#endif tr( "Use this knob for setting predelay-time of the current " "LFO. The bigger this value the the time until the " "LFO starts to oscillate." ) ); @@ -300,11 +250,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_lfoAttackKnob->setInitValue( 0.0 ); m_lfoAttackKnob->move( LFO_ATTACK_KNOB_X, LFO_KNOB_Y ); m_lfoAttackKnob->setHintText( tr( "LFO-attack:" ) + " ", "" ); -#ifdef QT4 m_lfoAttackKnob->setWhatsThis( -#else - QWhatsThis::add( m_lfoAttackKnob, -#endif tr( "Use this knob for setting attack-time of the current LFO. " "The bigger this value the longer the LFO needs to " "increase its amplitude to maximum." ) ); @@ -319,11 +265,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_lfoSpeedKnob->setInitValue( 0.1 ); m_lfoSpeedKnob->move( LFO_SPEED_KNOB_X, LFO_KNOB_Y ); m_lfoSpeedKnob->setHintText( tr( "LFO-speed:" ) + " ", "" ); -#ifdef QT4 m_lfoSpeedKnob->setWhatsThis( -#else - QWhatsThis::add( m_lfoSpeedKnob, -#endif tr( "Use this knob for setting speed of the current LFO. The " "bigger this value the faster the LFO oscillates and " "the faster will be your effect." ) ); @@ -338,11 +280,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_lfoAmountKnob->setInitValue( 0.0 ); m_lfoAmountKnob->move( LFO_AMOUNT_KNOB_X, LFO_KNOB_Y ); m_lfoAmountKnob->setHintText( tr( "Modulation amount:" ) + " ", "" ); -#ifdef QT4 m_lfoAmountKnob->setWhatsThis( -#else - QWhatsThis::add( m_lfoAmountKnob, -#endif tr( "Use this knob for setting modulation amount of the " "current LFO. The bigger this value the more the " "selected size (e.g. volume or cutoff-frequency) will " @@ -357,11 +295,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, "sin_wave_active" ) ); sin_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "sin_wave_inactive" ) ); -#ifdef QT4 sin_lfo_btn->setWhatsThis( -#else - QWhatsThis::add( sin_lfo_btn, -#endif tr( "Click here if you want a sine-wave for current " "oscillator." ) ); @@ -371,11 +305,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, "triangle_wave_active" ) ); triangle_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "triangle_wave_inactive" ) ); -#ifdef QT4 triangle_lfo_btn->setWhatsThis( -#else - QWhatsThis::add( triangle_lfo_btn, -#endif tr( "Click here if you want a triangle-wave for current " "oscillator." ) ); @@ -385,11 +315,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, "saw_wave_active" ) ); saw_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "saw_wave_inactive" ) ); -#ifdef QT4 saw_lfo_btn->setWhatsThis( -#else - QWhatsThis::add( saw_lfo_btn, -#endif tr( "Click here if you want a saw-wave for current " "oscillator." ) ); @@ -399,11 +325,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, "square_wave_active" ) ); sqr_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "square_wave_inactive" ) ); -#ifdef QT4 sqr_lfo_btn->setWhatsThis( -#else - QWhatsThis::add( sqr_lfo_btn, -#endif tr( "Click here if you want a square-wave for current " "oscillator." ) ); @@ -413,11 +335,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, "usr_wave_active" ) ); m_userLfoBtn->setInactiveGraphic( embed::getIconPixmap( "usr_wave_inactive" ) ); -#ifdef QT4 m_userLfoBtn->setWhatsThis( -#else - QWhatsThis::add( m_userLfoBtn, -#endif tr( "Click here if you want a user-defined wave for current " "oscillator. Afterwards drag an according sample-" "file into LFO-graph." ) ); @@ -442,11 +360,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, tr( "Freq x 100" ), _track ); m_x100Cb->setFont( pointSize<6>( m_x100Cb->font() ) ); m_x100Cb->move( LFO_PREDELAY_KNOB_X, LFO_GRAPH_Y + 36 ); -#ifdef QT4 m_x100Cb->setWhatsThis( -#else - QWhatsThis::add( m_x100Cb, -#endif tr( "Click here if the frequency of this LFO should be " "multiplied with 100." ) ); toolTip::add( m_x100Cb, tr( "multiply LFO-frequency with 100" ) ); @@ -460,21 +374,13 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_controlEnvAmountCb->move( LFO_PREDELAY_KNOB_X, LFO_GRAPH_Y + 54 ); m_controlEnvAmountCb->setFont( pointSize<6>( m_controlEnvAmountCb->font() ) ); -#ifdef QT4 m_controlEnvAmountCb ->setWhatsThis( -#else - QWhatsThis::add( m_controlEnvAmountCb, -#endif tr( "Click here to make the envelope-amount controlled by this " "LFO." ) ); toolTip::add( m_controlEnvAmountCb, tr( "control envelope-amount by this LFO" ) ); -#ifndef QT4 - // set background-mode for flicker-free redraw - setBackgroundMode( Qt::NoBackground ); -#endif setAcceptDrops( TRUE ); connect( engine::getMixer(), SIGNAL( sampleRateChanged() ), this, @@ -494,7 +400,7 @@ envelopeAndLFOWidget::~envelopeAndLFOWidget() delete[] m_rEnv; delete[] m_lfoShapeData; - vvector & v = s_EaLWidgets; + QVector & v = s_EaLWidgets; if( qFind( v.begin(), v.end(), this ) != v.end() ) { v.erase( qFind( v.begin(), v.end(), this ) ); @@ -550,8 +456,8 @@ void envelopeAndLFOWidget::updateLFOShapeData( void ) void envelopeAndLFOWidget::triggerLFO( void ) { - vvector & v = s_EaLWidgets; - for( vvector::iterator it = v.begin(); + QVector & v = s_EaLWidgets; + for( QVector::iterator it = v.begin(); it != v.end(); ++it ) { ( *it )->m_lfoFrame += @@ -565,8 +471,8 @@ void envelopeAndLFOWidget::triggerLFO( void ) void envelopeAndLFOWidget::resetLFO( void ) { - vvector & v = s_EaLWidgets; - for( vvector::iterator it = v.begin(); + QVector & v = s_EaLWidgets; + for( QVector::iterator it = v.begin(); it != v.end(); ++it ) { ( *it )->m_lfoFrame = 0; @@ -783,17 +689,8 @@ void envelopeAndLFOWidget::dropEvent( QDropEvent * _de ) void envelopeAndLFOWidget::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); p.setRenderHint( QPainter::Antialiasing ); -#else - // create pixmap for whole widget - QPixmap pm( size() ); - pm.fill( this, rect().topLeft() ); - - // and a painter for it - QPainter p( &pm, this ); -#endif // set smaller font p.setFont( pointSize<6>( p.font() ) ); @@ -886,11 +783,7 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * ) osc_frames *= 100.0f; } -#ifdef QT4 float old_y = 0; -#else - int old_y = 0; -#endif for( int x = 0; x <= LFO_GRAPH_W; ++x ) { float val = 0.0; @@ -924,16 +817,10 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * ) val *= cur_sample / m_lfoAttackFrames; } } -#ifdef QT4 float cur_y = -LFO_GRAPH_H / 2.0f * val; p.drawLine( QLineF( graph_x_base + x - 1, graph_y_base + old_y, graph_x_base + x, graph_y_base + cur_y ) ); -#else - int cur_y = static_cast( -LFO_GRAPH_H / 2.0f * val ); - p.drawLine( graph_x_base + x - 1, graph_y_base + old_y, - graph_x_base + x, graph_y_base + cur_y ); -#endif old_y = cur_y; } @@ -946,10 +833,6 @@ void envelopeAndLFOWidget::paintEvent( QPaintEvent * ) p.drawText( LFO_GRAPH_X + 52, LFO_GRAPH_Y + s_lfoGraph->height() - 6, QString::number( ms_per_osc ) ); -#ifndef QT4 - // blit drawn pixmap to actual widget - bitBlt( this, rect().topLeft(), &pm ); -#endif } diff --git a/src/core/envelope_tab_widget.cpp b/src/core/envelope_tab_widget.cpp index 2c1834c02..ba5dc5665 100644 --- a/src/core/envelope_tab_widget.cpp +++ b/src/core/envelope_tab_widget.cpp @@ -26,19 +26,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include -#include - -#endif - #include "envelope_tab_widget.h" #include "combobox.h" @@ -92,11 +81,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) : TARGETS_TABWIDGET_Y, TARGETS_TABWIDGET_WIDTH, TARGETS_TABWIDGET_HEIGTH ); -#ifdef QT4 m_targetsTabWidget->setWhatsThis( -#else - QWhatsThis::add( m_targetsTabWidget, -#endif tr( "These tabs contain envelopes. They're very important for " "modifying a sound, for not saying that they're almost " "always neccessary for substractive synthesis. For " @@ -124,15 +109,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) : _instrument_track ); m_targetsTabWidget->addTab( m_envLFOWidgets[i], tr( targetNames[i][0] -#ifdef QT4 - .toAscii().constData() -#endif - ) ); -/* -#ifdef QT4 - .toAscii().constData() -#endif - ) );*/ + .toAscii().constData() ) ); } @@ -165,11 +142,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) : m_filterComboBox->addItem( tr( "2x LowPass" ), embed::getIconPixmap( "filter_2lp" ) ); -#ifdef QT4 m_filterComboBox->setWhatsThis( -#else - QWhatsThis::add( m_filterComboBox, -#endif tr( "Here you can select the built-in filter you want to use " "for this instrument-track. Filters are very important " "for changing the characteristics of a sound." ) ); @@ -184,11 +157,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) : m_filterCutKnob->setInitValue( 16000.0 ); m_filterCutKnob->setHintText( tr( "cutoff-frequency:" ) + " ", " " + tr( "Hz" ) ); -#ifdef QT4 m_filterCutKnob->setWhatsThis( -#else - QWhatsThis::add( m_filterCutKnob, -#endif tr( "Use this knob for setting the cutoff-frequency for the " "selected filter. The cutoff-frequency specifies the " "frequency for cutting the signal by a filter. For " @@ -204,11 +173,7 @@ envelopeTabWidget::envelopeTabWidget( instrumentTrack * _instrument_track ) : m_filterResKnob->move( 190, 18 ); m_filterResKnob->setInitValue( 0.5 ); m_filterResKnob->setHintText( tr( "Q/Resonance:" ) + " ", "" ); -#ifdef QT4 m_filterResKnob->setWhatsThis( -#else - QWhatsThis::add( m_filterResKnob, -#endif tr( "Use this knob for setting Q/Resonance for the selected " "filter. Q/Resonance tells the filter, how much it " "should amplify frequencies near Cutoff-frequency." ) ); diff --git a/src/core/export_project_dialog.cpp b/src/core/export_project_dialog.cpp index cf3dae63a..f09cfc2b3 100644 --- a/src/core/export_project_dialog.cpp +++ b/src/core/export_project_dialog.cpp @@ -25,10 +25,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -37,17 +33,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include - -#endif - #include "export_project_dialog.h" #include "song_editor.h" @@ -136,14 +121,9 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name, m_hourglassLbl( NULL ), m_deleteFile( FALSE ) { -#ifdef QT4 m_fileType = getFileTypeFromExtension( "." + QFileInfo( _file_name ).completeSuffix() ); -#else - m_fileType = getFileTypeFromExtension( "." + QFileInfo( _file_name - ).extension() ); -#endif setWindowTitle( tr( "Export project to %1" ).arg( QFileInfo( _file_name ).fileName() ) ); @@ -358,11 +338,7 @@ void exportProjectDialog::exportBtnClicked( void ) m_exportProgressBar = new QProgressBar( this ); m_exportProgressBar->setGeometry( EPB_X, EPB_Y, EPB_WIDTH, EPB_HEIGHT ); -#ifdef QT4 m_exportProgressBar->setMaximum( 100 ); -#else - m_exportProgressBar->setTotalSteps( 100 ); -#endif m_exportProgressBar->show(); m_hourglassLbl = new QLabel( this ); @@ -391,11 +367,7 @@ void exportProjectDialog::exportBtnClicked( void ) int pval = pp * 100 / ( ( engine::getSongEditor()->lengthInTacts() + 1 ) * 64 ); -#ifdef QT4 m_exportProgressBar->setValue( pval ); -#else - m_exportProgressBar->setProgress( pval ); -#endif // update lmms-main-win-caption engine::getMainWindow()->setWindowTitle( tr( "Rendering:" ) + " " + QString::number( pval ) + "%" ); diff --git a/src/core/file_browser.cpp b/src/core/file_browser.cpp index f2a8cf4c0..9b49a5ff9 100644 --- a/src/core/file_browser.cpp +++ b/src/core/file_browser.cpp @@ -26,26 +26,13 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include +class QColorGroup; #include -#else - -#include -#include -#include -#include -#include - -#endif - #include "file_browser.h" #include "bb_editor.h" @@ -78,17 +65,10 @@ fileBrowser::fileBrowser( const QString & _directories, const QString & _filter, m_l = new listView( contentParent() ); addContentWidget( m_l ); -#ifdef QT4 connect( m_l, SIGNAL( contextMenuRequested( Q3ListViewItem *, const QPoint &, int ) ), this, SLOT( contextMenuRequest( Q3ListViewItem *, const QPoint &, int ) ) ); -#else - connect( m_l, SIGNAL( contextMenuRequested( QListViewItem *, - const QPoint &, int ) ), - this, SLOT( contextMenuRequest( QListViewItem *, - const QPoint &, int ) ) ); -#endif QPushButton * reload_btn = new QPushButton( embed::getIconPixmap( @@ -113,21 +93,13 @@ fileBrowser::~fileBrowser() void fileBrowser::reloadTree( void ) { m_l->clear(); -#ifndef QT3 QStringList paths = m_directories.split( '*' ); -#else - QStringList paths = QStringList::split( '*', m_directories ); -#endif for( QStringList::iterator it = paths.begin(); it != paths.end(); ++it ) { addItems( *it ); } -#ifndef QT3 Q3ListViewItem * item = m_l->firstChild(); -#else - QListViewItem * item = m_l->firstChild(); -#endif bool resort = FALSE; // sort merged directories @@ -140,11 +112,7 @@ void fileBrowser::reloadTree( void ) } else if( resort == TRUE ) { -#ifndef QT3 Q3ListViewItem * i2 = m_l->firstChild(); -#else - QListViewItem * i2 = m_l->firstChild(); -#endif d->moveItem( i2 ); i2->moveItem( d ); directory * d2 = NULL; @@ -174,14 +142,15 @@ void fileBrowser::addItems( const QString & _path ) // which makes it possible to travel through the list in reverse // direction - for( csize i = 0; i < files.size(); ++i ) + for( int i = 0; i < files.size(); ++i ) { QString cur_file = files[files.size() - i - 1]; if( cur_file[0] != '.' +#warning TODO: add match here #ifdef QT4 // TBD #else - && QDir::match( m_filter, cur_file.lower() ) +// && QDir::match( m_filter, cur_file.lower() ) #endif ) { @@ -192,18 +161,14 @@ void fileBrowser::addItems( const QString & _path ) } files = cdir.entryList( QDir::Dirs, QDir::Name ); - for( csize i = 0; i < files.size(); ++i ) + for( int i = 0; i < files.size(); ++i ) { QString cur_file = files[files.size() - i - 1]; if( cur_file[0] != '.' && isDirWithContent( _path + QDir::separator() + cur_file, m_filter ) ) { -#ifdef QT4 Q3ListViewItem * item = m_l->findItem( cur_file, 0 ); -#else - QListViewItem * item = m_l->findItem( cur_file, 0 ); -#endif if( item == NULL ) { (void) new directory( m_l, cur_file, _path, @@ -230,10 +195,11 @@ bool fileBrowser::isDirWithContent( const QString & _path, { QString cur_file = *it; if( cur_file[0] != '.' +#warning TODO: add match here #ifdef QT4 // TBD #else - && QDir::match( _filter, cur_file.lower() ) +// && QDir::match( _filter, cur_file.lower() ) #endif ) { @@ -274,11 +240,7 @@ void fileBrowser::keyPressEvent( QKeyEvent * _ke ) -#ifdef QT4 void fileBrowser::contextMenuRequest( Q3ListViewItem * i, const QPoint &, int ) -#else -void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int ) -#endif { fileItem * f = dynamic_cast( i ); if( f != NULL && ( f->type() == fileItem::SAMPLE_FILE || @@ -307,11 +269,7 @@ void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int ) -#ifdef QT4 void fileBrowser::contextMenuRequest( QListViewItem * i, const QPoint &, int ) -#else -void fileBrowser::contextMenuRequest( Q3ListViewItem * i, const QPoint &, int ) -#endif { } @@ -327,11 +285,7 @@ void fileBrowser::sendToActiveInstrumentTrack( void ) // get all windows opened in the workspace QWidgetList pl = engine::getMainWindow()->workspace()->windowList( -#if QT_VERSION >= 0x030200 - QWorkspace::StackingOrder -#endif - ); -#ifdef QT4 + QWorkspace::StackingOrder ); QListIterator w( pl ); w.toBack(); // now we travel through the window-list until we find an @@ -340,14 +294,6 @@ void fileBrowser::sendToActiveInstrumentTrack( void ) { instrumentTrack * ct = dynamic_cast( w.previous() ); -#else - QWidget * w = pl.last(); - // now we travel through the window-list until we find an - // instrument-track - while( w != NULL ) - { - instrumentTrack * ct = dynamic_cast( w ); -#endif if( ct != NULL && ct->isHidden() == FALSE ) { // ok, it's an instrument-track, so we can apply the @@ -378,9 +324,6 @@ void fileBrowser::sendToActiveInstrumentTrack( void ) engine::getMixer()->unlock(); break; } -#ifndef QT4 - w = pl.prev(); -#endif } } @@ -540,11 +483,7 @@ void listView::contentsMousePressEvent( QMouseEvent * _me ) } QPoint p( contentsToViewport( _me->pos() ) ); -#ifndef QT3 Q3ListViewItem * i = itemAt( p ); -#else - QListViewItem * i = itemAt( p ); -#endif if ( i ) { if ( p.x() > header()->cellPos( header()->mapToActual( 0 ) ) + @@ -579,11 +518,7 @@ void listView::contentsMousePressEvent( QMouseEvent * _me ) "preview..." ), embed::getIconPixmap( "sound_file", 24, 24 ), 0 ); -#ifdef QT4 qApp->processEvents( QEventLoop::AllEvents ); -#else - qApp->processEvents(); -#endif samplePlayHandle * s = new samplePlayHandle( f->fullName() ); s->setDoneMayReturnTrue( FALSE ); @@ -699,11 +634,7 @@ QPixmap * directory::s_folderLockedPixmap = NULL; directory::directory( directory * _parent, const QString & _name, const QString & _path, const QString & _filter ) : -#ifndef QT3 Q3ListViewItem( _parent, _name ), -#else - QListViewItem( _parent, _name ), -#endif m_p( _parent ), m_pix( NULL ), m_directories( _path ), @@ -717,11 +648,7 @@ directory::directory( directory * _parent, const QString & _name, directory::directory( Q3ListView * _parent, const QString & _name, const QString & _path, const QString & _filter ) : -#ifndef QT3 Q3ListViewItem( _parent, _name ), -#else - QListViewItem( _parent, _name ), -#endif m_p( NULL ), m_pix( NULL ), m_directories( _path ), @@ -799,21 +726,13 @@ void directory::setOpen( bool _o ) ( *it ).contains( configManager::inst()->dataDir() ) ) { -#ifndef QT3 ( new Q3ListViewItem( this, -#else - ( new QListViewItem( this, -#endif listView::tr( "--- Factory files ---" ) ) )->setPixmap( 0, embed::getIconPixmap( "factory_files" ) ); } } } -#ifndef QT3 Q3ListViewItem::setOpen( _o ); -#else - QListViewItem::setOpen( _o ); -#endif } @@ -822,11 +741,7 @@ void directory::setOpen( bool _o ) void directory::setup( void ) { setExpandable( TRUE ); -#ifndef QT3 Q3ListViewItem::setup(); -#else - QListViewItem::setup(); -#endif } @@ -847,15 +762,11 @@ bool directory::addItems( const QString & _path ) bool added_something = FALSE; QStringList files = thisDir.entryList( QDir::Files, QDir::Name ); - for( csize i = 0; i < files.size(); ++i ) + for( int i = 0; i < files.size(); ++i ) { QString cur_file = files[files.size() - i - 1]; if( cur_file[0] != '.' -#ifdef QT4 && thisDir.match( m_filter, cur_file.toLower() ) -#else - && thisDir.match( m_filter, cur_file.lower() ) -#endif /*QDir::match( FILE_FILTER, cur_file )*/ ) { (void) new fileItem( this, cur_file, _path ); @@ -864,15 +775,11 @@ bool directory::addItems( const QString & _path ) } files = thisDir.entryList( QDir::Dirs, QDir::Name ); - for( csize i = 0; i < files.size(); ++i ) + for( int i = 0; i < files.size(); ++i ) { QString cur_file = files[files.size() - i - 1]; if( cur_file[0] != '.' && fileBrowser::isDirWithContent( -#ifdef QT4 thisDir.absolutePath() + QDir::separator() + -#else - thisDir.absPath() + QDir::separator() + -#endif cur_file, m_filter ) ) { new directory( this, cur_file, _path, m_filter ); @@ -922,11 +829,7 @@ QPixmap * fileItem::s_unknownFilePixmap = NULL; fileItem::fileItem( Q3ListView * _parent, const QString & _name, const QString & _path ) : -#ifndef QT3 Q3ListViewItem( _parent, _name ), -#else - QListViewItem( _parent, _name ), -#endif m_pix( NULL ), m_path( _path ) { @@ -938,15 +841,9 @@ fileItem::fileItem( Q3ListView * _parent, const QString & _name, -#ifndef QT3 fileItem::fileItem( Q3ListViewItem * _parent, const QString & _name, const QString & _path ) : Q3ListViewItem( _parent, _name ), -#else -fileItem::fileItem( QListViewItem * _parent, const QString & _name, - const QString & _path ) : - QListViewItem( _parent, _name ), -#endif m_pix( NULL ), m_path( _path ) { @@ -1072,11 +969,7 @@ QString fileItem::extension( void ) QString fileItem::extension( const QString & _file ) { -#ifdef QT4 return( QFileInfo( _file ).suffix().toLower() ); -#else - return( QFileInfo( _file ).extension( FALSE ).toLower() ); -#endif } diff --git a/src/core/import_filter.cpp b/src/core/import_filter.cpp index e979e7f70..d0eb3b64e 100644 --- a/src/core/import_filter.cpp +++ b/src/core/import_filter.cpp @@ -25,22 +25,13 @@ */ +#include + #include "import_filter.h" #include "engine.h" #include "track_container.h" #include "project_journal.h" -#ifdef QT4 - -#include - -#else - -#include - -#define fileName name - -#endif importFilter::importFilter( const QString & _file_name, @@ -63,24 +54,18 @@ importFilter::~importFilter() void importFilter::import( const QString & _file_to_import, trackContainer * _tc ) { - vvector d; + QVector d; plugin::getDescriptorsOfAvailPlugins( d ); bool successful = FALSE; - char * s = qstrdup( _file_to_import. -#ifndef QT3 - toAscii().constData() -#else - ascii() -#endif - ); + char * s = qstrdup( _file_to_import.toAscii().constData() ); // do not record changes while importing files const bool j = engine::getProjectJournal()->isJournalling(); engine::getProjectJournal()->setJournalling( FALSE ); - for( vvector::iterator it = d.begin(); + for( QVector::iterator it = d.begin(); it != d.end(); ++it ) { if( it->type == plugin::ImportFilter ) @@ -122,11 +107,7 @@ void importFilter::import( const QString & _file_to_import, bool importFilter::openFile( void ) { -#ifdef QT4 if( m_file.open( QFile::ReadOnly ) == FALSE ) -#else - if( m_file.open( IO_ReadOnly ) == FALSE ) -#endif { QMessageBox::critical( NULL, trackContainer::tr( "Couldn't open file" ), diff --git a/src/core/main.cpp b/src/core/main.cpp index e84c7cb03..09788d58f 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -25,26 +25,12 @@ */ -#include "qt3support.h" - -#ifdef QT4 - +#include #include #include #include #include -#else - -#include -#include -#if QT_VERSION >= 0x030200 -#include -#endif -#include - -#endif - #ifdef HAVE_SCHED_H #include #endif @@ -58,13 +44,17 @@ #include "song_editor.h" #include "gui_templates.h" +#warning TODO: move somewhere else +static inline QString baseName( const QString & _file ) +{ + return( QFileInfo( _file ).absolutePath() + "/" + + QFileInfo( _file ).completeBaseName() ); +} QString file_to_render; -#if QT_VERSION >= 0x030100 int splash_alignment_flags = Qt::AlignTop | Qt::AlignLeft; -#endif inline void loadTranslation( const QString & _tname, const QString & _dir = configManager::inst()->localeDir() ) @@ -168,12 +158,7 @@ int main( int argc, char * * argv ) } - QString pos = -#ifdef QT4 - QLocale::system().name().left( 2 ); -#else - QString( QTextCodec::locale() ).section( '_', 0, 0 ); -#endif + QString pos = QLocale::system().name().left( 2 ); // load translation for Qt-widgets/-dialogs #ifdef QT_TRANSLATIONS_DIR loadTranslation( QString( "qt_" ) + pos, @@ -184,9 +169,7 @@ int main( int argc, char * * argv ) // load actual translation for LMMS loadTranslation( pos ); -#ifdef QT4 app.setFont( pointSize<10>( app.font() ) ); -#endif if( !configManager::inst()->loadConfigFile() ) @@ -195,7 +178,6 @@ int main( int argc, char * * argv ) } QPalette pal = app.palette(); -#ifdef QT4 pal.setColor( QPalette::Background, QColor( 128, 128, 128 ) ); pal.setColor( QPalette::Foreground, QColor( 240, 240, 240 ) ); pal.setColor( QPalette::Base, QColor( 128, 128, 128 ) ); @@ -204,20 +186,9 @@ int main( int argc, char * * argv ) pal.setColor( QPalette::ButtonText, QColor( 255, 255, 255 ) ); pal.setColor( QPalette::Highlight, QColor( 224, 224, 224 ) ); pal.setColor( QPalette::HighlightedText, QColor( 0, 0, 0 ) ); -#else - pal.setColor( QColorGroup::Background, QColor( 128, 128, 128 ) ); - pal.setColor( QColorGroup::Foreground, QColor( 240, 240, 240 ) ); - pal.setColor( QColorGroup::Base, QColor( 128, 128, 128 ) ); - pal.setColor( QColorGroup::Text, QColor( 224, 224, 224 ) ); - pal.setColor( QColorGroup::Button, QColor( 160, 160, 160 ) ); - pal.setColor( QColorGroup::ButtonText, QColor( 255, 255, 255 ) ); - pal.setColor( QColorGroup::Highlight, QColor( 224, 224, 224 ) ); - pal.setColor( QColorGroup::HighlightedText, QColor( 0, 0, 0 ) ); -#endif app.setPalette( pal ); -#if QT_VERSION >= 0x030200 // init splash screen QPixmap splash = embed::getIconPixmap( "splash" ); mainWindow::s_splashScreen = new QSplashScreen( splash ); @@ -229,7 +200,6 @@ int main( int argc, char * * argv ) "workspace..." ), splash_alignment_flags, Qt::white ); -#endif engine::init(); @@ -242,9 +212,7 @@ int main( int argc, char * * argv ) { engine::getSongEditor()->createNewProject(); } -#ifndef QT4 - app.setMainWidget( engine::getMainWindow() ); -#endif + // MDI-mode? if( engine::getMainWindow()->workspace() != NULL ) { @@ -260,10 +228,9 @@ int main( int argc, char * * argv ) } -#if QT_VERSION >= 0x030200 delete mainWindow::s_splashScreen; mainWindow::s_splashScreen = NULL; -#endif + if( file_to_render != "" ) { exportProjectDialog * e = new exportProjectDialog( diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index a2058c037..80a9b81ed 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -25,10 +25,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -38,24 +34,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include - -#if QT_VERSION >= 0x030200 -#include -#endif - -#define addSeparator insertSeparator - -#endif #ifdef HAVE_CONFIG_H #include @@ -84,27 +62,19 @@ #include "templates.h" -#if QT_VERSION >= 0x030100 QSplashScreen * mainWindow::s_splashScreen = NULL; extern int splash_alignment_flags; -#endif mainWindow::mainWindow( void ) : - QMainWindow( -#ifndef QT4 - 0 , NULL, WDestructiveClose -#endif - ), + QMainWindow(), m_workspace( NULL ), m_templatesMenu( NULL ), m_recentlyOpenedProjectsMenu( NULL ), m_tools_menu( NULL ) { -#ifdef QT4 setAttribute( Qt::WA_DeleteOnClose ); -#endif bool no_mdi = configManager::inst()->value( "app", "gimplikewindows" ).toInt(); @@ -125,13 +95,11 @@ mainWindow::mainWindow( void ) : side_bar->setPosition( sideBar::Left ); QSplitter * splitter = new QSplitter( Qt::Horizontal, w ); -#if QT_VERSION >= 0x030200 splitter->setChildrenCollapsible( FALSE ); -#endif QString sample_filter; - vlist ext_keys = engine::sampleExtensions().keys(); - for( vlist::iterator it = ext_keys.begin(); + QList ext_keys = engine::sampleExtensions().keys(); + for( QList::iterator it = ext_keys.begin(); it != ext_keys.end(); ++it ) { sample_filter += " *." + *it; @@ -173,13 +141,9 @@ mainWindow::mainWindow( void ) : m_workspace = new QWorkspace( splitter ); m_workspace->setScrollBarsEnabled( TRUE ); -#ifdef QT4 +#warning TODO /* m_workspace->setBackground( embed::getIconPixmap( "background_artwork" ) );*/ -#else - m_workspace->setPaletteBackgroundPixmap( embed::getIconPixmap( - "background_artwork" ) ); -#endif } hbox->addWidget( side_bar ); @@ -190,16 +154,11 @@ mainWindow::mainWindow( void ) : m_toolBar = new QWidget( main_widget ); m_toolBar->setFixedHeight( 64 ); m_toolBar->move( 0, 0 ); -#ifdef QT4 m_toolBar->setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( m_toolBar->backgroundRole(), embed::getIconPixmap( "main_toolbar_bg" ) ); m_toolBar->setPalette( pal ); -#else - m_toolBar->setPaletteBackgroundPixmap( - embed::getIconPixmap( "main_toolbar_bg" ) ); -#endif // add layout for organizing quite complex toolbar-layouting m_toolBarLayout = new QGridLayout( m_toolBar/*, 2, 1*/ ); @@ -227,7 +186,6 @@ mainWindow::~mainWindow() void mainWindow::finalize( void ) { -#if QT_VERSION >= 0x030200 if( qApp->argc() > 1 ) { s_splashScreen->showMessage( tr( "Loading song..." ), @@ -240,14 +198,11 @@ void mainWindow::finalize( void ) splash_alignment_flags, Qt::white ); } -#endif -#if QT_VERSION >= 0x030200 s_splashScreen->showMessage( tr( "Creating GUI..." ), splash_alignment_flags, Qt::white ); -#endif resetWindowTitle( "" ); setWindowIcon( embed::getIconPixmap( "icon" ) ); @@ -262,19 +217,10 @@ void mainWindow::finalize( void ) m_templatesMenu = new QMenu( project_new ); connect( m_templatesMenu, SIGNAL( aboutToShow( void ) ), this, SLOT( fillTemplatesMenu( void ) ) ); -#ifdef QT4 connect( m_templatesMenu, SIGNAL( triggered( QAction * ) ), this, SLOT( createNewProjectFromTemplate( QAction * ) ) ); -#else - connect( m_templatesMenu, SIGNAL( activated( int ) ), - this, SLOT( createNewProjectFromTemplate( int ) ) ); -#endif project_new->setMenu( m_templatesMenu ); -#ifdef QT4 project_new->setPopupMode( toolButton::MenuButtonPopup ); -#else - project_new->setPopupDelay( 0 ); -#endif toolButton * project_open = new toolButton( embed::getIconPixmap( "project_open" ), @@ -314,11 +260,7 @@ void mainWindow::finalize( void ) this, SLOT( toggleBBEditorWin() ), m_toolBar ); bb_editor_window->setShortcut( Qt::Key_F6 ); -#ifdef QT4 bb_editor_window->setWhatsThis( -#else - QWhatsThis::add( bb_editor_window, -#endif tr( "By pressing this button, you can show or hide the " "Beat+Baseline Editor. The Beat+Baseline Editor is " "needed for creating beats, opening, adding and " @@ -334,11 +276,7 @@ void mainWindow::finalize( void ) this, SLOT( togglePianoRollWin() ), m_toolBar ); piano_roll_window->setShortcut( Qt::Key_F7 ); -#ifdef QT4 piano_roll_window->setWhatsThis( -#else - QWhatsThis::add( piano_roll_window, -#endif tr( "By pressing this button, you can show or hide the " "Piano-Roll. With the help of the Piano-Roll " "you can edit melody-patterns in an easy way." @@ -350,11 +288,7 @@ void mainWindow::finalize( void ) this, SLOT( toggleSongEditorWin() ), m_toolBar ); song_editor_window->setShortcut( Qt::Key_F8 ); -#ifdef QT4 song_editor_window->setWhatsThis( -#else - QWhatsThis::add( song_editor_window, -#endif tr( "By pressing this button, you can show or hide the " "Song-Editor. With the help of the Song-Editor you can " "edit song-playlist and specify when which track " @@ -371,11 +305,7 @@ void mainWindow::finalize( void ) SLOT( toggleAutomationEditorWin() ), m_toolBar ); automation_editor_window->setShortcut( Qt::Key_F9 ); -#ifdef QT4 automation_editor_window->setWhatsThis( -#else - QWhatsThis::add( automation_editor_window, -#endif tr( "By pressing this button, you can show or hide the " "Automation Editor. With the help of the " "Automation Editor you can edit dynamic values " @@ -405,11 +335,7 @@ void mainWindow::finalize( void ) this, SLOT( toggleProjectNotesWin() ), m_toolBar ); project_notes_window->setShortcut( Qt::Key_F10 ); -#ifdef QT4 project_notes_window->setWhatsThis( -#else - QWhatsThis::add( project_notes_window, -#endif tr( "By pressing this button, you can show or hide the " "project notes window. In this window you can put " "down your project notes.") ); @@ -432,11 +358,7 @@ void mainWindow::finalize( void ) // project-popup-menu QMenu * project_menu = new QMenu( this ); -#ifdef QT4 menuBar()->addMenu( project_menu )->setText( tr( "&Project" ) ); -#else - menuBar()->insertItem( tr( "&Project" ), project_menu ); -#endif project_menu->addAction( embed::getIconPixmap( "project_new" ), tr( "&New" ), this, SLOT( createNewProject() ), @@ -446,10 +368,10 @@ void mainWindow::finalize( void ) tr( "&Open..." ), this, SLOT( openProject() ), Qt::CTRL + Qt::Key_O ); - +/* project_menu->addAction( embed::getIconPixmap( "project_open" ), tr( "Recently opened projects" ), - m_recentlyOpenedProjectsMenu ); + m_recentlyOpenedProjectsMenu );*/ project_menu->addAction( embed::getIconPixmap( "project_save" ), tr( "&Save" ), @@ -460,11 +382,7 @@ void mainWindow::finalize( void ) tr( "Save &As..." ), this, SLOT( saveProjectAs() ), Qt::CTRL + Qt::SHIFT + Qt::Key_S ); -#ifdef QT4 project_menu->addSeparator(); -#else - project_menu->insertSeparator(); -#endif project_menu->addAction( /*embed::getIconPixmap( "project_import" ),*/ tr( "Import..." ), engine::getSongEditor(), @@ -474,22 +392,14 @@ void mainWindow::finalize( void ) engine::getSongEditor(), SLOT( exportProject() ), Qt::CTRL + Qt::Key_E ); -#ifdef QT4 project_menu->addSeparator(); -#else - project_menu->insertSeparator(); -#endif project_menu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ), qApp, SLOT( closeAllWindows() ), Qt::CTRL + Qt::Key_Q ); QMenu * edit_menu = new QMenu( this ); -#ifdef QT4 menuBar()->addMenu( edit_menu )->setText( tr( "&Edit" ) ); -#else - menuBar()->insertItem( tr( "&Edit" ), edit_menu ); -#endif edit_menu->addAction( embed::getIconPixmap( "edit_undo" ), tr( "Undo" ), this, SLOT( undo() ), @@ -501,11 +411,7 @@ void mainWindow::finalize( void ) QMenu * settings_menu = new QMenu( this ); -#ifdef QT4 menuBar()->addMenu( settings_menu )->setText( tr( "&Settings" ) ); -#else - menuBar()->insertItem( tr( "&Settings" ), settings_menu ); -#endif settings_menu->addAction( embed::getIconPixmap( "setup_general" ), tr( "Show settings dialog" ), this, SLOT( showSettingsDialog() ) ); @@ -515,9 +421,9 @@ void mainWindow::finalize( void ) m_tools_menu = new QMenu( this ); - vvector pluginDescriptors; + QVector pluginDescriptors; plugin::getDescriptorsOfAvailPlugins( pluginDescriptors ); - for( vvector::iterator it = + for( QVector::iterator it = pluginDescriptors.begin(); it != pluginDescriptors.end(); ++it ) { @@ -528,31 +434,17 @@ void mainWindow::finalize( void ) this ) ); } } -#ifndef QT3 if( !m_tools_menu->isEmpty() ) -#else - if( m_tools_menu->count() ) -#endif { -#ifdef QT4 menuBar()->addMenu( m_tools_menu )->setText( tr( "&Tools" ) ); connect( m_tools_menu, SIGNAL( triggered( QAction * ) ), this, SLOT( showTool( QAction * ) ) ); -#else - menuBar()->insertItem( tr( "&Tools" ), m_tools_menu ); - connect( m_tools_menu, SIGNAL( activated( int ) ), - this, SLOT( showTool( int ) ) ); -#endif } // help-popup-menu QMenu * help_menu = new QMenu( this ); -#ifdef QT4 menuBar()->addMenu( help_menu )->setText( tr( "&Help" ) ); -#else - menuBar()->insertItem( tr( "&Help" ), help_menu ); -#endif if( have_www_browser() ) { help_menu->addAction( embed::getIconPixmap( "help" ), @@ -569,11 +461,7 @@ void mainWindow::finalize( void ) tr( "What's this?" ), this, SLOT( enterWhatsThisMode() ) ); -#ifdef QT4 help_menu->addSeparator(); -#else - help_menu->insertSeparator(); -#endif help_menu->addAction( embed::getIconPixmap( "icon" ), tr( "About" ), this, SLOT( aboutLMMS() ) ); @@ -602,11 +490,7 @@ int mainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col ) int col = ( _col == -1 ) ? m_toolBarLayout->columnCount() + 6 : _col; if( _w->height() > 32 || _row == -1 ) { -#ifdef QT4 m_toolBarLayout->addWidget( _w, 0, col, 2, 1 ); -#else - m_toolBarLayout->addMultiCellWidget( _w, 0, 1, col, col ); -#endif } else { @@ -633,11 +517,7 @@ void mainWindow::resetWindowTitle( const QString & _add ) if( _add == "" && engine::getSongEditor()->projectFileName() != "" ) { title = QFileInfo( engine::getSongEditor()->projectFileName() -#ifdef QT4 - ).completeBaseName(); -#else - ).baseName( TRUE ); -#endif + ).completeBaseName(); } if( title != "" ) { @@ -711,60 +591,30 @@ void mainWindow::createNewProject( void ) -#ifdef QT4 void mainWindow::createNewProjectFromTemplate( QAction * _idx ) -#else -void mainWindow::createNewProjectFromTemplate( int _idx ) -#endif { if( m_templatesMenu != NULL && engine::getSongEditor()->mayChangeProject() == TRUE ) { -#ifdef QT4 QString dir_base = m_templatesMenu->actions().indexOf( _idx ) -#else - QString dir_base = m_templatesMenu->indexOf( _idx ) -#endif >= m_custom_templates_count ? configManager::inst()->factoryProjectsDir() : configManager::inst()->userProjectsDir(); engine::getSongEditor()->createNewProjectFromTemplate( - dir_base + "templates/" + -#ifdef QT4 - _idx->text() + ".mpt" ); -#else - m_templatesMenu->text( _idx ) + ".mpt" ); -#endif + dir_base + "templates/" + _idx->text() + ".mpt" ); } } -#ifdef QT4 -void mainWindow::createNewProjectFromTemplate( int _idx ) -#else -void mainWindow::createNewProjectFromTemplate( QAction * _idx ) -#endif -{ -} - - - void mainWindow::openProject( void ) { if( engine::getSongEditor()->mayChangeProject() == TRUE ) { -#ifdef QT4 QFileDialog ofd( this, tr( "Open project" ), "", tr( "MultiMedia Project (*.mmp *.mmpz *.xml)" ) ); -#else - QFileDialog ofd( QString::null, - tr( "MultiMedia Project (*.mmp *.mmpz *.xml)" ), - this, "", TRUE ); - ofd.setWindowTitle( tr( "Open project" ) ); -#endif ofd.setDirectory( configManager::inst()->userProjectsDir() ); ofd.setFileMode( QFileDialog::ExistingFiles ); if( ofd.exec () == QDialog::Accepted && @@ -794,10 +644,11 @@ void mainWindow::updateRecentlyOpenedProjectsMenu( void ) void mainWindow::openRecentlyOpenedProject( int _id ) { - const QString & f = m_recentlyOpenedProjectsMenu->text( _id ); +#warning TODO +/* const QString & f = m_recentlyOpenedProjectsMenu->text( _id ); engine::getSongEditor()->loadProject( f ); configManager::inst()->addRecentlyOpenedProject( f ); - updateRecentlyOpenedProjectsMenu(); + updateRecentlyOpenedProjectsMenu();*/ } @@ -821,27 +672,15 @@ bool mainWindow::saveProject( void ) bool mainWindow::saveProjectAs( void ) { -#ifdef QT4 QFileDialog sfd( this, tr( "Save project" ), "", tr( "MultiMedia Project (*.mmp *.mmpz);;" "MultiMedia Project Template (*.mpt)" ) ); -#else - QFileDialog sfd( QString::null, - tr( "MultiMedia Project (*.mmp *.mmpz);;" - "MultiMedia Project Template (*.mpt)" ), - this, "", TRUE ); - sfd.setWindowTitle( tr( "Save project" ) ); -#endif sfd.setFileMode( QFileDialog::AnyFile ); QString f = engine::getSongEditor()->projectFileName(); if( f != "" ) { sfd.selectFile( QFileInfo( f ).fileName() ); -#ifdef QT4 sfd.setDirectory( QFileInfo( f ).absolutePath() ); -#else - sfd.setDirectory( QFileInfo( f ).dirPath( TRUE ) ); -#endif } else { @@ -849,19 +688,10 @@ bool mainWindow::saveProjectAs( void ) } if( sfd.exec () == QFileDialog::Accepted && -#ifdef QT4 - !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" -#else - sfd.selectedFile() != "" -#endif - ) + !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" ) { -#ifdef QT4 engine::getSongEditor()->saveProjectAs( sfd.selectedFiles()[0] ); -#else - engine::getSongEditor()->saveProjectAs( sfd.selectedFile() ); -#endif return( TRUE ); } return( FALSE ); @@ -1068,12 +898,7 @@ void mainWindow::fillTemplatesMenu( void ) m_templatesMenu->clear(); QDir user_d( configManager::inst()->userProjectsDir() + "templates" ); - QStringList templates = user_d.entryList( -#ifdef QT4 - QStringList( "*.mpt" ), -#else - "*.mpt", -#endif + QStringList templates = user_d.entryList( QStringList( "*.mpt" ), QDir::Files | QDir::Readable ); m_custom_templates_count = templates.count(); @@ -1086,12 +911,7 @@ void mainWindow::fillTemplatesMenu( void ) } QDir d( configManager::inst()->factoryProjectsDir() + "templates" ); - templates = d.entryList( -#ifdef QT4 - QStringList( "*.mpt" ), -#else - "*.mpt", -#endif + templates = d.entryList( QStringList( "*.mpt" ), QDir::Files | QDir::Readable ); @@ -1111,17 +931,9 @@ void mainWindow::fillTemplatesMenu( void ) -#ifndef QT3 void mainWindow::showTool( QAction * _idx ) -#else -void mainWindow::showTool( int _idx ) -#endif { -#ifndef QT3 tool * t = m_tools[m_tools_menu->actions().indexOf( _idx )]; -#else - tool * t = m_tools[m_tools_menu->indexOf( _idx )]; -#endif t->show(); t->setFocus(); } @@ -1129,16 +941,6 @@ void mainWindow::showTool( int _idx ) -#ifndef QT3 -void mainWindow::showTool( int _idx ) -#else -void mainWindow::showTool( QAction * _idx ) -#endif -{ -} - - - bool mainWindow::have_www_browser( void ) { @@ -1160,13 +962,8 @@ void mainWindow::browseHelp( void ) { // TODO: use QDesktopService with Qt4 QString url = "http://lmms.sf.net/wiki/index.php?title=Main_Page"; - execlp( "x-www-browser", "x-www-browser", url. -#ifdef QT4 - toAscii().constData(), -#else - ascii(), -#endif - NULL ); + execlp( "x-www-browser", "x-www-browser", + url.toAscii().constData(), NULL ); perror( "execlp" ); exit( EXIT_FAILURE ); } @@ -1175,11 +972,6 @@ void mainWindow::browseHelp( void ) -#ifndef QT4 -#undef addSeparator -#endif - - #include "main_window.moc" diff --git a/src/core/midi_tab_widget.cpp b/src/core/midi_tab_widget.cpp index 1e87149db..66c341684 100644 --- a/src/core/midi_tab_widget.cpp +++ b/src/core/midi_tab_widget.cpp @@ -26,26 +26,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include -#include - -#define setIcon setPixmap -#define setText setTextLabel - -#endif - #include "midi_tab_widget.h" #include "embed.h" @@ -156,26 +140,14 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track, m_readablePorts = new QMenu( m_setupTabWidget ); m_readablePorts->setFont( pointSize<9>( m_readablePorts->font() ) ); -#ifdef QT4 connect( m_readablePorts, SIGNAL( triggered( QAction * ) ), this, SLOT( activatedReadablePort( QAction * ) ) ); -#else - m_readablePorts->setCheckable( TRUE ); - connect( m_readablePorts, SIGNAL( activated( int ) ), - this, SLOT( activatedReadablePort( int ) ) ); -#endif m_writeablePorts = new QMenu( m_setupTabWidget ); m_writeablePorts->setFont( pointSize<9>( m_writeablePorts->font() ) ); -#ifdef QT4 connect( m_writeablePorts, SIGNAL( triggered( QAction * ) ), this, SLOT( activatedWriteablePort( QAction * ) ) ); -#else - m_writeablePorts->setCheckable( TRUE ); - connect( m_writeablePorts, SIGNAL( activated( int ) ), - this, SLOT( activatedWriteablePort( int ) ) ); -#endif // fill menus readablePortsChanged(); @@ -187,11 +159,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track, rp_btn->setIcon( embed::getIconPixmap( "midi_in" ) ); rp_btn->setGeometry( 186, 34, 40, 40 ); rp_btn->setMenu( m_readablePorts ); -#ifdef QT4 rp_btn->setPopupMode( QToolButton::InstantPopup ); -#else - rp_btn->setPopupDelay( 1 ); -#endif QToolButton * wp_btn = new QToolButton( m_setupTabWidget ); wp_btn->setText( tr( "MIDI-devices to send MIDI-events " @@ -199,11 +167,7 @@ midiTabWidget::midiTabWidget( instrumentTrack * _instrument_track, wp_btn->setIcon( embed::getIconPixmap( "midi_out" ) ); wp_btn->setGeometry( 186, 114, 40, 40 ); wp_btn->setMenu( m_writeablePorts ); -#ifdef QT4 wp_btn->setPopupMode( QToolButton::InstantPopup ); -#else - wp_btn->setPopupDelay( 1 ); -#endif // we want to get informed about port-changes! mc->connectRPChanged( this, SLOT( readablePortsChanged() ) ); @@ -234,7 +198,6 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) if( m_readablePorts != NULL && m_receiveCheckBox->isChecked() == TRUE ) { QString rp; -#ifdef QT4 QList actions = m_readablePorts->actions(); for( QList::iterator it = actions.begin(); it != actions.end(); ++it ) @@ -244,16 +207,6 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) rp += ( *it )->text() + ","; } } -#else - for( csize i = 0; i < m_readablePorts->count(); ++i ) - { - int id = m_readablePorts->idAt( i ); - if( m_readablePorts->isItemChecked( id ) ) - { - rp += m_readablePorts->text( id ) + ","; - } - } -#endif // cut off comma if( rp.length() > 0 ) { @@ -265,7 +218,6 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) if( m_writeablePorts != NULL && m_sendCheckBox->isChecked() == TRUE ) { QString wp; -#ifdef QT4 QList actions = m_writeablePorts->actions(); for( QList::iterator it = actions.begin(); it != actions.end(); ++it ) @@ -275,16 +227,6 @@ void midiTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _this ) wp += ( *it )->text() + ","; } } -#else - for( csize i = 0; i < m_writeablePorts->count(); ++i ) - { - int id = m_writeablePorts->idAt( i ); - if( m_writeablePorts->isItemChecked( id ) ) - { - wp += m_writeablePorts->text( id ) + ","; - } - } -#endif // cut off comma if( wp.length() > 0 ) { @@ -310,7 +252,6 @@ void midiTabWidget::loadSettings( const QDomElement & _this ) if( m_readablePorts != NULL && m_receiveCheckBox->isChecked() == TRUE ) { -#ifdef QT4 QStringList rp = _this.attribute( "inports" ).split( ',' ); QList actions = m_readablePorts->actions(); for( QList::iterator it = actions.begin(); @@ -323,25 +264,10 @@ void midiTabWidget::loadSettings( const QDomElement & _this ) activatedReadablePort( *it ); } } -#else - QStringList rp = QStringList::split( ',', - _this.attribute( "inports" ) ); - for( csize i = 0; i < m_readablePorts->count(); ++i ) - { - int id = m_readablePorts->idAt( i ); - if( m_readablePorts->isItemChecked( id ) != - ( rp.find( m_readablePorts->text( id ) ) != - rp.end() ) ) - { - activatedReadablePort( id ); - } - } -#endif } if( m_writeablePorts != NULL && m_sendCheckBox->isChecked() == TRUE ) { -#ifdef QT4 QStringList wp = _this.attribute( "outports" ).split( ',' ); QList actions = m_writeablePorts->actions(); for( QList::iterator it = actions.begin(); @@ -354,20 +280,6 @@ void midiTabWidget::loadSettings( const QDomElement & _this ) activatedWriteablePort( *it ); } } -#else - QStringList wp = QStringList::split( ',', - _this.attribute( "outports" ) ); - for( csize i = 0; i < m_writeablePorts->count(); ++i ) - { - int id = m_writeablePorts->idAt( i ); - if( m_writeablePorts->isItemChecked( id ) != - ( wp.find( m_writeablePorts->text( id ) ) != - wp.end() ) ) - { - activatedWriteablePort( id ); - } - } -#endif } } @@ -422,7 +334,6 @@ void midiTabWidget::midiPortModeToggled( bool ) // check whether we have to dis-check items in connection-menu if( m_readablePorts != NULL && m_receiveCheckBox->isChecked() == FALSE ) { -#ifdef QT4 QList actions = m_readablePorts->actions(); for( QList::iterator it = actions.begin(); it != actions.end(); ++it ) @@ -433,20 +344,9 @@ void midiTabWidget::midiPortModeToggled( bool ) activatedReadablePort( *it ); } } -#else - for( csize i = 0; i < m_readablePorts->count(); ++i ) - { - int id = m_readablePorts->idAt( i ); - if( m_readablePorts->isItemChecked( id ) == TRUE ) - { - activatedReadablePort( id ); - } - } -#endif } if( m_writeablePorts != NULL && m_sendCheckBox->isChecked() == FALSE ) { -#ifdef QT4 QList actions = m_writeablePorts->actions(); for( QList::iterator it = actions.begin(); it != actions.end(); ++it ) @@ -457,16 +357,6 @@ void midiTabWidget::midiPortModeToggled( bool ) activatedWriteablePort( *it ); } } -#else - for( csize i = 0; i < m_writeablePorts->count(); ++i ) - { - int id = m_writeablePorts->idAt( i ); - if( m_writeablePorts->isItemChecked( id ) == TRUE ) - { - activatedWriteablePort( id ); - } - } -#endif } engine::getSongEditor()->setModified(); } @@ -478,7 +368,6 @@ void midiTabWidget::readablePortsChanged( void ) { // first save all selected ports QStringList selected_ports; -#ifdef QT4 QList actions = m_readablePorts->actions(); for( QList::iterator it = actions.begin(); it != actions.end(); ++it ) @@ -488,16 +377,6 @@ void midiTabWidget::readablePortsChanged( void ) selected_ports.push_back( ( *it )->text() ); } } -#else - for( csize i = 0; i < m_readablePorts->count(); ++i ) - { - int id = m_readablePorts->idAt( i ); - if( m_readablePorts->isItemChecked( id ) == TRUE ) - { - selected_ports.push_back( m_readablePorts->text( id ) ); - } - } -#endif m_readablePorts->clear(); const QStringList & rp = engine::getMixer()->getMIDIClient()-> @@ -505,20 +384,12 @@ void midiTabWidget::readablePortsChanged( void ) // now insert new ports and restore selections for( QStringList::const_iterator it = rp.begin(); it != rp.end(); ++it ) { -#ifdef QT4 QAction * item = m_readablePorts->addAction( *it ); item->setCheckable( TRUE ); if( selected_ports.indexOf( *it ) != -1 ) { item->setChecked( TRUE ); } -#else - int id = m_readablePorts->insertItem( *it ); - if( selected_ports.find( *it ) != selected_ports.end() ) - { - m_readablePorts->setItemChecked( id, TRUE ); - } -#endif } } @@ -529,7 +400,6 @@ void midiTabWidget::writeablePortsChanged( void ) { // first save all selected ports QStringList selected_ports; -#ifdef QT4 QList actions = m_writeablePorts->actions(); for( QList::iterator it = actions.begin(); it != actions.end(); ++it ) @@ -539,17 +409,6 @@ void midiTabWidget::writeablePortsChanged( void ) selected_ports.push_back( ( *it )->text() ); } } -#else - for( csize i = 0; i < m_writeablePorts->count(); ++i ) - { - int id = m_writeablePorts->idAt( i ); - if( m_writeablePorts->isItemChecked( id ) == TRUE ) - { - selected_ports.push_back( m_writeablePorts->text( - id ) ); - } - } -#endif m_writeablePorts->clear(); const QStringList & wp = engine::getMixer()->getMIDIClient()-> @@ -557,27 +416,18 @@ void midiTabWidget::writeablePortsChanged( void ) // now insert new ports and restore selections for( QStringList::const_iterator it = wp.begin(); it != wp.end(); ++it ) { -#ifdef QT4 QAction * item = m_writeablePorts->addAction( *it ); item->setCheckable( TRUE ); if( selected_ports.indexOf( *it ) != -1 ) { item->setChecked( TRUE ); } -#else - int id = m_writeablePorts->insertItem( *it ); - if( selected_ports.find( *it ) != selected_ports.end() ) - { - m_writeablePorts->setItemChecked( id, TRUE ); - } -#endif } } -#ifdef QT4 void midiTabWidget::activatedReadablePort( QAction * _item ) { // make sure, MIDI-port is configured for input @@ -608,57 +458,6 @@ void midiTabWidget::activatedWriteablePort( QAction * _item ) } -void midiTabWidget::activatedReadablePort( int ) { } -void midiTabWidget::activatedWriteablePort( int ) { } - -#else - - -void midiTabWidget::activatedReadablePort( int _id ) -{ - // make sure, MIDI-port is configured for input - if( m_readablePorts->isItemChecked( _id ) == FALSE && - m_midiPort->mode() != midiPort::INPUT && - m_midiPort->mode() != midiPort::DUPLEX ) - { - m_receiveCheckBox->setChecked( TRUE ); - } - m_readablePorts->setItemChecked( _id, - !m_readablePorts->isItemChecked( _id ) ); - engine::getMixer()->getMIDIClient()->subscribeReadablePort( - m_midiPort, m_readablePorts->text( _id ), - !m_readablePorts->isItemChecked( _id ) ); -} - - - - -void midiTabWidget::activatedWriteablePort( int _id ) -{ - // make sure, MIDI-port is configured for output - if( m_writeablePorts->isItemChecked( _id ) == FALSE && - m_midiPort->mode() != midiPort::OUTPUT && - m_midiPort->mode() != midiPort::DUPLEX ) - { - m_sendCheckBox->setChecked( TRUE ); - } - m_writeablePorts->setItemChecked( _id, - !m_writeablePorts->isItemChecked( _id ) ); - engine::getMixer()->getMIDIClient()->subscribeWriteablePort( - m_midiPort, m_writeablePorts->text( _id ), - !m_writeablePorts->isItemChecked( _id ) ); -} - - -void midiTabWidget::activatedReadablePort( QAction * ) { } -void midiTabWidget::activatedWriteablePort( QAction * ) { } - - -#undef setIcon -#undef setText - -#endif - #include "midi_tab_widget.moc" diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index cf4846ee7..6a6d432a7 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -71,11 +71,7 @@ mixer::mixer( void ) : m_masterGain( 1.0f ), m_audioDev( NULL ), m_oldAudioDev( NULL ), -#ifndef QT3 m_globalMutex( QMutex::Recursive ) -#else - m_globalMutex( TRUE ) -#endif { if( configManager::inst()->value( "mixer", "framesperaudiobuffer" ).toInt() >= 32 ) @@ -294,7 +290,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void ) engine::getSongEditor()->processNextBuffer(); lockPlayHandles(); - csize idx = 0; + int idx = 0; if( m_parallelizingLevel > 1 ) { // TODO: if not enough play-handles are found which are capable of @@ -366,7 +362,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void ) unlockPlayHandles(); bool more_effects = FALSE; - for( vvector::iterator it = m_audioPorts.begin(); + for( QVector::iterator it = m_audioPorts.begin(); it != m_audioPorts.end(); ++it ) { more_effects = ( *it )->processEffects(); diff --git a/src/core/name_label.cpp b/src/core/name_label.cpp index 55a6644e6..c3d313dce 100644 --- a/src/core/name_label.cpp +++ b/src/core/name_label.cpp @@ -26,22 +26,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - #include "name_label.h" #include "rename_dialog.h" @@ -58,9 +46,6 @@ nameLabel::nameLabel( const QString & _initial_name, QWidget * _parent ) : m_pixmap(), m_pixmapFile( "" ) { -#ifdef QT3 - setBackgroundMode( Qt::NoBackground ); -#endif } @@ -107,12 +92,7 @@ void nameLabel::setPixmapFile( const QString & _file ) void nameLabel::selectPixmap( void ) { -#ifdef QT4 QFileDialog ofd( NULL, tr( "Select icon" ) ); -#else - QFileDialog ofd( QString::null, QString::null, NULL, "", TRUE ); - ofd.setWindowTitle( tr( "Select icon" ) ); -#endif QString dir; if( m_pixmapFile != "" ) @@ -122,11 +102,7 @@ void nameLabel::selectPixmap( void ) { f = configManager::inst()->trackIconsDir() + f; } -#ifdef QT4 dir = QFileInfo( f ).absolutePath(); -#else - dir = QFileInfo( f ).dirPath( TRUE ); -#endif } else { @@ -137,15 +113,9 @@ void nameLabel::selectPixmap( void ) // use default QFileDialog::ExistingFile // set filters -#ifdef QT4 QStringList types; types << tr( "All images (*.png *.jpg *.jpeg *.gif *.bmp)" ); ofd.setFilters( types ); -#else - ofd.addFilter( tr( "All images (*.png *.jpg *.jpeg *.gif *.bmp)" ) ); - ofd.setSelectedFilter( tr( "All images (*.png *.jpg *.jpeg *.gif " - "*.bmp)" ) ); -#endif if( m_pixmapFile != "" ) { // select previously opened file @@ -153,26 +123,14 @@ void nameLabel::selectPixmap( void ) } if ( ofd.exec () == QDialog::Accepted -#ifndef QT3 && !ofd.selectedFiles().isEmpty() -#endif ) { - QString pf = ofd. -#ifdef QT3 - selectedFile(); -#else - selectedFiles()[0]; -#endif + QString pf = ofd.selectedFiles()[0]; if( !QFileInfo( pf ).isRelative() ) { -#if QT_VERSION >= 0x030100 pf = pf.replace( configManager::inst()->trackIconsDir(), "" ); -#else - pf = pf.replace( QRegExp( - configManager::inst()->trackIconsDir() ), "" ); -#endif } setPixmapFile( pf ); } @@ -203,11 +161,7 @@ void nameLabel::mousePressEvent( QMouseEvent * _me ) if( _me->button() == Qt::RightButton ) { QSize s( m_pixmap.width(), m_pixmap.height() ); -#ifndef QT3 s.scale( width(), height(), Qt::KeepAspectRatio ); -#else - s.scale( width(), height(), QSize::ScaleMin ); -#endif if( _me->x() > 4 + s.width() ) { rename(); @@ -230,11 +184,7 @@ void nameLabel::mousePressEvent( QMouseEvent * _me ) void nameLabel::mouseDoubleClickEvent( QMouseEvent * _me ) { QSize s( m_pixmap.width(), m_pixmap.height() ); -#ifndef QT3 s.scale( width(), height(), Qt::KeepAspectRatio ); -#else - s.scale( width(), height(), QSize::ScaleMin ); -#endif if( _me->x() > 4 + s.width() ) { rename(); @@ -250,15 +200,8 @@ void nameLabel::mouseDoubleClickEvent( QMouseEvent * _me ) void nameLabel::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); p.fillRect( rect(), palette().color( backgroundRole() ) ); -#else - QPixmap draw_pm( size() ); - draw_pm.fill( this, rect().topLeft() ); - - QPainter p( &draw_pm, this ); -#endif p.setFont( pointSize<8>( p.font() ) ); int x = 4; @@ -267,14 +210,8 @@ void nameLabel::paintEvent( QPaintEvent * ) QPixmap pm = m_pixmap; if( pm.height() > height() ) { -#ifndef QT3 pm = pm.scaledToHeight( height(), Qt::SmoothTransformation ); -#else - pm.convertFromImage( pm.convertToImage().smoothScale( - pm.width(), height(), - QImage::ScaleMin ) ); -#endif } p.drawPixmap( x, ( height() - pm.height() ) / 2, pm ); x += 4 + pm.width(); @@ -295,10 +232,6 @@ void nameLabel::paintEvent( QPaintEvent * ) p.drawText( x, height() / 2 + p.fontMetrics().height() / 2 - 4, text() ); -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } diff --git a/src/core/note.cpp b/src/core/note.cpp index 5ee02d12d..84dea4cc2 100644 --- a/src/core/note.cpp +++ b/src/core/note.cpp @@ -25,18 +25,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include #include "note.h" diff --git a/src/core/piano_roll.cpp b/src/core/piano_roll.cpp index 7100f858e..9a1eddeb4 100644 --- a/src/core/piano_roll.cpp +++ b/src/core/piano_roll.cpp @@ -26,10 +26,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -40,22 +36,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include - -#define addButton insert -#define setCheckable setToggleButton - -#endif - #ifndef __USE_XOPEN #define __USE_XOPEN @@ -202,10 +182,8 @@ pianoRoll::pianoRoll( void ) : "automation" ) ); } -#ifdef QT4 // add us to workspace engine::getMainWindow()->workspace()->addWindow( this ); -#endif // add time-line m_timeLine = new timeLine( WHITE_KEY_WIDTH, 32, m_ppt, @@ -221,16 +199,11 @@ pianoRoll::pianoRoll( void ) : m_toolBar = new QWidget( this ); m_toolBar->setFixedHeight( 32 ); m_toolBar->move( 0, 0 ); -#ifdef QT4 m_toolBar->setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( m_toolBar->backgroundRole(), embed::getIconPixmap( "toolbar_bg" ) ); m_toolBar->setPalette( pal ); -#else - m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap( - "toolbar_bg" ) ); -#endif QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar ); tb_layout->setMargin( 0 ); @@ -251,29 +224,17 @@ pianoRoll::pianoRoll( void ) : tr( "Stop playing of current pattern (Space)" ), this, SLOT( stop() ), m_toolBar ); -#ifdef QT4 m_playButton->setWhatsThis( -#else - QWhatsThis::add( m_playButton, -#endif tr( "Click here, if you want to play the current pattern. " "This is useful while editing it. The pattern is " "automatically looped when its end is reached." ) ); -#ifdef QT4 m_recordButton->setWhatsThis( -#else - QWhatsThis::add( m_recordButton, -#endif tr( "Click here, if you want to record notes from a MIDI-" "device or the virtual test-piano of the according " "channel-window to the current pattern. When recording " "all notes you play will be written to this pattern " "and you can play and edit them afterwards." ) ); -#ifdef QT4 m_stopButton->setWhatsThis( -#else - QWhatsThis::add( m_stopButton, -#endif tr( "Click here, if you want to stop playing of current " "pattern." ) ); @@ -322,43 +283,24 @@ pianoRoll::pianoRoll( void ) : tool_button_group->addButton( m_selectButton ); tool_button_group->addButton( m_moveButton ); tool_button_group->setExclusive( TRUE ); -#ifndef QT4 - tool_button_group->hide(); -#endif -#ifdef QT4 m_drawButton->setWhatsThis( -#else - QWhatsThis::add( m_drawButton, -#endif tr( "If you click here, draw-mode will be activated. In this " "mode you can add, resize and move single notes. This " "is the default-mode which is used most of the time. " "You can also press 'Shift+D' on your keyboard to " "activate this mode." ) ); -#ifdef QT4 m_eraseButton->setWhatsThis( -#else - QWhatsThis::add( m_eraseButton, -#endif tr( "If you click here, erase-mode will be activated. In this " "mode you can erase single notes. You can also press " "'Shift+E' on your keyboard to activate this mode." ) ); -#ifdef QT4 m_selectButton->setWhatsThis( -#else - QWhatsThis::add( m_selectButton, -#endif tr( "If you click here, select-mode will be activated. " "In this mode you can select notes. This is neccessary " "if you want to cut, copy, paste, delete or move " "notes. You can also press 'Shift+S' on your keyboard " "to activate this mode." ) ); -#ifdef QT4 m_moveButton->setWhatsThis( -#else - QWhatsThis::add( m_moveButton, -#endif tr( "If you click here, move-mode will be activated. In this " "mode you can move the notes you selected in select-" "mode. You can also press 'Shift+M' on your keyboard " @@ -380,27 +322,15 @@ pianoRoll::pianoRoll( void ) : this, SLOT( pasteNotes() ), m_toolBar ); -#ifdef QT4 m_cutButton->setWhatsThis( -#else - QWhatsThis::add( m_cutButton, -#endif tr( "If you click here, selected notes will be cut into the " "clipboard. You can paste them anywhere in any pattern " "by clicking on the paste-button." ) ); -#ifdef QT4 m_copyButton->setWhatsThis( -#else - QWhatsThis::add( m_copyButton, -#endif tr( "If you click here, selected notes will be copied into the " "clipboard. You can paste them anywhere in any pattern " "by clicking on the paste-button." ) ); -#ifdef QT4 m_pasteButton->setWhatsThis( -#else - QWhatsThis::add( m_pasteButton, -#endif tr( "If you click here, the notes from the clipboard will be " "pasted at the first visible tact." ) ); @@ -450,12 +380,7 @@ pianoRoll::pianoRoll( void ) : m_noteLenComboBox->addItem( "1/" + QString::number( 1 << i ), embed::getIconPixmap( QString( "note_" + pixmaps[i] ). -#ifndef QT3 - toAscii().constData() -#else - ascii() -#endif - ) ); + toAscii().constData() ) ); } m_noteLenComboBox->setValue( 0 ); @@ -494,9 +419,6 @@ pianoRoll::pianoRoll( void ) : resize( INITIAL_PIANOROLL_WIDTH, INITIAL_PIANOROLL_HEIGHT ); setCurrentPattern( NULL ); -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif setMouseTracking( TRUE ); hide(); @@ -657,11 +579,8 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, Uint16 _x, } Uint16 pos_x = _x + pos_tact_64th * m_ppt / 64; -#ifdef QT3 - const int level = it.data(); -#else const int level = it.value(); -#endif + Uint16 pos_y = middle_y - level * KEY_LINE_HEIGHT / 10; _p.drawLine( pos_x - 1, pos_y, pos_x + 1, pos_y ); @@ -1024,12 +943,8 @@ void pianoRoll::updatePaintPixmap( QPixmap & _p ) // reset scroll-range m_leftRightScroll->setRange( 0, l ); -#ifdef QT4 m_leftRightScroll->setSingleStep( 1 ); m_leftRightScroll->setPageStep( l ); -#else - m_leftRightScroll->setSteps( 1, l ); -#endif } @@ -1207,13 +1122,8 @@ void pianoRoll::keyPressEvent( QKeyEvent * _ke ) if( mouseOverNote() ) { m_editMode = OPEN; -#ifndef QT3 QApplication::changeOverrideCursor( QCursor( Qt::ArrowCursor ) ); -#else - QApplication::setOverrideCursor( - QCursor( Qt::ArrowCursor ), TRUE ); -#endif update(); } @@ -1558,23 +1468,12 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) m_action != CHANGE_NOTE_VOLUME && m_action != MOVE_SELECTION && edit_note == FALSE && -#ifdef QT4 - _me->buttons() & -#else - _me->state() == -#endif - Qt::LeftButton ) + _me->buttons() & Qt::LeftButton ) { m_pattern->getInstrumentTrack()->processInEvent( midiEvent( NOTE_OFF, 0, m_lastKey, 0 ), midiTime() ); - if( -#ifdef QT4 - _me->buttons() & -#else - _me->modifiers() == -#endif - Qt::LeftButton && + if( _me->buttons() & Qt::LeftButton && m_action != RESIZE_NOTE && m_action != SELECT_NOTES && m_action != MOVE_SELECTION && @@ -1614,12 +1513,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) } } else if( m_currentNote != NULL && -#ifdef QT4 - _me->buttons() & -#else - _me->state() == -#endif - Qt::LeftButton && m_editMode == DRAW ) + _me->buttons() & Qt::LeftButton && m_editMode == DRAW ) { int key_num = getKey( _me->y() ); @@ -1665,14 +1559,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) engine::getSongEditor()->setModified(); } - else if( -#ifdef QT4 - _me->buttons() == Qt::NoButton -#else - ( _me->state() == NoButton - || _me->state() == ControlButton ) -#endif - && m_editMode == DRAW ) + else if( _me->buttons() == Qt::NoButton && m_editMode == DRAW ) { // set move- or resize-cursor @@ -1709,14 +1596,8 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) if( _me->modifiers() & Qt::ControlModifier ) { m_editMode = OPEN; -#ifndef QT3 QApplication::changeOverrideCursor( QCursor( Qt::ArrowCursor ) ); -#else - QApplication::setOverrideCursor( - QCursor( Qt::ArrowCursor ), - TRUE ); -#endif } // cursor at the "tail" of the note? else if( ( *it )->length() > 0 && @@ -1778,13 +1659,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) } } } - else if( -#ifdef QT4 - _me->buttons() & -#else - _me->modifiers() == -#endif - Qt::LeftButton && + else if( _me->buttons() & Qt::LeftButton && m_editMode == SELECT && m_action == SELECT_NOTES ) { @@ -1834,13 +1709,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) --m_selectedKeys; } } - else if( -#ifdef QT4 - _me->buttons() & -#else - _me->modifiers() == -#endif - Qt::LeftButton && + else if( _me->buttons() & Qt::LeftButton && m_editMode == MOVE && m_action == MOVE_SELECTION ) { @@ -1945,13 +1814,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) } else { - if( -#ifdef QT4 - _me->buttons() & -#else - _me->modifiers() == -#endif - Qt::LeftButton && + if( _me->buttons() & Qt::LeftButton && m_editMode == SELECT && m_action == SELECT_NOTES ) { @@ -2041,14 +1904,8 @@ void pianoRoll::paintEvent( QPaintEvent * ) { QPixmap paintPixmap( size() ); updatePaintPixmap( paintPixmap ); -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( size() ); - draw_pm.fill( QColor( 0, 0, 0 ) ); - QPainter p( &draw_pm, this ); -#endif p.drawPixmap( 0, 0, paintPixmap ); p.setClipRect( WHITE_KEY_WIDTH, PR_TOP_MARGIN, width() - @@ -2077,10 +1934,6 @@ void pianoRoll::paintEvent( QPaintEvent * ) p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ), *cursor ); -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } @@ -2104,12 +1957,8 @@ void pianoRoll::resizeEvent( QResizeEvent * ) m_totalKeysToScroll = total_pixels * NOTES_PER_OCTAVE / OCTAVE_HEIGHT; m_topBottomScroll->setRange( 0, m_totalKeysToScroll ); -#ifdef QT4 m_topBottomScroll->setSingleStep( 1 ); m_topBottomScroll->setPageStep( 20 ); -#else - m_topBottomScroll->setSteps( 1, 20 ); -#endif if( m_startKey > m_totalKeysToScroll ) { @@ -2457,17 +2306,10 @@ void pianoRoll::copy_to_clipboard( const noteVector & _notes ) const clip_note.saveState( mmp, note_list ); } -#ifdef QT4 QMimeData * clip_content = new QMimeData; clip_content->setData( clipboard::mimeType(), mmp.toString().toUtf8() ); QApplication::clipboard()->setMimeData( clip_content, QClipboard::Clipboard ); -#else - QStoredDrag * clip_content = new QStoredDrag( clipboard::mimeType() ); - clip_content->setEncodedData( mmp.toString().utf8() ); - QApplication::clipboard()->setData( clip_content, - QClipboard::Clipboard ); -#endif } @@ -2531,14 +2373,9 @@ void pianoRoll::pasteNotes( void ) return; } -#ifdef QT4 QString value = QApplication::clipboard() ->mimeData( QClipboard::Clipboard ) ->data( clipboard::mimeType() ); -#else - QString value = QApplication::clipboard()->data( QClipboard::Clipboard ) - ->encodedData( clipboard::mimeType() ); -#endif if( !value.isEmpty() ) { @@ -2730,10 +2567,4 @@ bool pianoRoll::x11Event( XEvent * _xe ) #include "piano_roll.moc" -#ifdef QT3 -#undef addButton -#undef setCheckable -#endif - - #endif diff --git a/src/core/piano_widget.cpp b/src/core/piano_widget.cpp index 3c5d878f9..479c98356 100644 --- a/src/core/piano_widget.cpp +++ b/src/core/piano_widget.cpp @@ -26,10 +26,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -37,15 +33,6 @@ #include #include -#else - -#include -#include -#include -#include - -#endif - #include "piano_widget.h" #include "automatable_object_templates.h" @@ -100,11 +87,7 @@ pianoWidget::pianoWidget( instrumentTrack * _parent ) : m_startOctave( OCTAVE_3 ), m_lastKey( -1 ) { -#ifdef QT4 setFocusPolicy( Qt::StrongFocus ); -#else - setFocusPolicy( StrongFocus ); -#endif if( s_whiteKeyPm == NULL ) { @@ -132,30 +115,18 @@ pianoWidget::pianoWidget( instrumentTrack * _parent ) : m_pressedKeys[i] = FALSE; } -#ifdef QT4 m_pianoScroll = new QScrollBar( Qt::Horizontal, this ); m_pianoScroll->setRange( 0, WHITE_KEYS_PER_OCTAVE * ( OCTAVES - 3 ) - 4 ); m_pianoScroll->setSingleStep( 1 ); m_pianoScroll->setPageStep( 20 ); m_pianoScroll->setValue( OCTAVE_3 * WHITE_KEYS_PER_OCTAVE ); -#else - // create scrollbar below piano-widget... - m_pianoScroll = new QScrollBar( 0, WHITE_KEYS_PER_OCTAVE * - ( OCTAVES - 3 ) - 4, 1, 20, - OCTAVE_3 * WHITE_KEYS_PER_OCTAVE, - Qt::Horizontal, this ); -#endif m_pianoScroll->setGeometry( 0, PIANO_BASE + PW_WHITE_KEY_HEIGHT, 250, 16 ); // ...and connect it to this widget... connect( m_pianoScroll, SIGNAL( valueChanged( int ) ), this, SLOT( pianoScrolled( int ) ) ); -#ifndef QT4 - // set background-mode for flicker-free redraw - setBackgroundMode( Qt::NoBackground ); -#endif m_noteKnob = new knob( knobDark_28, NULL, tr( "Base note" ), _parent ); m_noteKnob->setRange( 0, NOTES_PER_OCTAVE * OCTAVES - 1, 1.0f ); @@ -247,9 +218,9 @@ void pianoWidget::contextMenuEvent( QContextMenuEvent * _me ) } QMenu contextMenu( this ); -#ifdef QT4 +#warning TODO: use CSS-formatting contextMenu.setTitle( m_noteKnob->accessibleName() ); -#else +#if 0 QLabel * caption = new QLabel( "" + QString( m_noteKnob->accessibleName() ) + "", this ); @@ -369,11 +340,7 @@ void pianoWidget::mouseMoveEvent( QMouseEvent * _me ) m_pressedKeys[m_lastKey] = FALSE; m_lastKey = -1; } -#ifdef QT4 if( _me->buttons() & Qt::LeftButton ) -#else - if( _me->state() == Qt::LeftButton ) -#endif { if( _me->pos().y() > PIANO_BASE ) { @@ -498,11 +465,7 @@ void pianoWidget::setKeyState( int _key, bool _on ) -#ifndef QT3 void pianoWidget::customEvent( QEvent * ) -#else -void pianoWidget::customEvent( QCustomEvent * ) -#endif { update(); } @@ -575,14 +538,7 @@ int pianoWidget::getKeyX( int _key_num ) const void pianoWidget::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - // create pixmap for whole widget - QPixmap pm( rect().size() );//width(), PIANO_BASE+PW_WHITE_KEY_HEIGHT); - // and a painter for it - QPainter p( &pm, this ); -#endif // set smaller font for printing number of every octave p.setFont( pointSize( p.font() ) ); @@ -704,10 +660,6 @@ void pianoWidget::paintEvent( QPaintEvent * ) } ++cur_key; } -#ifndef QT4 - // blit drawn pixmap to actual widget - bitBlt( this, rect().topLeft(), &pm ); -#endif } diff --git a/src/core/plugin.cpp b/src/core/plugin.cpp index c0e761fb5..ad4a863ff 100644 --- a/src/core/plugin.cpp +++ b/src/core/plugin.cpp @@ -25,24 +25,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "plugin.h" #include "mixer.h" @@ -131,9 +118,6 @@ plugin * plugin::instantiate( const QString & _plugin_name, void * _data ) QMessageBox::Default ); return( new dummyPlugin() ); } -#ifndef QT4 - plugin_lib.setAutoUnload( FALSE ); -#endif plugin * inst = inst_hook( _data ); return( inst ); } @@ -156,53 +140,30 @@ void plugin::waitForWorkerThread( void ) -void plugin::getDescriptorsOfAvailPlugins( vvector & _plugin_descs ) +void plugin::getDescriptorsOfAvailPlugins( QVector & _plugin_descs ) { QDir directory( configManager::inst()->pluginDir() ); -#ifdef QT4 QFileInfoList list = directory.entryInfoList( QStringList( "lib*.so" ) ); -#else - const QFileInfoList * lp = directory.entryInfoList( "lib*.so" ); - // if directory doesn't exist or isn't readable, we get NULL which would - // crash LMMS... - if( lp == NULL ) - { - return; - } - QFileInfoList list = *lp; -#endif for( QFileInfoList::iterator file = list.begin(); file != list.end(); ++file ) { -#ifdef QT4 const QFileInfo & f = *file; -#else - const QFileInfo & f = **file; -#endif QLibrary plugin_lib( f.absoluteFilePath() ); if( plugin_lib.load() == FALSE || plugin_lib.resolve( "lmms_plugin_main" ) == NULL ) { continue; } -#ifndef QT4 - plugin_lib.setAutoUnload( FALSE ); -#endif QString desc_name = f.fileName().section( '.', 0, 0 ) + "_plugin_descriptor"; if( desc_name.left( 3 ) == "lib" ) { desc_name = desc_name.mid( 3 ); } - descriptor * plugin_desc = (descriptor *) plugin_lib.resolve( - desc_name. -#ifdef QT4 - toAscii().constData() -#else - ascii() -#endif - ); + descriptor * plugin_desc = + (descriptor *) plugin_lib.resolve( + desc_name.toAscii().constData() ); if( plugin_desc == NULL ) { continue; diff --git a/src/core/plugin_browser.cpp b/src/core/plugin_browser.cpp index 43dd4259c..aa0ef9ecc 100644 --- a/src/core/plugin_browser.cpp +++ b/src/core/plugin_browser.cpp @@ -25,23 +25,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include - -#endif - #include "plugin_browser.h" #include "embed.h" @@ -74,16 +62,12 @@ pluginBrowser::pluginBrowser( QWidget * _parent ) : "corresponding channel-button." ), m_view ); hint->setFont( pointSize<8>( hint->font() ) ); -#ifdef QT4 hint->setWordWrap( TRUE ); -#else - hint->setAlignment( hint->alignment() | Qt::WordBreak ); -#endif view_layout->addWidget( hint ); plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors ); - for( vvector::iterator it = + for( QVector::iterator it = m_pluginDescriptors.begin(); it != m_pluginDescriptors.end(); ++it ) { @@ -124,9 +108,6 @@ pluginDescWidget::pluginDescWidget( const plugin::descriptor & _pd, connect( &m_updateTimer, SIGNAL( timeout() ), SLOT( updateHeight() ) ); setFixedHeight( m_targetHeight ); setMouseTracking( TRUE ); -#ifdef QT3 - setBackgroundMode( Qt::NoBackground ); -#endif setCursor( Qt::PointingHandCursor ); } @@ -145,35 +126,16 @@ void pluginDescWidget::paintEvent( QPaintEvent * ) const QColor fill_color = m_mouseOver ? QColor( 224, 224, 224 ) : QColor( 192, 192, 192 ); -#ifdef QT4 QPainter p( this ); p.fillRect( rect(), fill_color ); -#else - // create pixmap for whole widget - QPixmap pm( rect().size() ); - pm.fill( fill_color ); - - // and a painter for it - QPainter p( &pm ); -#endif const int s = 16 + ( 32 * ( tLimit( height(), 24, 60 ) - 24 ) ) / ( 60 - 24 ); const QSize logo_size( s, s ); -#ifndef QT3 QPixmap logo = m_logo.scaled( logo_size, Qt::KeepAspectRatio, Qt::SmoothTransformation ); -#else - QPixmap logo; - logo.convertFromImage( m_logo.convertToImage().smoothScale( logo_size, - QImage::ScaleMin ) ); -#endif p.setPen( QColor( 64, 64, 64 ) ); -#ifndef QT3 p.drawRect( 0, 0, rect().right(), rect().bottom() ); -#else - p.drawRect( rect() ); -#endif p.drawPixmap( 4, 4, logo ); QFont f = pointSize<8>( p.font() ); @@ -188,15 +150,8 @@ void pluginDescWidget::paintEvent( QPaintEvent * ) p.setFont( pointSize<7>( f ) ); QRect br; p.drawText( 10 + logo_size.width(), 20, width() - 58 - 5, 999, -#ifndef QT3 Qt::TextWordWrap, -#else - Qt::WordBreak, -#endif pluginBrowser::tr( m_pluginDescriptor.description ), -#ifdef QT3 - -1, -#endif &br ); if( m_mouseOver ) { @@ -204,10 +159,6 @@ void pluginDescWidget::paintEvent( QPaintEvent * ) } } -#ifndef QT4 - // blit drawn pixmap to actual widget - bitBlt( this, rect().topLeft(), &pm ); -#endif } diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index 3819ce15c..a03a88105 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -25,21 +25,10 @@ * */ -#include "qt3support.h" - -#ifdef QT4 #include #include -#else - -#include - -#endif - - - #include "preset_preview_play_handle.h" #include "debug.h" #include "engine.h" diff --git a/src/core/setup_dialog.cpp b/src/core/setup_dialog.cpp index f50ebaa1e..fe47d335e 100644 --- a/src/core/setup_dialog.cpp +++ b/src/core/setup_dialog.cpp @@ -25,10 +25,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -38,19 +34,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - #include "setup_dialog.h" #include "tab_bar.h" @@ -167,15 +150,8 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : bufsize_tw->setFixedHeight( 80 ); m_bufSizeSlider = new QSlider( Qt::Horizontal, bufsize_tw ); -#ifdef QT4 m_bufSizeSlider->setRange( 1, 256 ); m_bufSizeSlider->setTickPosition( QSlider::TicksBelow ); -#else - m_bufSizeSlider->setMinimum( 1 ); - m_bufSizeSlider->setMaximum( 256 ); - m_bufSizeSlider->setLineStep( 8 ); - m_bufSizeSlider->setTickmarks( QSlider::Below ); -#endif m_bufSizeSlider->setPageStep( 8 ); m_bufSizeSlider->setTickInterval( 8 ); m_bufSizeSlider->setGeometry( 10, 16, 340, 18 ); @@ -483,11 +459,7 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : "problems (i.e. lot of xruns), try to increase buffer-" "size." ), smp_supp_tw ); smp_help->setFixedSize( performance->width() - 20, 140 ); -#ifndef QT3 smp_help->setWordWrap( TRUE ); -#else - smp_help->setAlignment( Qt::WordBreak ); -#endif smp_help->move( 10, 55 ); @@ -523,9 +495,6 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : // create ifaces-settings-widget QWidget * asw = new QWidget( audio ); asw->setFixedHeight( 60 ); -#ifndef QT4 - asw->setBackgroundMode( NoBackground ); -#endif QHBoxLayout * asw_layout = new QHBoxLayout( asw ); asw_layout->setSpacing( 0 ); @@ -558,31 +527,18 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin(); it != m_audioIfaceSetupWidgets.end(); ++it ) { - m_audioIfaceNames[tr( it.key() -#ifndef QT3 - .toAscii() -#endif - )] = it.key(); + m_audioIfaceNames[tr( it.key().toAscii())] = it.key(); } for( trMap::iterator it = m_audioIfaceNames.begin(); it != m_audioIfaceNames.end(); ++it ) { -#ifdef QT4 QWidget * audioWidget = m_audioIfaceSetupWidgets[it.value()]; -#else - QWidget * audioWidget = m_audioIfaceSetupWidgets[it.data()]; -#endif audioWidget->hide(); asw_layout->addWidget( audioWidget ); m_audioInterfaces->addItem( it.key() ); } -#ifdef QT4 m_audioInterfaces->setCurrentIndex( m_audioInterfaces->findText( tr( engine::getMixer()->audioDevName().toAscii() ) ) ); -#else - m_audioInterfaces->setCurrentText( - tr( engine::getMixer()->audioDevName() ) ); -#endif m_audioIfaceSetupWidgets[engine::getMixer()->audioDevName()]->show(); connect( m_audioInterfaces, SIGNAL( activated( const QString & ) ), @@ -621,9 +577,6 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : // create ifaces-settings-widget QWidget * msw = new QWidget( midi ); msw->setFixedHeight( 60 ); -#ifndef QT4 - msw->setBackgroundMode( NoBackground ); -#endif QHBoxLayout * msw_layout = new QHBoxLayout( msw ); msw_layout->setSpacing( 0 ); @@ -648,32 +601,19 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : for( mswMap::iterator it = m_midiIfaceSetupWidgets.begin(); it != m_midiIfaceSetupWidgets.end(); ++it ) { - m_midiIfaceNames[tr( it.key() -#ifndef QT3 - .toAscii() -#endif - )] = it.key(); + m_midiIfaceNames[tr( it.key().toAscii())] = it.key(); } for( trMap::iterator it = m_midiIfaceNames.begin(); it != m_midiIfaceNames.end(); ++it ) { -#ifdef QT4 QWidget * midiWidget = m_midiIfaceSetupWidgets[it.value()]; -#else - QWidget * midiWidget = m_midiIfaceSetupWidgets[it.data()]; -#endif midiWidget->hide(); msw_layout->addWidget( midiWidget ); m_midiInterfaces->addItem( it.key() ); } -#ifdef QT4 m_midiInterfaces->setCurrentIndex( m_midiInterfaces->findText( tr( engine::getMixer()->midiClientName().toAscii() ) ) ); -#else - m_midiInterfaces->setCurrentText( - tr( engine::getMixer()->midiClientName() ) ); -#endif m_midiIfaceSetupWidgets[engine::getMixer()->midiClientName()]->show(); connect( m_midiInterfaces, SIGNAL( activated( const QString & ) ), @@ -686,10 +626,6 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : midi_layout->addStretch(); -#ifndef QT4 -#define setIcon setPixmap -#endif - m_tabBar->addTab( general, tr( "General settings" ), 0, FALSE, TRUE )->setIcon( embed::getIconPixmap( "setup_general" ) ); m_tabBar->addTab( directories, tr( "Directories" ), 1, FALSE, TRUE @@ -799,21 +735,13 @@ void setupDialog::accept( void ) for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin(); it != m_audioIfaceSetupWidgets.end(); ++it ) { -#ifdef QT4 it.value()->saveSettings(); -#else - it.data()->saveSettings(); -#endif } // tell all MIDI-settings-widget to save their settings for( mswMap::iterator it = m_midiIfaceSetupWidgets.begin(); it != m_midiIfaceSetupWidgets.end(); ++it ) { -#ifdef QT4 it.value()->saveSettings(); -#else - it.data()->saveSettings(); -#endif } configManager::inst()->saveConfigFile(); @@ -875,11 +803,7 @@ void setupDialog::resetBufSize( void ) void setupDialog::displayBufSizeHelp( void ) { -#ifdef QT4 QWhatsThis::showText( QCursor::pos(), -#else - QWhatsThis::display( -#endif tr( "Here you can setup the internal buffer-size " "used by LMMS. Smaller values result " "in a lower latency but also may cause " @@ -973,16 +897,9 @@ void setupDialog::setParallelizingLevel( int _level ) void setupDialog::openWorkingDir( void ) { -#ifdef QT4 QString new_dir = QFileDialog::getExistingDirectory( this, tr( "Choose LMMS working directory" ), m_workingDir ); -#else - QString new_dir = QFileDialog::getExistingDirectory( m_workingDir, - 0, 0, - tr( "Choose LMMS working directory" ), - TRUE ); -#endif if( new_dir != QString::null ) { m_wdLineEdit->setText( new_dir ); @@ -1002,15 +919,9 @@ void setupDialog::setWorkingDir( const QString & _wd ) void setupDialog::openVSTDir( void ) { -#ifdef QT4 QString new_dir = QFileDialog::getExistingDirectory( this, tr( "Choose your VST-plugin directory" ), m_vstDir ); -#else - QString new_dir = QFileDialog::getExistingDirectory( m_vstDir, 0, 0, - tr( "Choose your VST-plugin directory" ), - TRUE ); -#endif if( new_dir != QString::null ) { m_vdLineEdit->setText( new_dir ); @@ -1030,15 +941,9 @@ void setupDialog::setVSTDir( const QString & _vd ) void setupDialog::openArtworkDir( void ) { -#ifdef QT4 QString new_dir = QFileDialog::getExistingDirectory( this, tr( "Choose artwork-theme directory" ), m_artworkDir ); -#else - QString new_dir = QFileDialog::getExistingDirectory( m_artworkDir, - 0, 0, - tr( "Choose artwork-theme directory" ), TRUE ); -#endif if( new_dir != QString::null ) { m_adLineEdit->setText( new_dir ); @@ -1058,14 +963,9 @@ void setupDialog::setArtworkDir( const QString & _ad ) void setupDialog::openFLDir( void ) { -#ifdef QT4 QString new_dir = QFileDialog::getExistingDirectory( this, tr( "Choose FL Studio installation directory" ), m_flDir ); -#else - QString new_dir = QFileDialog::getExistingDirectory( m_flDir, 0, 0, - tr( "Choose FL Studio installation directory" ), TRUE ); -#endif if( new_dir != QString::null ) { m_fdLineEdit->setText( new_dir ); @@ -1077,14 +977,9 @@ void setupDialog::openFLDir( void ) void setupDialog::openLADSPADir( void ) { -#ifdef QT4 QString new_dir = QFileDialog::getExistingDirectory( this, tr( "Choose LADSPA plugin directory" ), m_ladDir ); -#else - QString new_dir = QFileDialog::getExistingDirectory( m_ladDir, 0, 0, - tr( "Choose LADSPA plugin directory" ), TRUE ); -#endif if( new_dir != QString::null ) { if( m_ladLineEdit->text() == "" ) @@ -1105,14 +1000,9 @@ void setupDialog::openLADSPADir( void ) void setupDialog::openSTKDir( void ) { #ifdef HAVE_STK_H -#ifdef QT4 QString new_dir = QFileDialog::getExistingDirectory( this, tr( "Choose STK rawwave directory" ), m_ladDir ); -#else - QString new_dir = QFileDialog::getExistingDirectory( m_ladDir, 0, 0, - tr( "Choose STK rawwave directory" ), TRUE ); -#endif if( new_dir != QString::null ) { m_stkLineEdit->setText( new_dir ); @@ -1154,11 +1044,7 @@ void setupDialog::audioInterfaceChanged( const QString & _iface ) for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin(); it != m_audioIfaceSetupWidgets.end(); ++it ) { -#ifdef QT4 it.value()->hide(); -#else - it.data()->hide(); -#endif } m_audioIfaceSetupWidgets[m_audioIfaceNames[_iface]]->show(); @@ -1169,11 +1055,7 @@ void setupDialog::audioInterfaceChanged( const QString & _iface ) void setupDialog::displayAudioHelp( void ) { -#ifdef QT4 QWhatsThis::showText( QCursor::pos(), -#else - QWhatsThis::display( -#endif tr( "Here you can select your preferred " "audio-interface. Depending on the " "configuration of your system during " @@ -1192,11 +1074,7 @@ void setupDialog::midiInterfaceChanged( const QString & _iface ) for( mswMap::iterator it = m_midiIfaceSetupWidgets.begin(); it != m_midiIfaceSetupWidgets.end(); ++it ) { -#ifdef QT4 it.value()->hide(); -#else - it.data()->hide(); -#endif } m_midiIfaceSetupWidgets[m_midiIfaceNames[_iface]]->show(); @@ -1207,11 +1085,7 @@ void setupDialog::midiInterfaceChanged( const QString & _iface ) void setupDialog::displayMIDIHelp( void ) { -#ifdef QT4 QWhatsThis::showText( QCursor::pos(), -#else - QWhatsThis::display( -#endif tr( "Here you can select your preferred " "MIDI-interface. Depending on the " "configuration of your system during " diff --git a/src/core/song_editor.cpp b/src/core/song_editor.cpp index 18c0b6b79..d7f74e6e3 100644 --- a/src/core/song_editor.cpp +++ b/src/core/song_editor.cpp @@ -32,10 +32,6 @@ #include -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -46,25 +42,9 @@ #include #include #include +#include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define addButton insert -#define setCheckable setToggleButton - -#endif - #include "song_editor.h" #include "automatable_object_templates.h" @@ -129,11 +109,7 @@ songEditor::songEditor( void ) : w->move( 210, 10 ); } -#ifdef QT4 setFocusPolicy( Qt::StrongFocus ); -#else - setFocusPolicy( StrongFocus ); -#endif setFocus(); QWidget * cw = new QWidget( this ); @@ -167,11 +143,7 @@ songEditor::songEditor( void ) : SLOT( setModified() ) ); toolTip::add( m_bpmSpinBox, tr( "tempo of song" ) ); -#ifdef QT4 m_bpmSpinBox->setWhatsThis( -#else - QWhatsThis::add( m_bpmSpinBox, -#endif tr( "The tempo of a song is specified in beats per minute " "(BPM). If you want to change the tempo of your " "song, change this value. Every tact has four beats, " @@ -219,11 +191,7 @@ songEditor::songEditor( void ) : m_masterVolumeSlider->setRange( 0, 200 ); m_masterVolumeSlider->setPageStep( 1 ); m_masterVolumeSlider->setInitValue( 100 ); -#ifdef QT4 m_masterVolumeSlider->setTickPosition( QSlider::TicksLeft ); -#else - m_masterVolumeSlider->setTickPosition( QSlider::Left ); -#endif m_masterVolumeSlider->setFixedSize( 26, 60 ); m_masterVolumeSlider->setTickInterval( 50 ); toolTip::add( m_masterVolumeSlider, tr( "master volume" ) ); @@ -257,11 +225,7 @@ songEditor::songEditor( void ) : m_masterPitchSlider->setRange( -12, 12 ); m_masterPitchSlider->setPageStep( 1 ); m_masterPitchSlider->setInitValue( 0 ); -#ifdef QT4 m_masterPitchSlider->setTickPosition( QSlider::TicksLeft ); -#else - m_masterPitchSlider->setTickPosition( QSlider::Left ); -#endif m_masterPitchSlider->setFixedSize( 26, 60 ); m_masterPitchSlider->setTickInterval( 12 ); toolTip::add( m_masterPitchSlider, tr( "master pitch" ) ); @@ -303,26 +267,17 @@ songEditor::songEditor( void ) : m_toolBar = new QWidget( cw ); m_toolBar->setFixedHeight( 32 ); m_toolBar->move( 0, 0 ); -#ifdef QT4 m_toolBar->setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( m_toolBar->backgroundRole(), embed::getIconPixmap( "toolbar_bg" ) ); m_toolBar->setPalette( pal ); -#else - m_toolBar->setPaletteBackgroundPixmap( embed::getIconPixmap( - "toolbar_bg" ) ); -#endif QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar ); tb_layout->setMargin( 0 ); tb_layout->setSpacing( 0 ); -#ifdef QT4 containerWidget()->setParent( cw ); -#else - containerWidget()->reparent( cw, 0, QPoint( 0, 0 ) ); -#endif containerWidget()->move( 0, m_toolBar->height() + tl->height() ); @@ -365,13 +320,9 @@ songEditor::songEditor( void ) : tool_button_group->addButton( m_drawModeButton ); tool_button_group->addButton( m_editModeButton ); tool_button_group->setExclusive( TRUE ); -#ifndef QT4 - tool_button_group->hide(); -#endif - -#ifdef QT4 -#else +#if 0 +#warning TODO QWhatsThis::add( m_playButton, tr( "Click here, if you want to play " "your whole song. Playing will " "be started at the " @@ -431,12 +382,8 @@ songEditor::songEditor( void ) : m_leftRightScroll = new QScrollBar( Qt::Horizontal, cw ); m_leftRightScroll->setMinimum( 0 ); m_leftRightScroll->setMaximum( 0 ); -#ifndef QT3 m_leftRightScroll->setSingleStep( 1 ); m_leftRightScroll->setPageStep( 20 ); -#else - m_leftRightScroll->setSteps( 1, 20 ); -#endif connect( m_leftRightScroll, SIGNAL( valueChanged( int ) ), this, SLOT( scrolled( int ) ) ); @@ -1136,11 +1083,7 @@ void songEditor::play( void ) return; } } -#ifdef QT4 m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); -#else - m_playButton->setPixmap( embed::getIconPixmap( "pause" ) ); -#endif m_actions.push_back( ACT_PLAY_SONG ); } @@ -1237,11 +1180,7 @@ void songEditor::updateTimeLinePosition( void ) void songEditor::stop( void ) { m_actions.push_back( ACT_STOP_PLAY ); -#ifdef QT4 m_playButton->setIcon( embed::getIconPixmap( "play" ) ); -#else - m_playButton->setPixmap( embed::getIconPixmap( "play" ) ); -#endif m_scrollBack = TRUE; } @@ -1253,11 +1192,7 @@ void songEditor::stop( void ) void songEditor::pause( void ) { m_actions.push_back( ACT_PAUSE ); -#ifdef QT4 m_playButton->setIcon( embed::getIconPixmap( "play" ) ); -#else - m_playButton->setPixmap( embed::getIconPixmap( "play" ) ); -#endif } @@ -1266,11 +1201,7 @@ void songEditor::pause( void ) void songEditor::resumeFromPause( void ) { m_actions.push_back( ACT_RESUME_FROM_PAUSE ); -#ifdef QT4 m_playButton->setIcon( embed::getIconPixmap( "pause" ) ); -#else - m_playButton->setPixmap( embed::getIconPixmap( "pause" ) ); -#endif } @@ -1370,30 +1301,11 @@ bool songEditor::mayChangeProject( void ) return( TRUE ); } -/* int answer = QMessageBox:: -#if QT_VERSION >= 0x030200 - question -#else - information -#endif - ( engine::getMainWindow(), - tr( "Project not saved" ), - tr( "The current project was " - "modified since last " - "saving. Do you want " - "to save it now?" ), - QMessageBox::Yes, - QMessageBox::No, - QMessageBox::Cancel );*/ QMessageBox mb ( tr( "Project not saved" ), tr( "The current project was modified since " "last saving. Do you want to save it " "now?" ), -#if QT_VERSION >= 0x030200 QMessageBox::Question, -#else - QMessageBox::Information, -#endif QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel, @@ -1662,14 +1574,8 @@ bool FASTCALL songEditor::saveProjectAs( const QString & _file_name ) void songEditor::importProject( void ) { -#ifdef QT4 QFileDialog ofd( this, tr( "Import file" ), ""/*, tr( "MIDI-files (*.mid)" )*/ ); -#else - QFileDialog ofd( QString::null,/* tr( "MIDI-files (*.mid)" )*/ QString::null, - this, "", TRUE ); - ofd.setWindowTitle( tr( "Import file" ) ); -#endif ofd.setDirectory( configManager::inst()->userProjectsDir() ); ofd.setFileMode( QFileDialog::ExistingFiles ); if( ofd.exec () == QDialog::Accepted && !ofd.selectedFiles().isEmpty() ) @@ -1679,6 +1585,12 @@ void songEditor::importProject( void ) } +#warning TODO: move somewhere else +static inline QString baseName( const QString & _file ) +{ + return( QFileInfo( _file ).absolutePath() + "/" + + QFileInfo( _file ).completeBaseName() ); +} void songEditor::exportProject( void ) @@ -1699,7 +1611,6 @@ void songEditor::exportProject( void ) efd.setFileMode( QFileDialog::AnyFile ); int idx = 0; -#ifdef QT4 QStringList types; while( fileEncodeDevices[idx].m_fileType != NULL_FILE ) { @@ -1708,30 +1619,13 @@ void songEditor::exportProject( void ) } efd.setFilters( types ); efd.selectFile( base_filename ); -#else - while( fileEncodeDevices[idx].m_fileType != NULL_FILE ) - { - efd.addFilter( tr( fileEncodeDevices[idx].m_description ) ); - ++idx; - } - efd.setSelectedFilter( tr( fileEncodeDevices[0].m_description ) ); - efd.setSelection( base_filename ); -#endif efd.setWindowTitle( tr( "Select file for project-export..." ) ); if( efd.exec() == QDialog::Accepted && -#ifdef QT4 !efd.selectedFiles().isEmpty() && efd.selectedFiles()[0] != "" -#else - efd.selectedFile() != "" -#endif ) { -#ifdef QT4 const QString export_file_name = efd.selectedFiles()[0]; -#else - const QString export_file_name = efd.selectedFile(); -#endif if( QFileInfo( export_file_name ).exists() == TRUE && QMessageBox::warning( engine::getMainWindow(), tr( "File already exists" ), @@ -1768,10 +1662,4 @@ void songEditor::updateFramesPerTact64th( void ) #include "song_editor.moc" -#ifdef QT3 -#undef addButton -#undef setCheckable -#endif - - #endif diff --git a/src/core/surround_area.cpp b/src/core/surround_area.cpp index bdc1e8e43..44ca28dfb 100644 --- a/src/core/surround_area.cpp +++ b/src/core/surround_area.cpp @@ -26,10 +26,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -37,17 +33,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include - -#endif - #include @@ -68,11 +53,7 @@ QPixmap * surroundArea::s_backgroundArtwork = NULL; surroundArea::surroundArea( QWidget * _parent, const QString & _name, track * _track ) : - QWidget( _parent -#ifndef QT4 - , _name.ascii() -#endif - ), + QWidget( _parent ), m_sndSrcPos( QPoint() ) { m_position_x = new knob( knobDark_28, NULL, tr ( "Surround area X" ), @@ -98,11 +79,7 @@ surroundArea::surroundArea( QWidget * _parent, const QString & _name, setFixedSize( s_backgroundArtwork->width(), s_backgroundArtwork->height() ); -#ifdef QT4 setAccessibleName( _name ); -#else - setBackgroundMode( Qt::NoBackground ); -#endif toolTip::add( this, tr( "click to where this channel should be audible" ) ); } @@ -188,15 +165,7 @@ void surroundArea::contextMenuEvent( QContextMenuEvent * ) mouseReleaseEvent( NULL ); QMenu contextMenu( this ); -#ifdef QT4 contextMenu.setTitle( accessibleName() ); -#else - QLabel * caption = new QLabel( "" + - QString( accessibleName() ) + "", this ); - caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); - caption->setAlignment( Qt::AlignCenter ); - contextMenu.addAction( caption ); -#endif contextMenu.addAction( embed::getIconPixmap( "automation" ), tr( "Open &X in automation editor" ), m_position_x->getAutomationPattern(), @@ -213,7 +182,6 @@ void surroundArea::contextMenuEvent( QContextMenuEvent * ) void surroundArea::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); if( s_backgroundArtwork->size() != size() ) { @@ -226,20 +194,6 @@ void surroundArea::paintEvent( QPaintEvent * ) Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); } -#else - QPixmap pm; - if( s_backgroundArtwork->size() != size() ) - { - pm.convertFromImage( - s_backgroundArtwork->convertToImage().smoothScale( - width(), height() ) ); - } - else - { - pm = *s_backgroundArtwork; - } - QPainter p( &pm ); -#endif const int x = ( width() + m_sndSrcPos.x() * ( width() - 4 ) / SURROUND_AREA_SIZE ) / 2; const int y = ( height() + m_sndSrcPos.y() * ( height() - 4 ) / @@ -250,11 +204,6 @@ void surroundArea::paintEvent( QPaintEvent * ) p.drawPoint( x, y ); p.drawPoint( x + 1, y ); p.drawPoint( x, y + 1 ); - -#ifndef QT4 - // blit drawn pixmap to actual widget - bitBlt( this, rect().topLeft(), &pm ); -#endif } diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 8c63b5a1c..3c76e105f 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -25,10 +25,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -36,16 +32,6 @@ #include #include -#else - -#include -#include -#include -#include -#include - -#endif - #include "timeline.h" #include "embed.h" @@ -111,10 +97,6 @@ timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt, m_xOffset -= s_posMarkerPixmap->width() / 2; -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif - m_pos.m_timeLine = this; QTimer * update_timer = new QTimer( this ); @@ -247,13 +229,7 @@ void timeLine::toggleBehaviourAtStop( int _n ) void timeLine::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( rect().size() ); - - QPainter p( &draw_pm, this ); -#endif for( int x = 0; x < width(); x += s_timeLinePixmap->width() ) { @@ -290,11 +266,6 @@ void timeLine::paintEvent( QPaintEvent * ) } p.drawPixmap( m_posMarkerX, 4, *s_posMarkerPixmap ); - -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } diff --git a/src/core/track.cpp b/src/core/track.cpp index d37d3899f..8646f79e9 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -26,27 +26,12 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include #include -#else - -#include -#include -#include -#include -#include -#include - -#endif - #include "track.h" #include "automation_pattern.h" @@ -87,11 +72,7 @@ textFloat * trackContentObject::s_textFloat = NULL; // trackContentObject // =========================================================================== trackContentObject::trackContentObject( track * _track ) : - selectableObject( _track->getTrackContentWidget() -#ifdef QT3 - , Qt::WDestructiveClose -#endif - ), + selectableObject( _track->getTrackContentWidget() ), m_track( _track ), m_startPosition(), m_length(), @@ -107,12 +88,8 @@ trackContentObject::trackContentObject( track * _track ) : s_textFloat->setPixmap( embed::getIconPixmap( "clock" ) ); } -#ifdef QT4 setAttribute( Qt::WA_DeleteOnClose ); setFocusPolicy( Qt::StrongFocus ); -#else - setFocusPolicy( StrongFocus ); -#endif show(); setJournalling( FALSE ); @@ -259,17 +236,10 @@ void trackContentObject::mousePressEvent( QMouseEvent * _me ) // start drag-action multimediaProject mmp( multimediaProject::DRAG_N_DROP_DATA ); saveState( mmp, mmp.content() ); -#ifdef QT4 QPixmap thumbnail = QPixmap::grabWidget( this ).scaled( 128, 128, Qt::KeepAspectRatio, Qt::SmoothTransformation ); -#else - QSize s( size() ); - s.scale( 128, 128, QSize::ScaleMin ); - QPixmap thumbnail = QPixmap::grabWidget( this ). - convertToImage().smoothScale( s ); -#endif new stringPairDrag( QString( "tco_%1" ).arg( m_track->type() ), mmp.toString(), thumbnail, this ); } @@ -361,13 +331,13 @@ void trackContentObject::mouseMoveEvent( QMouseEvent * _me ) else if( m_action == MOVE_SELECTION ) { const int dx = _me->x() - m_initialMouseX; - vvector so = + QVector so = m_track->getTrackContainer()->selectedObjects(); - vvector tcos; + QVector tcos; midiTime smallest_pos; // find out smallest position of all selected objects for not // moving an object before zero - for( vvector::iterator it = so.begin(); + for( QVector::iterator it = so.begin(); it != so.end(); ++it ) { trackContentObject * tco = @@ -381,7 +351,7 @@ void trackContentObject::mouseMoveEvent( QMouseEvent * _me ) (Sint32)tco->startPosition() + static_cast( dx * 64 / ppt ) ); } - for( vvector::iterator it = tcos.begin(); + for( QVector::iterator it = tcos.begin(); it != tcos.end(); ++it ) { ( *it )->movePosition( ( *it )->startPosition() + @@ -455,10 +425,6 @@ void trackContentObject::mouseReleaseEvent( QMouseEvent * _me ) -#ifdef QT3 -#define addSeparator insertSeparator -#endif - void trackContentObject::contextMenuEvent( QContextMenuEvent * _cme ) { QMenu contextMenu( this ); @@ -596,14 +562,10 @@ trackContentWidget::trackContentWidget( trackWidget * _parent ) : QWidget( _parent ), m_trackWidget( _parent ) { -#ifdef QT4 setAutoFillBackground( TRUE ); QPalette pal; pal.setColor( backgroundRole(), QColor( 96, 96, 96 ) ); setPalette( pal ); -#else - setPaletteBackgroundColor( QColor( 96, 96, 96 ) ); -#endif setAcceptDrops( TRUE ); } @@ -617,7 +579,7 @@ trackContentWidget::~trackContentWidget() -trackContentObject * trackContentWidget::getTCO( csize _tco_num ) +trackContentObject * trackContentWidget::getTCO( int _tco_num ) { if( _tco_num < m_trackContentObjects.size() ) { @@ -632,7 +594,7 @@ trackContentObject * trackContentWidget::getTCO( csize _tco_num ) -csize trackContentWidget::numOfTCOs( void ) +int trackContentWidget::numOfTCOs( void ) { return( m_trackContentObjects.size() ); } @@ -660,7 +622,7 @@ trackContentObject * trackContentWidget::addTCO( trackContentObject * _tco ) -void trackContentWidget::removeTCO( csize _tco_num, bool _also_delete ) +void trackContentWidget::removeTCO( int _tco_num, bool _also_delete ) { removeTCO( getTCO( _tco_num ), _also_delete ); } @@ -708,7 +670,7 @@ void trackContentWidget::removeAllTCOs( void ) -void trackContentWidget::swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 ) +void trackContentWidget::swapPositionOfTCOs( int _tco_num1, int _tco_num2 ) { // TODO: range-checking qSwap( m_trackContentObjects[_tco_num1], @@ -850,17 +812,8 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me ) void trackContentWidget::paintEvent( QPaintEvent * _pe ) { -#ifdef QT4 QPainter p( this ); p.fillRect( rect(), QColor( 96, 96, 96 ) ); -#else - // create pixmap for whole widget - QPixmap pm( rect().size() ); - pm.fill( QColor( 96, 96, 96 ) ); - - // and a painter for it - QPainter p( &pm ); -#endif const trackContainer * tc = getTrack()->getTrackContainer(); const int offset = (int)( ( tc->currentPosition() % 4 ) * tc->pixelsPerTact() ); @@ -870,11 +823,6 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe ) { p.drawLine( x, 0, x, height() ); } - -#ifndef QT4 - // blit drawn pixmap to actual widget - bitBlt( this, rect().topLeft(), &pm ); -#endif } @@ -1008,11 +956,7 @@ trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) : SLOT( setMuted( bool ) ) ); connect( m_muteBtn, SIGNAL( clickedRight() ), this, SLOT( muteBtnRightClicked() ) ); -#ifdef QT4 m_muteBtn->setWhatsThis( -#else - QWhatsThis::add( m_muteBtn, -#endif tr( "With this switch you can either mute this track or mute " "all other tracks.\nBy clicking left, this track is " "muted. This is useful, if you only want to listen to " @@ -1077,17 +1021,8 @@ void trackOperationsWidget::mousePressEvent( QMouseEvent * _me ) void trackOperationsWidget::paintEvent( QPaintEvent * _pe ) { -#ifdef QT4 QPainter p( this ); p.fillRect( rect(), QColor( 128, 128, 128 ) ); -#else - // create pixmap for whole widget - QPixmap pm( rect().size() ); - pm.fill( QColor( 128, 128, 128 ) ); - - // and a painter for it - QPainter p( &pm ); -#endif if( m_trackWidget->isMovingTrack() == FALSE ) { p.drawPixmap( 2, 2, *s_grip ); @@ -1110,13 +1045,8 @@ 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( @@ -1130,11 +1060,6 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe ) m_trackOps->hide(); m_muteBtn->hide(); } - -#ifndef QT4 - // blit drawn pixmap to actual widget - bitBlt( this, rect().topLeft(), &pm ); -#endif } @@ -1184,12 +1109,7 @@ void trackOperationsWidget::muteBtnRightClicked( void ) void trackOperationsWidget::updateMenu( void ) { - QMenu * to_menu = m_trackOps-> -#ifndef QT3 - menu(); -#else - popup(); -#endif + QMenu * to_menu = m_trackOps->menu(); to_menu->clear(); if( inBBEditor() ) { @@ -1271,31 +1191,18 @@ trackWidget::trackWidget( track * _track, QWidget * _parent ) : m_trackContentWidget( this ), m_action( NONE ) { -#ifdef QT4 m_trackOperationsWidget.setAutoFillBackground( TRUE ); QPalette pal; pal.setColor( m_trackOperationsWidget.backgroundRole(), QColor( 128, 128, 128 ) ); m_trackOperationsWidget.setPalette( pal ); -#else - m_trackOperationsWidget.setPaletteBackgroundColor( - QColor( 128, 128, 128 ) ); -#endif - -#ifdef QT4 m_trackSettingsWidget.setAutoFillBackground( TRUE ); pal.setColor( m_trackSettingsWidget.backgroundRole(), QColor( 64, 64, 64 ) ); m_trackSettingsWidget.setPalette( pal ); -#else - m_trackSettingsWidget.setPaletteBackgroundColor( QColor( 64, 64, 64 ) ); - - // set background-mode for flicker-free redraw - setBackgroundMode( Qt::NoBackground ); -#endif setAcceptDrops( TRUE ); } @@ -1340,9 +1247,9 @@ void trackWidget::changePosition( const midiTime & _new_pos ) const Sint32 begin = pos; const Sint32 end = endPosition( pos ); const float ppt = m_track->getTrackContainer()->pixelsPerTact(); - const csize tcos = m_trackContentWidget.numOfTCOs(); + const int tcos = m_trackContentWidget.numOfTCOs(); - for( csize i = 0; i < tcos; ++i ) + for( int i = 0; i < tcos; ++i ) { trackContentObject * tco = m_trackContentWidget.getTCO( i ); tco->changeLength( tco->length() ); @@ -1526,23 +1433,9 @@ void trackWidget::mouseReleaseEvent( QMouseEvent * _me ) void trackWidget::paintEvent( QPaintEvent * _pe ) { -#ifdef QT4 QPainter p( this ); -#else - // create pixmap for whole widget - QPixmap pm( rect().size() ); - pm.fill( QColor( 224, 224, 224 ) ); - - // and a painter for it - QPainter p( &pm ); -#endif p.setPen( QColor( 0, 0, 0 ) ); p.drawLine( 0, height() - 1, width() - 1, height() - 1 ); - -#ifndef QT4 - // blit drawn pixmap to actual widget - bitBlt( this, rect().topLeft(), &pm ); -#endif } @@ -1627,7 +1520,7 @@ track::~track() m_trackWidget = NULL; } - for( vlist::iterator it = + for( QList::iterator it = m_automation_patterns.begin(); it != m_automation_patterns.end(); ++it ) @@ -1694,7 +1587,7 @@ tact track::length( void ) const void track::saveSettings( QDomDocument & _doc, QDomElement & _this ) { - csize num_of_tcos = getTrackContentWidget()->numOfTCOs(); + int num_of_tcos = getTrackContentWidget()->numOfTCOs(); _this.setTagName( "track" ); _this.setAttribute( "type", type() ); @@ -1708,7 +1601,7 @@ void track::saveSettings( QDomDocument & _doc, QDomElement & _this ) saveTrackSpecificSettings( _doc, ts_de ); // now save settings of all TCO's - for( csize i = 0; i < num_of_tcos; ++i ) + for( int i = 0; i < num_of_tcos; ++i ) { trackContentObject * tco = getTCO( i ); tco->saveState( _doc, _this ); @@ -1774,7 +1667,7 @@ trackContentObject * track::addTCO( trackContentObject * _tco ) -void track::removeTCO( csize _tco_num ) +void track::removeTCO( int _tco_num ) { getTrackContentWidget()->removeTCO( _tco_num ); } @@ -1782,7 +1675,7 @@ void track::removeTCO( csize _tco_num ) -csize track::numOfTCOs( void ) +int track::numOfTCOs( void ) { return( getTrackContentWidget()->numOfTCOs() ); } @@ -1790,7 +1683,7 @@ csize track::numOfTCOs( void ) -trackContentObject * track::getTCO( csize _tco_num ) +trackContentObject * track::getTCO( int _tco_num ) { return( getTrackContentWidget()->getTCO( _tco_num ) ); @@ -1799,9 +1692,9 @@ trackContentObject * track::getTCO( csize _tco_num ) -csize track::getTCONum( trackContentObject * _tco ) +int track::getTCONum( trackContentObject * _tco ) { - for( csize i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i ) + for( int i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i ) { if( getTCO( i ) == _tco ) { @@ -1815,11 +1708,11 @@ csize track::getTCONum( trackContentObject * _tco ) -void track::getTCOsInRange( vlist & _tco_v, +void track::getTCOsInRange( QList & _tco_v, const midiTime & _start, const midiTime & _end ) { - for( csize i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i ) + for( int i = 0; i < getTrackContentWidget()->numOfTCOs(); ++i ) { trackContentObject * tco = getTCO( i ); Sint32 s = tco->startPosition(); @@ -1830,7 +1723,7 @@ void track::getTCOsInRange( vlist & _tco_v, // now let's search according position for TCO in list // -> list is ordered by TCO's position afterwards bool inserted = FALSE; - for( vlist::iterator it = + for( QList::iterator it = _tco_v.begin(); it != _tco_v.end(); ++it ) { @@ -1853,7 +1746,7 @@ void track::getTCOsInRange( vlist & _tco_v, -void track::swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 ) +void track::swapPositionOfTCOs( int _tco_num1, int _tco_num2 ) { getTrackContentWidget()->swapPositionOfTCOs( _tco_num1, _tco_num2 ); } @@ -1879,7 +1772,7 @@ void track::removeAutomationPattern( automationPattern * _pattern ) void track::sendMidiTime( const midiTime & _time ) { - for( vlist::iterator it = + for( QList::iterator it = m_automation_patterns.begin(); it != m_automation_patterns.end(); ++it ) diff --git a/src/core/track_container.cpp b/src/core/track_container.cpp index 2ec1e93c9..a15749472 100644 --- a/src/core/track_container.cpp +++ b/src/core/track_container.cpp @@ -26,26 +26,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include - -#define setValue setProgress -#define maximum totalSteps - -#endif - #include "track_container.h" #include "bb_track.h" @@ -68,23 +53,17 @@ trackContainer::trackContainer( void ) : - QMainWindow( engine::getMainWindow()->workspace() -#ifdef QT3 - , 0, Qt::WStyle_Title -#endif - ), + QMainWindow( engine::getMainWindow()->workspace() ), m_currentPosition( 0, 0 ), m_scrollArea( new scrollArea( this ) ), m_ppt( DEFAULT_PIXELS_PER_TACT ), m_rubberBand( new rubberBand( m_scrollArea ) ), m_origin() { -#ifdef QT4 if( engine::getMainWindow()->workspace() != NULL ) { engine::getMainWindow()->workspace()->addWindow( this ); } -#endif m_scrollArea->show(); m_rubberBand->hide(); @@ -134,40 +113,23 @@ void trackContainer::loadSettings( const QDomElement & _this ) int start_val = 0; if( pd == NULL ) { -#ifdef QT4 pd = new QProgressDialog( tr( "Loading project..." ), tr( "Cancel" ), 0, _this.childNodes().count() ); -#else - pd = new QProgressDialog( tr( "Loading project..." ), - tr( "Cancel" ), - _this.childNodes().count(), - 0, 0, TRUE ); -#endif pd->setWindowTitle( tr( "Please wait..." ) ); pd->show(); } else { -#ifdef QT4 start_val = pd->value(); pd->setMaximum( pd->maximum() + _this.childNodes().count() ); -#else - start_val = pd->progress(); - pd->setTotalSteps( pd->maximum() + _this.childNodes().count() ); -#endif } QDomNode node = _this.firstChild(); while( !node.isNull() ) { -#ifdef QT4 pd->setValue( pd->value() + 1 ); qApp->processEvents( QEventLoop::AllEvents, 100 ); -#else - pd->setValue( pd->progress() + 1 ); - qApp->processEvents( 100 ); -#endif if( pd->wasCanceled() ) { @@ -203,9 +165,6 @@ void trackContainer::addTrack( track * _track ) addJournalEntry( journalEntry( ADD_TRACK, map ) ); m_trackWidgets.push_back( _track->getTrackWidget() ); -#ifndef QT4 - m_scrollArea->addChild( _track->getTrackWidget() ); -#endif connect( this, SIGNAL( positionChanged( const midiTime & ) ), _track->getTrackWidget(), SLOT( changePosition( const midiTime & ) ) ); @@ -228,9 +187,6 @@ void trackContainer::removeTrack( track * _track ) map["state"] = mmp.toString(); addJournalEntry( journalEntry( REMOVE_TRACK, map ) ); -#ifndef QT4 - m_scrollArea->removeChild( _track->getTrackWidget() ); -#endif m_trackWidgets.erase( it ); delete _track; @@ -301,19 +257,12 @@ void trackContainer::realignTracks( bool _complete_update ) { ( *it )->show(); ( *it )->update(); -#ifdef QT4 ( *it )->move( 0, y ); -#else - m_scrollArea->moveChild( *it, 0, y ); -#endif ( *it )->resize( width() - DEFAULT_SCROLLBAR_SIZE, ( *it )->height() ); ( *it )->changePosition( m_currentPosition ); y += ( *it )->height(); } -#ifdef QT3 - m_scrollArea->resizeContents( width() - DEFAULT_SCROLLBAR_SIZE, y ); -#endif updateScrollArea(); } @@ -333,12 +282,7 @@ void trackContainer::clearAllTracks( void ) const trackWidget * trackContainer::trackWidgetAt( const int _y ) const { - const int abs_y = _y + -#ifndef QT3 - m_scrollArea->viewport()->y(); -#else - m_scrollArea->contentsY(); -#endif + const int abs_y = _y + m_scrollArea->viewport()->y(); int y_cnt = 0; for( trackWidgetVector::const_iterator it = m_trackWidgets.begin(); it != m_trackWidgets.end(); ++it ) @@ -615,20 +559,8 @@ trackContainer::scrollArea::scrollArea( trackContainer * _parent ) : m_trackContainer( _parent ) { setFrameStyle( QFrame::NoFrame ); - setHorizontalScrollBarPolicy( -#ifdef QT4 - Qt::ScrollBarAlwaysOff -#else - QScrollArea::AlwaysOff -#endif - ); - setVerticalScrollBarPolicy( -#ifdef QT4 - Qt::ScrollBarAlwaysOn -#else - QScrollArea::AlwaysOn -#endif - ); + setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); } diff --git a/src/lib/base64.cpp b/src/lib/base64.cpp index 1362596cb..b8391bd0c 100644 --- a/src/lib/base64.cpp +++ b/src/lib/base64.cpp @@ -4,7 +4,7 @@ * base64.cpp - namespace base64 with methods for encoding/decoding binary data * to/from base64 * - * Copyright (c) 2006 Tobias Doerffel + * Copyright (c) 2006-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -30,152 +30,9 @@ #include "base64.h" #include "types.h" -#ifndef QT3 - #include #include -#else - -#include -#include - - -namespace base64 -{ - - -void encode( const char * _data, const int _size, QString & _dst ) -{ - // code mostly taken from - // qt-x11-opensource-src-4.0.1/src/corelib/tools/qbytearray.cpp - - const char alphabet[] = "ABCDEFGH" "IJKLMNOP" "QRSTUVWX" "YZabcdef" - "ghijklmn" "opqrstuv" "wxyz0123" "456789+/"; - const char padchar = '='; - int padlen = 0; - - const int dsize = ( ( _size * 4 ) / 3 ) + 3; - char * ptr = new char[dsize + 1]; - char * out = ptr; - - int i = 0; - while( i < _size ) - { - Uint32 chunk = 0; - chunk |= Uint32( Uint8( _data[i++] ) ) << 16; - if( i == dsize ) - { - padlen = 2; - } - else - { - chunk |= Uint32( Uint8( _data[i++] ) ) << 8; - if( i == _size ) - { - padlen = 1; - } - else - { - chunk |= Uint32( Uint8( _data[i++] ) ); - } - } - - Uint32 j = ( chunk & 0x00fc0000 ) >> 18; - Uint32 k = ( chunk & 0x0003f000 ) >> 12; - Uint32 l = ( chunk & 0x00000fc0 ) >> 6; - Uint32 m = ( chunk & 0x0000003f ); - *out++ = alphabet[j]; - *out++ = alphabet[k]; - if( padlen > 1 ) - { - *out++ = padchar; - } - else - { - *out++ = alphabet[l]; - } - if( padlen > 0 ) - { - *out++ = padchar; - } - else - { - *out++ = alphabet[m]; - } - } - - // terminate string - ptr[out - ptr] = 0; - _dst = ptr; - delete[] ptr; -} - - - -void decode( const QString & _b64, char * * _data, int * _size ) -{ - const char * src = _b64.ascii(); - const csize ssize = _b64.length(); - const csize dsize = *_size = ( ssize * 3 ) / 4; - *_data = new char[dsize]; - - // code mostly taken from - // qt-x11-opensource-src-4.0.1/src/corelib/tools/qbytearray.cpp - unsigned int buf = 0; - int nbits = 0; - int offset = 0; - - for( csize i = 0; i < ssize; ++i ) - { - int ch = src[i]; - int d; - - if( ch >= 'A' && ch <= 'Z' ) - { - d = ch - 'A'; - } - else if( ch >= 'a' && ch <= 'z' ) - { - d = ch - 'a' + 26; - } - else if( ch >= '0' && ch <= '9' ) - { - d = ch - '0' + 52; - } - else if( ch == '+' ) - { - d = 62; - } - else if( ch == '/' ) - { - d = 63; - } - else - { - d = -1; - } - - if( d != -1 ) - { - buf = ( buf << 6 ) | (Uint32)d; - nbits += 6; - if( nbits >= 8 ) - { - nbits -= 8; - ( *_data )[offset++] = buf >> nbits; - buf &= ( 1 << nbits ) - 1; - } - } - } -} - - -} ; - -#endif - - namespace base64 { @@ -183,20 +40,12 @@ namespace base64 QString encode( const QVariant & _data ) { QBuffer buf; -#ifndef QT3 buf.open( QBuffer::WriteOnly ); -#else - buf.open( IO_WriteOnly ); -#endif QDataStream out( &buf ); out << _data; QByteArray data = buf.buffer(); QString dst; -#ifndef QT3 encode( data.constData(), data.size(), dst ); -#else - encode( data.data(), data.size(), dst ); -#endif return( dst ); } @@ -208,16 +57,9 @@ QVariant decode( const QString & _b64 ) char * dst = NULL; int dsize = 0; base64::decode( _b64, &dst, &dsize ); -#ifndef QT3 QByteArray ba( dst, dsize ); QBuffer buf( &ba ); buf.open( QBuffer::ReadOnly ); -#else - QByteArray ba; - ba.setRawData( dst, dsize ); - QBuffer buf( ba ); - buf.open( IO_ReadOnly ); -#endif QDataStream in( &buf ); QVariant ret; in >> ret; diff --git a/src/lib/embed.cpp b/src/lib/embed.cpp index 6d055d471..ae3d0014b 100644 --- a/src/lib/embed.cpp +++ b/src/lib/embed.cpp @@ -25,19 +25,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "embed.h" #include "config_mgr.h" @@ -80,13 +69,8 @@ QPixmap getIconPixmap( const char * _name, int _w, int _h ) } if( p.isNull() ) { -#ifdef QT4 const embed::descriptor & e = findEmbeddedData( name.toAscii().constData() ); -#else - const embed::descriptor & e = findEmbeddedData( - name.ascii() ); -#endif // found? if( QString( e.name ) == name ) { @@ -99,12 +83,8 @@ QPixmap getIconPixmap( const char * _name, int _w, int _h ) } return( p ); } -#ifdef QT4 return( getIconPixmap( _name ).scaled( _w, _h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); -#else - return( getIconPixmap( _name ).convertToImage().smoothScale( _w, _h ) ); -#endif } diff --git a/src/lib/journalling_object.cpp b/src/lib/journalling_object.cpp index 3921728cc..c2fe21c25 100644 --- a/src/lib/journalling_object.cpp +++ b/src/lib/journalling_object.cpp @@ -25,23 +25,13 @@ */ +#include + #include "journalling_object.h" #include "project_journal.h" #include "base64.h" #include "engine.h" -#include "qt3support.h" - -#ifndef QT3 - -#include - -#else - -#include - -#endif - journallingObject::journallingObject( void ) : diff --git a/src/lib/mmp.cpp b/src/lib/mmp.cpp index 3c3a47eb0..5fae0428c 100644 --- a/src/lib/mmp.cpp +++ b/src/lib/mmp.cpp @@ -29,18 +29,9 @@ #include -#ifdef QT4 - #include #include -#else - -#include -#include - -#endif - #include "config_mgr.h" #include "project_version.h" @@ -101,11 +92,7 @@ multimediaProject::multimediaProject( const QString & _in_file_name, QFile in_file( _in_file_name ); if( _is_filename == TRUE ) { -#ifdef QT4 if( !in_file.open( QIODevice::ReadOnly ) ) -#else - if( !in_file.open( IO_ReadOnly ) ) -#endif { QMessageBox::critical( NULL, songEditor::tr( "Could not open file" ), @@ -255,13 +242,7 @@ bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check ) QFile outfile( fn ); if( _overwrite_check == TRUE && outfile.exists() == TRUE && - QMessageBox:: -#if QT_VERSION >= 0x030200 - question -#else - information -#endif - ( NULL, + QMessageBox::question( NULL, songEditor::tr( "File already exists" ), songEditor::tr( "The file %1 already " "exists.\nDo you want " @@ -274,11 +255,7 @@ bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check ) } -#ifdef QT4 if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) ) -#else - if( !outfile.open( IO_WriteOnly | IO_Truncate ) ) -#endif { QMessageBox::critical( NULL, songEditor::tr( "Could not write " "file" ), @@ -293,28 +270,14 @@ bool multimediaProject::writeFile( QString & _fn, bool _overwrite_check ) ).arg( fn ) ); return( FALSE ); } - QString xml = "\n" + toString( -#if QT_VERSION >= 0x030100 - 1 -#endif - ); + QString xml = "\n" + toString( 1 ); if( compress ) { -#ifndef QT3 outfile.write( qCompress( xml.toAscii() ) ); -#else - outfile.writeBlock( qCompress( - (const uchar *) xml.ascii(), xml.length() ) ); -#endif } else { -#ifdef QT4 outfile.write( xml.toUtf8().constData(), xml.length() ); -#else - QCString xml_utf8 = xml.utf8(); - outfile.writeBlock( xml_utf8.data(), xml_utf8.length() ); -#endif } outfile.close(); diff --git a/src/lib/sample_buffer.cpp b/src/lib/sample_buffer.cpp index a33c52f6e..47bfcdfe4 100644 --- a/src/lib/sample_buffer.cpp +++ b/src/lib/sample_buffer.cpp @@ -29,10 +29,6 @@ #include #endif -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -40,21 +36,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include - -#if QT_VERSION < 0x030100 -#include -#endif - -#endif - #include @@ -89,15 +70,6 @@ #include "debug.h" -#ifndef QT4 - -#define write writeBlock -#define read readBlock -#define pos at - -#endif - - sampleBuffer::sampleBuffer( const QString & _audio_file, bool _is_base64_data ) : @@ -225,12 +197,7 @@ void sampleBuffer::update( bool _keep_settings ) else if( m_audioFile != "" ) { QString file = tryToMakeAbsolute( m_audioFile ); - const char * f = -#ifdef QT4 - file.toAscii().constData(); -#else - file.ascii(); -#endif + const char * f = file.toAscii().constData(); int_sample_t * buf = NULL; ch_cnt_t channels = DEFAULT_CHANNELS; sample_rate_t samplerate = SAMPLE_RATES[DEFAULT_QUALITY_LEVEL]; @@ -509,11 +476,7 @@ f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f, f_cnt_t frames = 0; QFile * f = new QFile( _f ); -#ifdef QT4 if( f->open( QFile::ReadOnly | QFile::Truncate ) == FALSE ) -#else - if( f->open( IO_ReadOnly | IO_Truncate ) == FALSE ) -#endif { delete f; return( 0 ); @@ -775,10 +738,8 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr, // _p.setClipRect( _clip ); // _p.setPen( QColor( 0x22, 0xFF, 0x44 ) ); //_p.setPen( QColor( 64, 224, 160 ) ); -#ifdef QT4 - // TODO: save and restore aa-settings +#warning TODO: save and restore aa-settings _p.setRenderHint( QPainter::Antialiasing ); -#endif const int w = _dr.width(); const int h = _dr.height(); @@ -789,7 +750,6 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr, if( _dm == LINE_CONNECT ) { -#ifdef QT4 float old_x = _dr.x(); float old_y[DEFAULT_CHANNELS] = { y_base, y_base }; @@ -810,32 +770,6 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr, } old_x = x; } -#else - int old_y[DEFAULT_CHANNELS] = { y_base, y_base }; - - const f_cnt_t fpp = tMax( tMin( m_frames / w, - 20 ), 1 ); - const f_cnt_t fbase = m_frames * _clip.x() / _clip.width(); - const f_cnt_t fmax = tMin( m_frames, - _clip.width() * fpp ); - int old_x = _clip.x(); - //printf("%d\n", fmax ); - for( f_cnt_t frame = 0; frame < m_frames; frame += fpp ) - { - const int x = _dr.x() + static_cast( frame / - (float) m_frames * _dr.width() ); - for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; - ++chnl ) - { - const Uint16 y = y_base + - static_cast( m_data[frame][chnl] * - y_space ); - _p.drawLine( old_x, old_y[chnl], x, y ); - old_y[chnl] = y; - } - old_x = x; - } -#endif } else if( _dm == DOTS ) @@ -859,12 +793,7 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr, QString sampleBuffer::openAudioFile( void ) const { -#ifdef QT4 QFileDialog ofd( NULL, tr( "Open audio file" ) ); -#else - QFileDialog ofd( QString::null, QString::null, NULL, "", TRUE ); - ofd.setWindowTitle( tr( "Open audio file" ) ); -#endif QString dir; if( m_audioFile != "" ) @@ -879,11 +808,7 @@ QString sampleBuffer::openAudioFile( void ) const m_audioFile; } } -#ifdef QT4 dir = QFileInfo( f ).absolutePath(); -#else - dir = QFileInfo( f ).dirPath( TRUE ); -#endif } else { @@ -894,7 +819,6 @@ QString sampleBuffer::openAudioFile( void ) const ofd.setFileMode( QFileDialog::ExistingFiles ); // set filters -#ifdef QT4 QStringList types; types << tr( "All Audio-Files (*.wav *.ogg *.flac *.spx *.voc *.aif " "*.aiff *.au *.raw)" ) @@ -911,23 +835,6 @@ QString sampleBuffer::openAudioFile( void ) const //<< tr( "MOD-Files (*.mod)" ) ; ofd.setFilters( types ); -#else - ofd.addFilter( tr( "All Audio-Files (*.wav *.ogg *.flac *.spx *.voc " - "*.aif *.aiff *.au *.raw)" ) ); - ofd.addFilter( tr( "Wave-Files (*.wav)" ) ); - ofd.addFilter( tr( "OGG-Files (*.ogg)" ) ); - ofd.addFilter( tr( "FLAC-Files (*.flac)" ) ); - ofd.addFilter( tr( "SPEEX-Files (*.spx)" ) ); - //ofd.addFilter (tr("MP3-Files (*.mp3)")); - //ofd.addFilter (tr("MIDI-Files (*.mid)"));^ - ofd.addFilter( tr( "VOC-Files (*.voc)" ) ); - ofd.addFilter( tr( "AIFF-Files (*.aif *.aiff)" ) ); - ofd.addFilter( tr( "AU-Files (*.au)" ) ); - ofd.addFilter( tr( "RAW-Files (*.raw)" ) ); - //ofd.addFilter (tr("MOD-Files (*.mod)")); - ofd.setSelectedFilter( tr( "All Audio-Files (*.wav *.ogg *.flac *.spx " - "*.voc *.aif *.aiff *.au *.raw)" ) ); -#endif if( m_audioFile != "" ) { // select previously opened file @@ -998,11 +905,7 @@ QString & sampleBuffer::toBase64( QString & _dst ) const FLAC__stream_encoder_set_sample_rate( flac_enc, engine::getMixer()->sampleRate() ); QBuffer ba_writer; -#ifdef QT4 ba_writer.open( QBuffer::WriteOnly ); -#else - ba_writer.open( IO_WriteOnly ); -#endif FLAC__stream_encoder_set_write_callback( flac_enc, flacStreamEncoderWriteCallback ); @@ -1205,23 +1108,12 @@ void sampleBuffer::loadFromBase64( const QString & _data ) #ifdef HAVE_FLAC_STREAM_DECODER_H -#ifndef QT3 QByteArray orig_data = QByteArray::fromRawData( dst, dsize ); QBuffer ba_reader( &orig_data ); ba_reader.open( QBuffer::ReadOnly ); -#else - QByteArray orig_data; - orig_data.setRawData( dst, dsize ); - QBuffer ba_reader( orig_data ); - ba_reader.open( IO_ReadOnly ); -#endif QBuffer ba_writer; -#ifdef QT4 ba_writer.open( QBuffer::WriteOnly ); -#else - ba_writer.open( IO_WriteOnly ); -#endif flacStreamDecoderClientData cdata = { &ba_reader, &ba_writer } ; @@ -1263,9 +1155,7 @@ void sampleBuffer::loadFromBase64( const QString & _data ) #endif -#ifndef QT3 delete[] dst; -#endif m_audioFile = ""; update(); diff --git a/src/lib/string_pair_drag.cpp b/src/lib/string_pair_drag.cpp index 3b8de04c8..5ff8be512 100644 --- a/src/lib/string_pair_drag.cpp +++ b/src/lib/string_pair_drag.cpp @@ -27,38 +27,26 @@ */ -#include "string_pair_drag.h" -#include "engine.h" -#include "main_window.h" - -#ifdef QT4 - #include #include #include -#endif + +#include "string_pair_drag.h" +#include "engine.h" +#include "main_window.h" stringPairDrag::stringPairDrag( const QString & _key, const QString & _value, const QPixmap & _icon, QWidget * _w ) : -#ifdef QT4 - QDrag( _w ) -#else - QStoredDrag( mimeType(), _w ) -#endif + QDrag( _w ) { setPixmap( _icon ); QString txt = _key + ":" + _value; -#ifdef QT4 QMimeData * m = new QMimeData(); m->setData( mimeType(), txt.toAscii() ); setMimeData( m ); start( Qt::IgnoreAction ); -#else - setEncodedData( txt.utf8() ); - drag( QDragObject::DragDefault ); -#endif } @@ -78,7 +66,6 @@ stringPairDrag::~stringPairDrag() bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee, const QString & _allowed_keys ) { -#ifdef QT4 if( !_dee->mimeData()->hasFormat( mimeType() ) ) { return( FALSE ); @@ -91,13 +78,6 @@ bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee, } _dee->ignore(); return( FALSE ); -#else - QString txt = _dee->encodedData( mimeType() ); - bool accepted = QStringList::split( ',', _allowed_keys ).contains( - txt.section( ':', 0, 0 ) ); - _dee->accept( accepted ); - return( accepted ); -#endif } @@ -105,13 +85,8 @@ bool stringPairDrag::processDragEnterEvent( QDragEnterEvent * _dee, QString stringPairDrag::decodeKey( QDropEvent * _de ) { -#ifdef QT4 return( QString( _de->mimeData()->data( mimeType() ) ).section( ':', 0, 0 ) ); -#else - return( QString( _de->encodedData( mimeType() ) ).section( - ':', 0, 0 ) ); -#endif } @@ -119,13 +94,8 @@ QString stringPairDrag::decodeKey( QDropEvent * _de ) QString stringPairDrag::decodeValue( QDropEvent * _de ) { -#ifdef QT4 return( QString( _de->mimeData()->data( mimeType() ) ).section( ':', 1, -1 ) ); -#else - return( QString( _de->encodedData( mimeType() ) ).section( - ':', 1, -1 ) ); -#endif } diff --git a/src/midi/midi_alsa_raw.cpp b/src/midi/midi_alsa_raw.cpp index 4216d7edd..80c1ea9af 100644 --- a/src/midi/midi_alsa_raw.cpp +++ b/src/midi/midi_alsa_raw.cpp @@ -25,21 +25,9 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include -#include - -#endif - #include "midi_alsa_raw.h" #include "config_mgr.h" @@ -56,11 +44,7 @@ midiALSARaw::midiALSARaw( void ) : { int err; if( ( err = snd_rawmidi_open( m_inputp, m_outputp, -#ifdef QT4 probeDevice().toAscii().constData(), -#else - probeDevice().ascii(), -#endif 0 ) ) < 0 ) { printf( "cannot open MIDI-device: %s\n", snd_strerror( err ) ); @@ -74,11 +58,7 @@ midiALSARaw::midiALSARaw( void ) : m_pfds = new pollfd[m_npfds]; snd_rawmidi_poll_descriptors( m_input, m_pfds, m_npfds ); - start( -#if QT_VERSION >= 0x030505 - QThread::LowPriority -#endif - ); + start( QThread::LowPriority ); } diff --git a/src/midi/midi_alsa_seq.cpp b/src/midi/midi_alsa_seq.cpp index 6e26d00f4..bd146ae8a 100644 --- a/src/midi/midi_alsa_seq.cpp +++ b/src/midi/midi_alsa_seq.cpp @@ -25,21 +25,9 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include -#include - -#endif - #include "midi_alsa_seq.h" #include "config_mgr.h" @@ -61,11 +49,7 @@ midiALSASeq::midiALSASeq( void ) : { int err; if( ( err = snd_seq_open( &m_seqHandle, -#ifdef QT4 probeDevice().toAscii().constData(), -#else - probeDevice().ascii(), -#endif SND_SEQ_OPEN_DUPLEX, 0 ) ) < 0 ) { printf( "cannot open sequencer: %s\n", snd_strerror( err ) ); @@ -101,11 +85,7 @@ midiALSASeq::midiALSASeq( void ) : perror( __FILE__ ": pipe" ); } - start( -#if QT_VERSION >= 0x030505 - QThread::IdlePriority -#endif - ); + start( QThread::IdlePriority ); } @@ -261,11 +241,7 @@ void midiALSASeq::applyPortMode( midiPort * _port ) m_portIDs[_port][i] = snd_seq_create_simple_port( m_seqHandle, -#ifdef QT4 _port->name().toAscii().constData(), -#else - _port->name().ascii(), -#endif caps[i], SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION ); @@ -314,13 +290,7 @@ void midiALSASeq::applyPortName( midiPort * _port ) snd_seq_get_port_info( m_seqHandle, m_portIDs[_port][i], port_info ); snd_seq_port_info_set_name( port_info, - _port->name(). -#ifdef QT4 - toAscii().constData() -#else - ascii() -#endif - ); + _port->name().toAscii().constData() ); snd_seq_set_port_info( m_seqHandle, m_portIDs[_port][i], port_info ); snd_seq_port_info_free( port_info ); @@ -362,13 +332,7 @@ void midiALSASeq::subscribeReadablePort( midiPort * _port, } snd_seq_addr_t sender; if( snd_seq_parse_address( m_seqHandle, &sender, - _dest.section( ' ', 0, 0 ). -#ifdef QT4 - toAscii().constData() -#else - ascii() -#endif - ) ) + _dest.section( ' ', 0, 0 ).toAscii().constData() ) ) { printf( "error parsing sender-address!!\n" ); return; @@ -407,13 +371,7 @@ void midiALSASeq::subscribeWriteablePort( midiPort * _port, } snd_seq_addr_t dest; if( snd_seq_parse_address( m_seqHandle, &dest, - _dest.section( ' ', 0, 0 ). -#ifdef QT4 - toAscii().constData() -#else - ascii() -#endif - ) ) + _dest.section( ' ', 0, 0 ).toAscii().constData() ) ) { printf( "error parsing dest-address!!\n" ); return; @@ -475,7 +433,7 @@ void midiALSASeq::run( void ) snd_seq_event_input( m_seqHandle, &ev ); midiPort * dest = NULL; - for( csize i = 0; i < m_portIDs.values().size(); ++i ) + for( int i = 0; i < m_portIDs.values().size(); ++i ) { if( m_portIDs.values()[i][0] == ev->dest.port || m_portIDs.values()[i][0] == ev->dest.port ) diff --git a/src/midi/midi_client.cpp b/src/midi/midi_client.cpp index f582ada9c..f0f426134 100644 --- a/src/midi/midi_client.cpp +++ b/src/midi/midi_client.cpp @@ -26,11 +26,6 @@ */ -#include "qt3support.h" -#ifndef QT4 -#include -#endif - #include "midi_client.h" /*#include "midi_mapper.h"*/ #include "templates.h" @@ -82,7 +77,7 @@ midiPort * midiClient::addPort( midiEventProcessor * _mep, void midiClient::removePort( midiPort * _port ) { - vvector::iterator it = qFind( m_midiPorts.begin(), + QVector::iterator it = qFind( m_midiPorts.begin(), m_midiPorts.end(), _port ); if( it != m_midiPorts.end() ) @@ -281,7 +276,7 @@ void midiClientRaw::parseData( const Uint8 _c ) void midiClientRaw::processParsedEvent() { - for( csize i = 0; i < m_midiPorts.size(); ++i ) + for( int i = 0; i < m_midiPorts.size(); ++i ) { m_midiPorts[i]->processInEvent( m_midiParseData.m_midiEvent, midiTime() ); diff --git a/src/midi/midi_mapper.cpp b/src/midi/midi_mapper.cpp index 430f12b4d..dd809f2d8 100644 --- a/src/midi/midi_mapper.cpp +++ b/src/midi/midi_mapper.cpp @@ -28,18 +28,8 @@ #include "midi_mapper.h" -#ifdef QT4 - #include -#else - -#include - -#define indexOf find - -#endif - midiMapper::midiMapper( const QString & _map ) : m_drumsetChannel( 0 ), @@ -59,11 +49,7 @@ midiMapper::midiMapper( const QString & _map ) : m_channelMap[i] = i; } QFile map( _map ); -#ifdef QT4 if( !map.open( QIODevice::ReadOnly ) ) -#else - if( !map.open( IO_ReadOnly ) ) -#endif { return; } @@ -76,14 +62,7 @@ midiMapper::midiMapper( const QString & _map ) : continue; } QString line( buf ); -#if QT_VERSION >= 0x030100 line.replace( '\n', "" ); -#else - if( line.contains( '\n' ) ) - { - line = line.left( line.length() - 1 ); - } -#endif if( line.left( 6 ) == "DEFINE" ) { if( line.section( ' ', 1, 1 ) == "PATCHMAP" ) @@ -127,14 +106,7 @@ void midiMapper::readPatchMap( QFile & _f ) continue; } QString line( buf ); -#if QT_VERSION >= 0x030100 line.replace( '\n', "" ); -#else - if( line.contains( '\n' ) ) - { - line = line.left( line.length() - 1 ); - } -#endif if( line.left( 3 ) == "END" ) { return; @@ -144,11 +116,8 @@ void midiMapper::readPatchMap( QFile & _f ) continue; } m_patchMap[prog_idx].first = line.section( '=', 1, 1 ).toInt(); - m_patchMap[prog_idx].second = line.section( '=', 0, 0 ) -#if QT_VERSION >= 0x030100 - .replace( ' ', "" ) -#endif - ; + m_patchMap[prog_idx].second = + line.section( '=', 0, 0 ).replace( ' ', "" ); ++prog_idx; } } @@ -168,14 +137,7 @@ void midiMapper::readDrumsetKeyMap( QFile & _f ) continue; } QString line( buf ); -#if QT_VERSION >= 0x030100 line.replace( '\n', "" ); -#else - if( line.contains( '\n' ) ) - { - line = line.left( line.length() - 1 ); - } -#endif if( line.left( 3 ) == "END" ) { return; @@ -189,13 +151,9 @@ void midiMapper::readDrumsetKeyMap( QFile & _f ) m_drumsetKeyMap[key].first = line.section( '=', 1, 1 ). toInt(); - m_drumsetKeyMap[key].second = line.mid( 4 ). - section( '=', 0, 0 ). - section( ' ', 1, 1 ) -#if QT_VERSION >= 0x030100 - .replace( ' ', "" ) -#endif - ; + m_drumsetKeyMap[key].second = + line.mid( 4 ).section( '=', 0, 0 ) + .section( ' ', 1, 1 ).replace( ' ', "" ); } ++key; } diff --git a/src/midi/midi_oss.cpp b/src/midi/midi_oss.cpp index a525a754d..6b4253e3e 100644 --- a/src/midi/midi_oss.cpp +++ b/src/midi/midi_oss.cpp @@ -30,20 +30,9 @@ #ifdef OSS_SUPPORT -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include -#include - -#endif #ifdef HAVE_STDLIB_H #include @@ -61,18 +50,10 @@ midiOSS::midiOSS( void ) : { // only start thread, if opening of MIDI-device is successful, // otherwise isRunning()==FALSE indicates error -#ifdef QT4 if( m_midiDev.open( QIODevice::ReadWrite ) || m_midiDev.open( QIODevice::ReadOnly ) ) -#else - if( m_midiDev.open( IO_ReadWrite ) || m_midiDev.open( IO_ReadOnly ) ) -#endif { - start( -#if QT_VERSION >= 0x030505 - QThread::LowPriority -#endif - ); + start( QThread::LowPriority ); } } @@ -111,11 +92,7 @@ QString midiOSS::probeDevice( void ) void midiOSS::sendByte( const Uint8 _c ) { -#ifdef QT4 m_midiDev.putChar( _c ); -#else - m_midiDev.putch( _c ); -#endif } @@ -125,16 +102,12 @@ void midiOSS::run( void ) { while( m_quit == FALSE && m_midiDev.isOpen() ) { -#ifdef QT4 char c; if( !m_midiDev.getChar( &c ) ) { continue; } parseData( c ); -#else - parseData( m_midiDev.getch() ); -#endif } } diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index 27266f9ed..3db17bcc9 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -25,24 +25,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "bb_track.h" #include "bb_editor.h" @@ -67,9 +54,6 @@ bbTCO::bbTCO( track * _track, const QColor & _c ) : QString( "" ) ), m_color( _c.isValid() ? _c : QColor( 64, 128, 255 ) ) { -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif tact t = engine::getBBEditor()->lengthOfBB( bbTrack::numOfBBTrack( getTrack() ) ); if( t > 0 ) @@ -92,29 +76,14 @@ bbTCO::~bbTCO() void bbTCO::constructContextMenu( QMenu * _cm ) { -#ifdef QT4 QAction * a = new QAction( embed::getIconPixmap( "bb_track" ), tr( "Open in Beat+Baseline-Editor" ), _cm ); _cm->insertAction( _cm->actions()[0], a ); connect( a, SIGNAL( triggered( bool ) ), this, SLOT( openInBBEditor( bool ) ) ); -#else - _cm->insertItem( embed::getIconPixmap( "bb_track" ), - tr( "Open in Beat+Baseline-Editor" ), - this, SLOT( openInBBEditor() ), - 0, -1, 0 ); -#endif -#ifdef QT4 _cm->insertSeparator( _cm->actions()[1] ); -#else - _cm->insertSeparator( 1 ); -#endif -#ifdef QT4 _cm->addSeparator(); -#else - _cm->insertSeparator(); -#endif _cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ), this, SLOT( resetName() ) ); _cm->addAction( embed::getIconPixmap( "rename" ), tr( "Change name" ), @@ -146,26 +115,12 @@ void bbTCO::paintEvent( QPaintEvent * ) col = QColor( tMax( col.red() - 128, 0 ), tMax( col.green() - 128, 0 ), 255 ); } -#ifdef QT4 QPainter p( this ); QLinearGradient lingrad( 0, 0, 0, height() ); lingrad.setColorAt( 0, col.light( 130 ) ); lingrad.setColorAt( 1, col.light( 70 ) ); p.fillRect( rect(), lingrad ); -#else - // create pixmap for whole widget - QPixmap pm( rect().size() ); - // and a painter for it - QPainter p( &pm ); - - // COOL gradient ;-) - for( int y = 1; y < height() - 1; ++y ) - { - p.setPen( col.light( 130 - y * 60 / height() ) ); - p.drawLine( 1, y, width() - 1, y ); - } -#endif tact t = engine::getBBEditor()->lengthOfBB( bbTrack::numOfBBTrack( getTrack() ) ); @@ -183,11 +138,7 @@ void bbTCO::paintEvent( QPaintEvent * ) } p.setPen( col.dark() ); -#ifndef QT3 p.drawRect( 0, 0, rect().right(), rect().bottom() ); -#else - p.drawRect( rect() ); -#endif p.setFont( pointSize<7>( p.font() ) ); p.setPen( QColor( 0, 0, 0 ) ); @@ -198,10 +149,6 @@ void bbTCO::paintEvent( QPaintEvent * ) p.drawPixmap( 3, p.fontMetrics().height() + 1, embed::getIconPixmap( "muted", 16, 16 ) ); } - -#ifndef QT4 - bitBlt( this, rect().topLeft(), &pm ); -#endif } @@ -297,9 +244,9 @@ void bbTCO::changeColor( void ) } if( isSelected() ) { - vvector selected = + QVector selected = engine::getSongEditor()->selectedObjects(); - for( vvector::iterator it = + for( QVector::iterator it = selected.begin(); it != selected.end(); ++it ) { @@ -341,7 +288,7 @@ bbTrack::bbTrack( trackContainer * _tc ) : // too), so disable it getTrackWidget()->setAcceptDrops( FALSE ); - csize bbNum = s_infoMap.size(); + int bbNum = s_infoMap.size(); s_infoMap[this] = bbNum; m_trackLabel = new nameLabel( tr( "Beat/Baseline %1" ).arg( bbNum ), @@ -371,22 +318,15 @@ bbTrack::~bbTrack() { engine::getMixer()->removePlayHandles( this ); - csize bb = s_infoMap[this]; + int bb = s_infoMap[this]; engine::getBBEditor()->removeBB( bb ); for( infoMap::iterator it = s_infoMap.begin(); it != s_infoMap.end(); ++it ) { -#ifdef QT4 if( it.value() > bb ) { --it.value(); } -#else - if( it.data() > bb ) - { - --it.data(); - } -#endif } s_infoMap.remove( this ); engine::getBBEditor()->updateComboBox(); @@ -417,7 +357,7 @@ bool FASTCALL bbTrack::play( const midiTime & _start, s_infoMap[this] ) ); } - vlist tcos; + QList tcos; getTCOsInRange( tcos, _start, _start + static_cast( _frames / engine::framesPerTact64th() ) ); @@ -428,7 +368,7 @@ bool FASTCALL bbTrack::play( const midiTime & _start, midiTime lastPosition; midiTime lastLen; - for( vlist::iterator it = tcos.begin(); + for( QList::iterator it = tcos.begin(); it != tcos.end(); ++it ) { if( !( *it )->muted() && @@ -456,7 +396,7 @@ trackContentObject * bbTrack::createTCO( const midiTime & _pos ) // if we're creating a new bbTCO, we colorize it according to the // previous bbTCO, so we have to get all TCOs from 0 to _pos and // pickup the last and take the color if it - vlist tcos; + QList tcos; getTCOsInRange( tcos, 0, _pos ); if( tcos.size() > 0 && dynamic_cast( tcos.back() ) != NULL ) { @@ -546,16 +486,12 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this ) // return pointer to bbTrack specified by _bb_num -bbTrack * bbTrack::findBBTrack( csize _bb_num ) +bbTrack * bbTrack::findBBTrack( int _bb_num ) { for( infoMap::iterator it = s_infoMap.begin(); it != s_infoMap.end(); ++it ) { -#ifdef QT4 if( it.value() == _bb_num ) -#else - if( it.data() == _bb_num ) -#endif { return( it.key() ); } @@ -566,7 +502,7 @@ bbTrack * bbTrack::findBBTrack( csize _bb_num ) -csize bbTrack::numOfBBTrack( track * _track ) +int bbTrack::numOfBBTrack( track * _track ) { if( dynamic_cast( _track ) != NULL ) { diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 1e7319135..36f6c372f 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -26,10 +26,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -42,23 +38,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif - #include "instrument_track.h" #include "arp_and_chords_tab_widget.h" @@ -126,13 +105,8 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : m_baseTone( A ), m_baseOctave( OCTAVE_4 ), m_instrument( NULL ), -#ifdef QT4 m_midiInputAction( NULL ), m_midiOutputAction( NULL ) -#else - m_midiInputID( -1 ), - m_midiOutputID( -1 ) -#endif { for( int i = 0; i < NOTES; ++i ) { @@ -140,9 +114,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : } -#ifdef QT4 engine::getMainWindow()->workspace()->addWindow( this ); -#endif setAcceptDrops( TRUE ); @@ -162,12 +134,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : m_tswVolumeKnob->show(); /* connect( m_tswVolumeKnob, SIGNAL( valueChanged( float ) ), this, SLOT( volValueChanged( float ) ) );*/ -#ifdef QT4 - m_tswVolumeKnob->setWhatsThis( -#else - QWhatsThis::add( m_tswVolumeKnob, -#endif - tr( volume_help ) ); + m_tswVolumeKnob->setWhatsThis( tr( volume_help ) ); QPushButton * tsw_midi = new QPushButton( embed::getIconPixmap( "piano" ), QString::null, @@ -200,11 +167,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : // init own layout + widgets -#ifdef QT4 setFocusPolicy( Qt::StrongFocus ); -#else - setFocusPolicy( StrongFocus ); -#endif QVBoxLayout * vlayout = new QVBoxLayout( this ); vlayout->setMargin( 0 ); vlayout->setSpacing( 0 ); @@ -231,12 +194,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : m_volumeKnob->setHintText( tr( "Channel volume:" ) + " ", "%" ); m_volumeKnob->setLabel( tr( "VOLUME" ) ); -#ifdef QT4 - m_volumeKnob->setWhatsThis( -#else - QWhatsThis::add( m_volumeKnob, -#endif - tr( volume_help ) ); + m_volumeKnob->setWhatsThis( tr( volume_help ) ); /* connect( m_volumeKnob, SIGNAL( valueChanged( float ) ), this, SLOT( volValueChanged( float ) ) );*/ volumeKnob::linkObjects( m_tswVolumeKnob, m_volumeKnob ); @@ -247,12 +205,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : tr( "Surround area" ), this ); m_surroundArea->move( 20 + m_volumeKnob->width(), 38 ); m_surroundArea->show(); -#ifdef QT4 - m_surroundArea->setWhatsThis( -#else - QWhatsThis::add( m_surroundArea, -#endif - tr( surroundarea_help ) ); + m_surroundArea->setWhatsThis( tr( surroundarea_help ) ); connect( m_surroundArea, SIGNAL( valueChanged( const QPoint & ) ), this, @@ -282,11 +235,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : SLOT( saveSettingsBtnClicked() ) ); toolTip::add( m_saveSettingsBtn, tr( "Save current channel settings in a preset-file" ) ); -#ifdef QT4 m_saveSettingsBtn->setWhatsThis( -#else - QWhatsThis::add( m_saveSettingsBtn, -#endif tr( "Click here, if you want to save current channel settings " "in a preset-file. Later you can load this preset by " "double-clicking it in the preset-browser." ) ); @@ -320,7 +269,6 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : vlayout->addWidget( m_tabWidget ); vlayout->addWidget( m_pianoWidget ); -#ifdef QT4 if( m_midiWidget->m_readablePorts ) { m_midiInputAction = m_tswMidiMenu->addMenu( @@ -345,22 +293,6 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : } m_midiInputAction->setText( tr( "MIDI input" ) ); m_midiOutputAction->setText( tr( "MIDI output" ) ); -#else - m_midiInputID = m_tswMidiMenu->insertItem( tr( "MIDI input" ), - m_midiWidget->m_readablePorts ); - if( m_midiWidget->m_readablePorts == NULL ) - { - m_tswMidiMenu->connectItem( m_midiInputID, this, - SLOT( midiInSelected() ) ); - } - m_midiOutputID = m_tswMidiMenu->insertItem( tr( "MIDI output" ), - m_midiWidget->m_writeablePorts ); - if( m_midiWidget->m_writeablePorts == NULL ) - { - m_tswMidiMenu->connectItem( m_midiOutputID, this, - SLOT( midiOutSelected() ) ); - } -#endif if( m_midiWidget->m_readablePorts == NULL || m_midiWidget->m_writeablePorts == NULL ) { @@ -378,10 +310,9 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) : _tc->updateAfterTrackAdd(); -#ifndef QT3 + setFixedWidth( INSTRUMENT_WIDTH ); resize( sizeHint() ); -#endif } @@ -406,14 +337,8 @@ instrumentTrack::~instrumentTrack() void instrumentTrack::saveSettingsBtnClicked( void ) { -#ifdef QT4 QFileDialog sfd( this, tr( "Save channel-settings in file" ), "", tr( "Channel-Settings-File (*.cs.xml)" ) ); -#else - QFileDialog sfd( this, "", TRUE ); - sfd.setWindowTitle( tr( "Save channel-settings in file" ) ); - sfd.setFilter( tr( "Channel-Settings-File (*.cs.xml)" ) ); -#endif QString preset_root = configManager::inst()->userPresetsDir(); if( !QDir( preset_root ).exists() ) @@ -428,11 +353,7 @@ void instrumentTrack::saveSettingsBtnClicked( void ) sfd.setDirectory( preset_root + instrumentName() ); sfd.setFileMode( QFileDialog::AnyFile ); if( sfd.exec () == QDialog::Accepted && -#ifdef QT4 !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" -#else - sfd.selectedFile() != "" -#endif ) { multimediaProject mmp( @@ -440,11 +361,7 @@ void instrumentTrack::saveSettingsBtnClicked( void ) QDomElement _this = mmp.createElement( nodeName() ); saveTrackSpecificSettings( mmp, _this ); mmp.content().appendChild( _this ); -#ifdef QT4 QString f = sfd.selectedFiles()[0]; -#else - QString f = sfd.selectedFile(); -#endif mmp.writeFile( f ); } } @@ -474,32 +391,18 @@ void instrumentTrack::activityIndicatorReleased( void ) void instrumentTrack::midiInSelected( void ) { -#ifdef QT4 m_midiInputAction->setChecked( !m_midiInputAction->isChecked() ); m_midiWidget->m_receiveCheckBox->setChecked( m_midiInputAction->isChecked() ); -#else - m_tswMidiMenu->setItemChecked( m_midiInputID, - !m_tswMidiMenu->isItemChecked( m_midiInputID ) ); - m_midiWidget->m_receiveCheckBox->setChecked( - m_tswMidiMenu->isItemChecked( m_midiInputID ) ); -#endif } void instrumentTrack::midiOutSelected( void ) { -#ifdef QT4 m_midiOutputAction->setChecked( !m_midiOutputAction->isChecked() ); m_midiWidget->m_sendCheckBox->setChecked( m_midiOutputAction->isChecked() ); -#else - m_tswMidiMenu->setItemChecked( m_midiOutputID, - !m_tswMidiMenu->isItemChecked( m_midiOutputID ) ); - m_midiWidget->m_sendCheckBox->setChecked( - m_tswMidiMenu->isItemChecked( m_midiOutputID ) ); -#endif } @@ -507,17 +410,10 @@ void instrumentTrack::midiOutSelected( void ) void instrumentTrack::midiConfigChanged( bool ) { -#ifdef QT4 m_midiInputAction->setChecked( m_midiWidget->m_receiveCheckBox->isChecked() ); m_midiOutputAction->setChecked( m_midiWidget->m_sendCheckBox->isChecked() ); -#else - m_tswMidiMenu->setItemChecked( m_midiInputID, - m_midiWidget->m_receiveCheckBox->isChecked( ) ); - m_tswMidiMenu->setItemChecked( m_midiOutputID, - m_midiWidget->m_sendCheckBox->isChecked( ) ); -#endif } @@ -864,7 +760,7 @@ void instrumentTrack::setName( const QString & _new_name ) { // when changing name of channel, also change name of those patterns, // which have the same name as the channel - for( csize i = 0; i < numOfTCOs(); ++i ) + for( int i = 0; i < numOfTCOs(); ++i ) { pattern * p = dynamic_cast( getTCO( i ) ); if( p != NULL && p->name() == m_name || p->name() == "" ) @@ -932,7 +828,7 @@ void instrumentTrack::setBaseNote( Uint32 _new_note, bool _modified ) setBaseTone( (tones)( _new_note % NOTES_PER_OCTAVE ) ); setBaseOctave( (octaves)( _new_note / NOTES_PER_OCTAVE ) ); - for( vlist::iterator it = m_processHandles.begin(); + for( QList::iterator it = m_processHandles.begin(); it != m_processHandles.end(); ++it ) { ( *it )->updateFrequency(); @@ -988,7 +884,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start, { float frames_per_tact64th = engine::framesPerTact64th(); - vlist tcos; + QList tcos; bbTrack * bb_track; if( _tco_num >= 0 ) { @@ -1010,7 +906,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start, } // Handle automation: detuning - for( vlist::iterator it = m_processHandles.begin(); + for( QList::iterator it = m_processHandles.begin(); it != m_processHandles.end(); ++it ) { ( *it )->processMidiTime( _start ); @@ -1023,7 +919,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start, bool played_a_note = FALSE; // will be return variable - for( vlist::iterator it = tcos.begin(); + for( QList::iterator it = tcos.begin(); it != tcos.end(); ++it ) { pattern * p = dynamic_cast( *it ); @@ -1408,12 +1304,7 @@ void instrumentTrackButton::drawButtonLabel( QPainter * _p ) QString in = m_instrumentTrack->instrumentName() + ":"; int extra = isChecked() ? -1 : -3; _p->setFont( pointSize<7>( _p->font() ) ); -#ifdef QT4 _p->setPen( QApplication::palette().buttonText().color() ); -#else - _p->setPen( QApplication::palette().color( QPalette::Normal, - QColorGroup::ButtonText ) ); -#endif _p->drawText( ( width() - QFontMetrics( _p->font() ).width( in ) ) / 2 + extra, height() / 2 + extra, in ); _p->setPen( QColor( 0, 0, 0 ) ); diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 4d41dd5f0..c4bd2657f 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -26,10 +26,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -38,21 +34,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include - -#define addSeparator insertSeparator -#define addMenu insertItem - -#endif - #include "pattern.h" #include "instrument_track.h" @@ -191,11 +172,6 @@ void pattern::init( void ) changeLength( length() ); restoreJournallingState(); -#ifdef QT3 - // set background-mode for flicker-free redraw - setBackgroundMode( Qt::NoBackground ); -#endif - setFixedHeight( parentWidget()->height() - 2 ); setAutoResizeEnabled( FALSE ); @@ -563,8 +539,6 @@ void pattern::abortFreeze( void ) -#ifdef QT4 - void pattern::addSteps( QAction * _item ) { addSteps( _item->text().toInt() ); @@ -580,13 +554,6 @@ void pattern::removeSteps( QAction * _item ) -#else - -void pattern::addSteps( QAction * ) { } -void pattern::removeSteps( QAction * ) { } - -#endif - void pattern::addSteps( int _n ) @@ -626,23 +593,12 @@ void pattern::removeSteps( int _n ) void pattern::constructContextMenu( QMenu * _cm ) { -#ifdef QT4 QAction * a = new QAction( embed::getIconPixmap( "piano" ), tr( "Open in piano-roll" ), _cm ); _cm->insertAction( _cm->actions()[0], a ); connect( a, SIGNAL( triggered( bool ) ), this, SLOT( openInPianoRoll( bool ) ) ); -#else - _cm->insertItem( embed::getIconPixmap( "piano" ), - tr( "Open in piano-roll" ), - this, SLOT( openInPianoRoll() ), - 0, -1, 0 ); -#endif -#ifdef QT4 _cm->insertSeparator( _cm->actions()[1] ); -#else - _cm->insertSeparator( 1 ); -#endif _cm->addSeparator(); @@ -675,7 +631,6 @@ void pattern::constructContextMenu( QMenu * _cm ) _cm->addSeparator(); } -#ifdef QT4 QMenu * add_step_menu = _cm->addMenu( embed::getIconPixmap( "step_btn_add" ), tr( "Add steps" ) ); @@ -686,33 +641,14 @@ void pattern::constructContextMenu( QMenu * _cm ) this, SLOT( addSteps( QAction * ) ) ); connect( remove_step_menu, SIGNAL( triggered( QAction * ) ), this, SLOT( removeSteps( QAction * ) ) ); -#else - QMenu * add_step_menu = new QMenu( this ); - QMenu * remove_step_menu = new QMenu( this ); -#endif for( int i = 1; i <= 16; i *= 2 ) { const QString label = ( i == 1 ) ? tr( "1 step" ) : tr( "%1 steps" ).arg( i ); -#ifdef QT4 add_step_menu->addAction( label ); remove_step_menu->addAction( label ); -#else - int menu_id = add_step_menu->addAction( label, this, - SLOT( addSteps( int ) ) ); - add_step_menu->setItemParameter( menu_id, i ); - menu_id = remove_step_menu->addAction( label, this, - SLOT( removeSteps( int ) ) ); - remove_step_menu->setItemParameter( menu_id, i ); -#endif } -#ifndef QT4 - _cm->addMenu( embed::getIconPixmap( "step_btn_add" ), - tr( "Add steps" ), add_step_menu ); - _cm->addMenu( embed::getIconPixmap( "step_btn_remove" ), - tr( "Remove steps" ), remove_step_menu ); -#endif } @@ -861,7 +797,7 @@ void pattern::paintEvent( QPaintEvent * ) } QPainter p( &m_paintPixmap ); -#ifdef QT4 + QLinearGradient lingrad( 0, 0, 0, height() ); const QColor c = isSelected() ? QColor( 0, 0, 224 ) : QColor( 96, 96, 96 ); @@ -869,34 +805,6 @@ void pattern::paintEvent( QPaintEvent * ) lingrad.setColorAt( 0.5, Qt::black ); lingrad.setColorAt( 1, c ); p.fillRect( QRect( 1, 1, width() - 2, height() - 2 ), lingrad ); -#else - for( int y = 1; y < height() / 2; ++y ) - { - const int gray = 96 - y * 192 / height(); - if( isSelected() == TRUE ) - { - p.setPen( QColor( 0, 0, 128 + gray ) ); - } - else - { - p.setPen( QColor( gray, gray, gray ) ); - } - p.drawLine( 1, y, width() - 1, y ); - } - for( int y = height() / 2; y < height() - 1; ++y ) - { - const int gray = ( y - height() / 2 ) * 192 / height(); - if( isSelected() == TRUE ) - { - p.setPen( QColor( 0, 0, 128 + gray ) ); - } - else - { - p.setPen( QColor( gray, gray, gray ) ); - } - p.drawLine( 1, y, width() - 1, y ); - } -#endif p.setPen( QColor( 57, 69, 74 ) ); p.drawLine( 0, 0, width(), 0 ); @@ -994,7 +902,6 @@ void pattern::paintEvent( QPaintEvent * ) QPixmap stepoffl; const int steps = length() / BEATS_PER_TACT; const int w = width() - 2 * TCO_BORDER_WIDTH; -#ifdef QT4 stepon = s_stepBtnOn->scaled( w / steps, s_stepBtnOn->height(), Qt::IgnoreAspectRatio, @@ -1011,19 +918,6 @@ void pattern::paintEvent( QPaintEvent * ) s_stepBtnOffLight->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation ); -#else - stepon.convertFromImage( - s_stepBtnOn->convertToImage().scale( - w / steps, s_stepBtnOn->height() ) ); - stepoverlay.convertFromImage( - s_stepBtnOverlay->convertToImage().scale( - w / steps, s_stepBtnOverlay->height() ) ); - stepoff.convertFromImage( s_stepBtnOff->convertToImage().scale( - w / steps, s_stepBtnOff->height() ) ); - stepoffl.convertFromImage( s_stepBtnOffLight->convertToImage(). - scale( w / steps, - s_stepBtnOffLight->height() ) ); -#endif for( noteVector::iterator it = m_notes.begin(); it != m_notes.end(); ++it ) { @@ -1153,17 +1047,11 @@ patternFreezeStatusDialog::patternFreezeStatusDialog( QThread * _thread ) : m_progress( 0 ) { setWindowTitle( tr( "Freezing pattern..." ) ); -#if QT_VERSION >= 0x030200 setModal( TRUE ); -#endif m_progressBar = new QProgressBar( this ); m_progressBar->setGeometry( 10, 10, 200, 24 ); -#ifdef QT4 m_progressBar->setMaximum( 100 ); -#else - m_progressBar->setTotalSteps( 100 ); -#endif m_progressBar->setTextVisible( FALSE ); m_progressBar->show(); m_cancelBtn = new QPushButton( embed::getIconPixmap( "cancel" ), @@ -1179,11 +1067,7 @@ patternFreezeStatusDialog::patternFreezeStatusDialog( QThread * _thread ) : this, SLOT( updateProgress() ) ); update_timer->start( 100 ); -#ifdef QT4 setAttribute( Qt::WA_DeleteOnClose, TRUE ); -#else - setWFlags( getWFlags() | Qt::WDestructiveClose ); -#endif connect( this, SIGNAL( aborted() ), this, SLOT( reject() ) ); } @@ -1235,11 +1119,7 @@ void patternFreezeStatusDialog::updateProgress( void ) } else { -#ifdef QT4 m_progressBar->setValue( m_progress ); -#else - m_progressBar->setProgress( m_progress ); -#endif } } diff --git a/src/tracks/sample_track.cpp b/src/tracks/sample_track.cpp index 19ecba2c3..d6dbf29b0 100644 --- a/src/tracks/sample_track.cpp +++ b/src/tracks/sample_track.cpp @@ -26,26 +26,12 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - #include "effect_label.h" - #include "sample_track.h" #include "song_editor.h" #include "embed.h" @@ -64,10 +50,6 @@ sampleTCO::sampleTCO( track * _track ) : trackContentObject( _track ), m_sampleBuffer( new sampleBuffer ) { -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif - saveJournallingState( FALSE ); setSampleFile( "" ); restoreJournallingState(); @@ -181,11 +163,10 @@ void sampleTCO::mouseDoubleClickEvent( QMouseEvent * ) void sampleTCO::paintEvent( QPaintEvent * _pe ) { -#ifdef QT4 QPainter p( this ); #warning TODO: set according brush for gradient! p.fillRect( _pe->rect(), QColor( 64, 64, 64 ) ); -#else +#if 0 // create pixmap for our widget QPixmap pm( _pe->rect().size() ); // and a painter for it @@ -233,10 +214,6 @@ void sampleTCO::paintEvent( QPaintEvent * _pe ) { p.drawPixmap( 3, 8, embed::getIconPixmap( "muted", 16, 16 ) ); } - -#ifndef QT4 - bitBlt( this, _pe->rect().topLeft(), &pm ); -#endif } @@ -385,11 +362,7 @@ sampleTrack::sampleTrack( trackContainer * _tc ) : m_volumeKnob->move( 4, 4 ); m_volumeKnob->setLabel( tr( "VOL" ) ); m_volumeKnob->show(); -#ifdef QT4 m_volumeKnob->setWhatsThis( -#else - QWhatsThis::add( m_volumeKnob, -#endif tr( "With this knob you can set " "the volume of the opened " "channel." ) ); @@ -427,7 +400,7 @@ bool FASTCALL sampleTrack::play( const midiTime & _start, m_audioPort->getEffects()->startRunning(); bool played_a_note = FALSE; // will be return variable - for( csize i = 0; i < numOfTCOs(); ++i ) + for( int i = 0; i < numOfTCOs(); ++i ) { trackContentObject * tco = getTCO( i ); if( tco->startPosition() != _start ) diff --git a/src/widgets/automatable_button.cpp b/src/widgets/automatable_button.cpp index 99b7750ff..40421194c 100644 --- a/src/widgets/automatable_button.cpp +++ b/src/widgets/automatable_button.cpp @@ -26,25 +26,12 @@ */ -#include "automatable_button.h" - -#ifndef QT3 - #include #include #include #include -#else - -#include -#include -#include - -#define indexOf findIndex - -#endif - +#include "automatable_button.h" #include "automatable_object_templates.h" #include "embed.h" @@ -52,11 +39,7 @@ automatableButton::automatableButton( QWidget * _parent, const QString & _name, track * _track ) : - QWidget( _parent -#ifndef QT4 - , _name.ascii() -#endif - ), + QWidget( _parent ), autoObj( _track, FALSE, FALSE, TRUE ), m_group( NULL ), m_checkable( FALSE ) @@ -66,9 +49,7 @@ automatableButton::automatableButton( QWidget * _parent, const QString & _name, getAutomationPattern(); } setInitValue( FALSE ); -#ifdef QT4 setAccessibleName( _name ); -#endif } @@ -113,9 +94,9 @@ void automatableButton::contextMenuEvent( QContextMenuEvent * _me ) } QMenu contextMenu( target ); -#ifdef QT4 +#warning TODO: set according CSS-formatting contextMenu.setTitle( target->accessibleName() ); -#else +#if 0 QLabel * caption = new QLabel( "" + QString( target->accessibleName() ) + "", this ); @@ -208,11 +189,7 @@ void automatableButton::setValue( const bool _on ) automatableButtonGroup::automatableButtonGroup( QWidget * _parent, const QString & _name, track * _track ) : - QWidget( _parent -#ifndef QT4 - , _name.ascii() -#endif - ), + QWidget( _parent ), automatableObject( _track ) { hide(); @@ -221,9 +198,7 @@ automatableButtonGroup::automatableButtonGroup( QWidget * _parent, getAutomationPattern(); } setInitValue( 0 ); -#ifdef QT4 setAccessibleName( _name ); -#endif } @@ -296,11 +271,6 @@ void automatableButtonGroup::setValue( const int _value ) } -#ifdef QT3 -#undef indexOf -#endif - - #include "automatable_button.moc" #endif diff --git a/src/widgets/automatable_slider.cpp b/src/widgets/automatable_slider.cpp index 40d9fdd96..4d05889d2 100644 --- a/src/widgets/automatable_slider.cpp +++ b/src/widgets/automatable_slider.cpp @@ -25,23 +25,13 @@ */ -#include "automatable_slider.h" - -#ifndef QT3 #include #include #include #include -#else - -#include -#include -#include - -#endif - +#include "automatable_slider.h" #include "automatable_object_templates.h" #include "embed.h" #include "knob.h" @@ -51,18 +41,12 @@ automatableSlider::automatableSlider( QWidget * _parent, const QString & _name, class track * _track ) : - QSlider( _parent -#ifndef QT4 - , _name.ascii() -#endif - ), + QSlider( _parent ), m_show_status( FALSE ) { m_knob = new knob( knobDark_28, NULL, _name, _track ); -#ifdef QT4 setAccessibleName( _name ); -#endif connect( m_knob, SIGNAL( valueChanged( float ) ), this, SLOT( updateSlider( void ) ) ); @@ -119,9 +103,9 @@ void automatableSlider::contextMenuEvent( QContextMenuEvent * _me ) mouseReleaseEvent( NULL ); QMenu contextMenu( this ); -#ifdef QT4 +#warning TODO: use according CSS formatting contextMenu.setTitle( accessibleName() ); -#else +#if 0 QLabel * caption = new QLabel( "" + QString( accessibleName() ) + "", this ); caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); diff --git a/src/widgets/combobox.cpp b/src/widgets/combobox.cpp index b83e544b7..f1f7e5cae 100644 --- a/src/widgets/combobox.cpp +++ b/src/widgets/combobox.cpp @@ -25,14 +25,6 @@ */ -#include "combobox.h" -#include "automatable_object_templates.h" -#include "templates.h" -#include "embed.h" -#include "gui_templates.h" - -#ifndef QT3 - #include #include #include @@ -41,16 +33,11 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include - -#endif +#include "combobox.h" +#include "automatable_object_templates.h" +#include "templates.h" +#include "embed.h" +#include "gui_templates.h" QPixmap * comboBox::s_background = NULL; @@ -60,11 +47,7 @@ const int CB_ARROW_BTN_WIDTH = 20; comboBox::comboBox( QWidget * _parent, const QString & _name, track * _track ) : - QWidget( _parent -#ifndef QT4 - , _name.ascii() -#endif - ), + QWidget( _parent ), automatableObject( _track ), m_menu( this ), m_pressed( FALSE ) @@ -84,26 +67,15 @@ comboBox::comboBox( QWidget * _parent, const QString & _name, track * _track ) : setFont( pointSize<8>( font() ) ); m_menu.setFont( pointSize<8>( m_menu.font() ) ); -#ifndef QT3 connect( &m_menu, SIGNAL( triggered( QAction * ) ), this, SLOT( setItem( QAction * ) ) ); -#else - connect( &m_menu, SIGNAL( activated( int ) ), - this, SLOT( setItem( int ) ) ); -#endif - -#ifdef QT3 - setBackgroundMode( NoBackground ); -#endif if( _track != NULL ) { getAutomationPattern(); } setInitValue( 0 ); -#ifdef QT4 setAccessibleName( _name ); -#endif } @@ -121,26 +93,14 @@ void comboBox::addItem( const QString & _item, const QPixmap & _pixmap ) QPixmap pm = _pixmap; if( pm.height() > 16 ) { -#ifndef QT3 pm = pm.scaledToHeight( 16, Qt::SmoothTransformation ); -#else - pm.convertFromImage( pm.convertToImage().smoothScale( - pm.width(), 16, - QImage::ScaleMin ) ); -#endif } m_items.push_back( qMakePair( _item, pm ) ); m_menu.clear(); - for( vvector::iterator it = m_items.begin(); + for( QVector::iterator it = m_items.begin(); it != m_items.end(); ++it ) { - m_menu.addAction( ( *it ).second, ( *it ).first - // when using Qt3, we pass item-index as id for using - // it in setItem( int ) as index -#ifdef QT3 - , it - m_items.begin() -#endif - ); + m_menu.addAction( ( *it ).second, ( *it ).first ); } setRange( 0, m_items.size() - 1 ); } @@ -150,7 +110,7 @@ void comboBox::addItem( const QString & _item, const QPixmap & _pixmap ) int comboBox::findText( const QString & _txt ) const { - for( vvector::const_iterator it = m_items.begin(); + for( QVector::const_iterator it = m_items.begin(); it != m_items.end(); ++it ) { if( ( *it ).first == _txt ) @@ -187,9 +147,9 @@ void comboBox::contextMenuEvent( QContextMenuEvent * _me ) } QMenu contextMenu( this ); -#ifdef QT4 contextMenu.setTitle( accessibleName() ); -#else +#warning TODO: add css-formatting +#if 0 QLabel * caption = new QLabel( "" + QString( accessibleName() ) + "", this ); @@ -247,12 +207,8 @@ void comboBox::mousePressEvent( QMouseEvent * _me ) void comboBox::paintEvent( QPaintEvent * _pe ) { -#ifndef QT3 QPainter p( this ); -#else - QPixmap draw_pm( rect().size() ); - QPainter p( &draw_pm, this ); -#endif + p.fillRect( rect(), QColor( 0, 0, 0 ) ); for( int x = 2; x < width() - 2; x += s_background->width() ) @@ -303,11 +259,6 @@ void comboBox::paintEvent( QPaintEvent * _pe ) p.drawText( tx, p.fontMetrics().height(), m_items[value()].first ); } - -#ifdef QT3 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } @@ -321,33 +272,12 @@ void comboBox::wheelEvent( QWheelEvent * _we ) -#ifndef QT3 - void comboBox::setItem( QAction * _item ) { setInitValue( findText( _item->text() ) ); } -void comboBox::setItem( int ) -{ -} - -#else - -void comboBox::setItem( QAction * ) -{ -} - - -void comboBox::setItem( int _item ) -{ - setInitValue( _item ); -} - - -#endif - #include "combobox.moc" diff --git a/src/widgets/cpuload_widget.cpp b/src/widgets/cpuload_widget.cpp index 133f1ba6f..1e8ca3a40 100644 --- a/src/widgets/cpuload_widget.cpp +++ b/src/widgets/cpuload_widget.cpp @@ -26,19 +26,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "cpuload_widget.h" #include "embed.h" #include "engine.h" @@ -61,10 +50,6 @@ cpuloadWidget::cpuloadWidget( QWidget * _parent ) : connect( &m_updateTimer, SIGNAL( timeout() ), this, SLOT( updateCpuLoad() ) ); m_updateTimer.start( 100 ); // update cpu-load at 10 fps - -#ifndef QT4 - setBackgroundMode( NoBackground ); -#endif } diff --git a/src/widgets/fade_button.cpp b/src/widgets/fade_button.cpp index 81825a366..69da9bb7a 100644 --- a/src/widgets/fade_button.cpp +++ b/src/widgets/fade_button.cpp @@ -25,24 +25,12 @@ */ -#include "fade_button.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - +#include "fade_button.h" #include "update_event.h" @@ -53,9 +41,6 @@ fadeButton::fadeButton( const QColor & _normal_color, m_normalColor( _normal_color ), m_activatedColor( _activated_color ) { -#ifndef QT4 - setBackgroundMode( NoBackground ); -#endif } @@ -86,11 +71,7 @@ void fadeButton::reset( void ) -#ifndef QT3 void fadeButton::customEvent( QEvent * ) -#else -void fadeButton::customEvent( QCustomEvent * ) -#endif { update(); } @@ -117,25 +98,10 @@ void fadeButton::paintEvent( QPaintEvent * _pe ) m_state -= 0.1f; QTimer::singleShot( 20, this, SLOT( update() ) ); } -#ifdef QT4 QPainter p( this ); p.fillRect( rect(), col ); -#else - QPixmap draw_pm( rect().size() ); - draw_pm.fill( col ); - - QPainter p( &draw_pm, this ); -#endif p.setPen( QColor( 0, 0, 0 ) ); -#ifndef QT3 p.drawRect( 0, 0, rect().right(), rect().bottom() ); -#else - p.drawRect( rect() ); -#endif -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index 06d671258..f84f845f7 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -25,21 +25,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif #ifndef __USE_XOPEN #define __USE_XOPEN @@ -64,9 +53,7 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent, m_origHeight( height() ), m_animating( FALSE ) { -#ifndef QT3 setAutoFillBackground( TRUE ); -#endif if( s_ledBg == NULL ) { @@ -153,12 +140,8 @@ void groupBox::animate( void ) } resize( width(), height() + dy ); QTimer::singleShot( 10, this, SLOT( animate() ) ); -#ifdef QT4 QObjectList ch = parent()->children(); -#else - QObjectList ch = *( parent()->children() ); -#endif - for( csize i = 0; i < ch.count(); ++i ) + for( int i = 0; i < ch.count(); ++i ) { QWidget * w = dynamic_cast( ch.at( i ) ); if( w == NULL || w->y() < y() + height() ) @@ -167,12 +150,8 @@ void groupBox::animate( void ) } w->move( w->x(), w->y() + dy ); } -#ifdef QT4 ch = children(); -#else - ch = *children(); -#endif - for( csize i = 0; i < ch.count(); ++i ) + for( int i = 0; i < ch.count(); ++i ) { QWidget * w = dynamic_cast( ch.at( i ) ); if( w == NULL || w == m_led ) @@ -196,14 +175,9 @@ void groupBox::animate( void ) void groupBox::updatePixmap( void ) { -#ifndef QT3 const int c = 0; QColor bg_color = QApplication::palette().color( QPalette::Active, QPalette::Background ); -#else - const int c = 1; - QColor bg_color = QApplication::palette().active().background(); -#endif QPixmap pm( size() ); pm.fill( bg_color.dark( 132 ) ); @@ -233,22 +207,13 @@ void groupBox::updatePixmap( void ) //p.setPen( QColor( 255, 255, 255 ) ); -#ifndef QT3 p.setPen( palette().color( QPalette::Active, QPalette::ButtonText ) ); -#else - p.setPen( colorGroup().buttonText() ); -#endif p.setFont( pointSize<7>( font() ) ); p.drawText( 22, 10, m_caption ); -#ifdef QT4 QPalette pal = palette(); pal.setBrush( backgroundRole(), QBrush( pm ) ); setPalette( pal ); -#else - setPaletteBackgroundColor( bg_color.dark( 132 ) ); - setErasePixmap( pm ); -#endif } diff --git a/src/widgets/kmultitabbar.cpp b/src/widgets/kmultitabbar.cpp index 05f66c93f..39bfba030 100644 --- a/src/widgets/kmultitabbar.cpp +++ b/src/widgets/kmultitabbar.cpp @@ -3,10 +3,6 @@ #include "templates.h" #include "tooltip.h" -#include "qt3support.h" - -#ifndef QT3 - #include "kmultitabbar.h" #include @@ -893,803 +889,5 @@ QList* KMultiTabBar::buttons() {return &m_buttons;} #include "kmultitabbar.moc" -#else - - -#include "kmultitabbar-qt3.h" - -#include -#include -#include -#include -#include -#include -#include - - -class KMultiTabBarTabPrivate { -public: - QPixmap pix; -}; - - -KMultiTabBarInternal::KMultiTabBarInternal(QWidget *parent, KMultiTabBar::KMultiTabBarMode m):Q3ScrollView(parent) -{ - m_expandedTabSize=-1; - m_showActiveTabTexts=false; - m_tabs.setAutoDelete(true); - setHScrollBarMode(AlwaysOff); - setVScrollBarMode(AlwaysOff); - if (m==KMultiTabBar::Vertical) - { - box=new QWidget(viewport()); - mainLayout=new QVBoxLayout(box); - mainLayout->setAutoAdd(true); - box->setFixedWidth(24); - setFixedWidth(24); - } - else - { - box=new QWidget(viewport()); - mainLayout=new QHBoxLayout(box); - mainLayout->setAutoAdd(true); - box->setFixedHeight(24); - setFixedHeight(24); - } - mainLayout->setMargin( 0 ); - mainLayout->setSpacing( 0 ); - addChild(box); - setFrameStyle(NoFrame); - viewport()->setBackgroundMode(Qt::PaletteBackground); -} - -void KMultiTabBarInternal::setStyle(enum KMultiTabBar::KMultiTabBarStyle style) -{ - m_style=style; - for (csize i=0;isetStyle(m_style); - - if ( (m_style==KMultiTabBar::KDEV3) || - (m_style==KMultiTabBar::KDEV3ICON ) ) { - resizeEvent(0); - } - viewport()->update(); -} - - -void KMultiTabBarInternal::contentsMousePressEvent(QMouseEvent *ev) -{ - ev->ignore(); -} - -void KMultiTabBarInternal::mousePressEvent(QMouseEvent *ev) -{ - ev->ignore(); -} - -void KMultiTabBarInternal::resizeEvent(QResizeEvent *ev) { - //kdDebug()<<"KMultiTabBarInternal::resizeEvent"<setGeometry(0,0,width(),height()); - int lines=1; - int space; - int tmp=0; - if ((m_position==KMultiTabBar::Bottom) || (m_position==KMultiTabBar::Top)) - space=width(); - else - space=height(); - - int cnt=0; -//CALCULATE LINES - for (csize i=0;ineededSize(); - if (tmp>space) { - if (cnt>1)i--; - cnt=0; - tmp=0; - lines++; - } - } -//SET SIZE & PLACE - if ((m_position==KMultiTabBar::Bottom) || (m_position==KMultiTabBar::Top)) { - setFixedHeight(lines*24); - box->setFixedHeight(lines*24); - tmp=0; - cnt=0; - m_lines=lines; - lines=0; - for (csize i=0;ineededSize(); - if (tmp>space) { - if (cnt>1) i--; - else - m_tabs.at(i)->move(tmp-m_tabs.at(i)->neededSize(),lines*24); - cnt=0; - tmp=0; - lines++; - } else m_tabs.at(i)->move(tmp-m_tabs.at(i)->neededSize(),lines*24); - } - } - else { - setFixedWidth(lines*24); - box->setFixedWidth(lines*24); - tmp=0; - cnt=0; - m_lines=lines; - lines=0; - for (csize i=0;ineededSize(); - if (tmp>space) { - if (cnt>1) i--; - else - m_tabs.at(i)->move(lines*24,tmp-m_tabs.at(i)->neededSize()); - cnt=0; - tmp=0; - lines++; - } else m_tabs.at(i)->move(lines*24,tmp-m_tabs.at(i)->neededSize()); - } - } - - - //kdDebug()<<"needed lines:"< it(m_tabs);it.current();++it){ - if (it.current()->id()==id) return it.current(); - } - return 0; -} - - -int KMultiTabBarInternal::appendTab(const QPixmap &pic ,int id,const QString& text) -{ - KMultiTabBarTab *tab; - m_tabs.append(tab= new KMultiTabBarTab(pic,text,id,box,m_position,m_style)); - tab->showActiveTabText(m_showActiveTabTexts); - if (m_style==KMultiTabBar::KONQSBC) - { - if (m_expandedTabSizeneededSize()) { - m_expandedTabSize=tab->neededSize(); - for (csize i=0;isetSize(m_expandedTabSize); - - } else tab->setSize(m_expandedTabSize); - } else tab->updateState(); - tab->show(); - return 0; -} - -void KMultiTabBarInternal::removeTab(int id) -{ - for (csize pos=0;posid()==id) - { - delete m_tabs.at(pos); - m_tabs.remove(pos); - resizeEvent(0); - break; - } - } -} - -void KMultiTabBarInternal::setPosition(enum KMultiTabBar::KMultiTabBarPosition pos) -{ - m_position=pos; - for (csize i=0;isetTabsPosition(m_position); - viewport()->update(); -} - - -KMultiTabBarButton::KMultiTabBarButton(const QPixmap& pic,const QString& text, QMenu *popup, - int id,QWidget *parent,KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style) - :QPushButton(QIcon(),text,parent),m_style(style) -{ - setIcon(pic); - setText(text); - m_position=pos; - if (popup) setMenu(popup); - setFlat(true); - setFixedHeight(24); - setFixedWidth(24); - m_id=id; - toolTip::add( this, text ); - connect(this,SIGNAL(clicked()),this,SLOT(slotClicked())); -} - -KMultiTabBarButton::KMultiTabBarButton(const QString& text, QMenu *popup, - int id,QWidget *parent,KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style) - :QPushButton(QIcon(),text,parent),m_style(style) -{ - setText(text); - m_position=pos; - if (popup) setMenu(popup); - setFlat(true); - setFixedHeight(24); - setFixedWidth(24); - m_id=id; - toolTip::add(this,text); - connect(this,SIGNAL(clicked()),this,SLOT(slotClicked())); -} - -KMultiTabBarButton::~KMultiTabBarButton() { -} - -int KMultiTabBarButton::id() const{ - return m_id; -} - -void KMultiTabBarButton::setText(const QString& text) -{ - QPushButton::setText(text); - m_text=text; - toolTip::add(this,text); -} - -void KMultiTabBarButton::slotClicked() -{ - emit clicked(m_id); -} - -void KMultiTabBarButton::setPosition(KMultiTabBar::KMultiTabBarPosition pos) -{ - m_position=pos; - update(); -} - -void KMultiTabBarButton::setStyle(KMultiTabBar::KMultiTabBarStyle style) -{ - m_style=style; - update(); -} - -void KMultiTabBarButton::hideEvent( QHideEvent* he) { - QPushButton::hideEvent(he); - KMultiTabBar *tb=dynamic_cast(parentWidget()); - if (tb) tb->updateSeparator(); -} - -void KMultiTabBarButton::showEvent( QShowEvent* he) { - QPushButton::showEvent(he); - KMultiTabBar *tb=dynamic_cast(parentWidget()); - if (tb) tb->updateSeparator(); -} - - -QSize KMultiTabBarButton::sizeHint() const -{ - ensurePolished(); - - int w = 0, h = 0; - - // calculate contents size... -#ifndef QT_NO_ICONSET - if ( iconSet() && !iconSet()->isNull() ) { - int iw = iconSet()->pixmap( QIcon::Small, QIcon::Normal ).width() + 4; - int ih = iconSet()->pixmap( QIcon::Small, QIcon::Normal ).height(); - w += iw; - h = tMax( h, ih ); - } -#endif - if( isMenuButton() ) - w += style().pixelMetric(QStyle::PM_MenuButtonIndicator, this); - - if ( pixmap() ) { - QPixmap *pm = (QPixmap *)pixmap(); - w += pm->width(); - h += pm->height(); - } else { - QString s( text() ); - bool empty = s.isEmpty(); - if ( empty ) - s = QString::fromLatin1("XXXX"); - QFontMetrics fm = fontMetrics(); - QSize sz = fm.size( Qt::ShowPrefix, s ); - if(!empty || !w) - w += sz.width(); - if(!empty || !h) - h = tMax(h, sz.height()); - } - return (style().sizeFromContents(QStyle::CT_ToolButton, this, QSize(w, h)). - expandedTo(QApplication::globalStrut())); -} - - -KMultiTabBarTab::KMultiTabBarTab(const QPixmap& pic, const QString& text, - int id,QWidget *parent,KMultiTabBar::KMultiTabBarPosition pos, - KMultiTabBar::KMultiTabBarStyle style) - :KMultiTabBarButton(text,0,id,parent,pos,style), - m_showActiveTabText(false) -{ - d=new KMultiTabBarTabPrivate(); - setIcon(pic); - m_expandedSize=24; - setToggleButton(true); -} - -KMultiTabBarTab::~KMultiTabBarTab() { - delete d; -} - - -void KMultiTabBarTab::setTabsPosition(KMultiTabBar::KMultiTabBarPosition pos) -{ - if ((pos!=m_position) && ((pos==KMultiTabBar::Left) || (pos==KMultiTabBar::Right))) { - if (!d->pix.isNull()) { - QMatrix temp;// (1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F); - temp.rotate(180); - d->pix=d->pix.transformed(temp); - setIcon(d->pix); - } - } - - setPosition(pos); -// update(); -} - -void KMultiTabBarTab::setIcon(const QString& icon) -{ - //QPixmap pic=SmallIcon(icon); - QPixmap pic (icon); - setIcon(pic); -} - -void KMultiTabBarTab::setIcon(const QPixmap& icon) -{ - - if (m_style!=KMultiTabBar::KDEV3) { - if ((m_position==KMultiTabBar::Left) || (m_position==KMultiTabBar::Right)) { - QMatrix rotateMatrix; - if (m_position==KMultiTabBar::Left) - rotateMatrix.rotate(90); - else - rotateMatrix.rotate(-90); - QPixmap pic=icon.transformed(rotateMatrix); - d->pix=pic; - setIconSet(pic); - } else - setIconSet(icon); - } -} - -void KMultiTabBarTab::slotClicked() -{ - updateState(); - KMultiTabBarButton::slotClicked(); -} - -void KMultiTabBarTab::setState(bool b) -{ - setOn(b); - updateState(); -} - -void KMultiTabBarTab::updateState() -{ - - if (m_style!=KMultiTabBar::KONQSBC) { - if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) { - QPushButton::setText(m_text); - } else { - QPushButton::setText(QString::null); - } - - if ((m_position==KMultiTabBar::Right || m_position==KMultiTabBar::Left)) { - setFixedWidth(24); - if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) { - setFixedHeight(KMultiTabBarButton::sizeHint().width()); - } else setFixedHeight(36); - } else { - setFixedHeight(24); - if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) { - setFixedWidth(KMultiTabBarButton::sizeHint().width()); - } else setFixedWidth(36); - } - } else { - if ((!isOn()) || (!m_showActiveTabText)) - { - setFixedWidth(24); - setFixedHeight(24); - return; - } - if ((m_position==KMultiTabBar::Right || m_position==KMultiTabBar::Left)) - setFixedHeight(m_expandedSize); - else - setFixedWidth(m_expandedSize); - } - -} - -int KMultiTabBarTab::neededSize() -{ - return (((m_style!=KMultiTabBar::KDEV3)?24:0)+QFontMetrics(QFont()).width(m_text)+6); -} - -void KMultiTabBarTab::setSize(int size) -{ - m_expandedSize=size; - updateState(); -} - -void KMultiTabBarTab::showActiveTabText(bool show) -{ - m_showActiveTabText=show; -} - -void KMultiTabBarTab::drawButtonLabel(QPainter *p) { - drawButton(p); -} -void KMultiTabBarTab::drawButton(QPainter *paint) -{ - if (m_style!=KMultiTabBar::KONQSBC) drawButtonStyled(paint); - else drawButtonClassic(paint); -} - -void KMultiTabBarTab::drawButtonStyled(QPainter *paint) { - - QSize sh; - const int width = 36; // rotated - const int height = 24; - if ((m_style==KMultiTabBar::KDEV3) || (m_style==KMultiTabBar::KDEV3ICON) || (isOn())) - sh=KMultiTabBarButton::sizeHint(); - else - sh=QSize(width,height); - - QPixmap pixmap( sh.width(),height); ///,sh.height()); - pixmap.fill(eraseColor()); - QPainter painter(&pixmap); - - - QStyle::SFlags st=QStyle::Style_Default; - - st|=QStyle::Style_Enabled; - - if (isOn()) st|=QStyle::Style_On; - - style().drawControl(QStyle::CE_PushButton,&painter,this, QRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st); - style().drawControl(QStyle::CE_PushButtonLabel,&painter,this, QRect(0,0,pixmap.width(),pixmap.height()), colorGroup(),st); - - switch (m_position) { - case KMultiTabBar::Left: - paint->rotate(-90); - paint->drawPixmap(1-pixmap.width(),0,pixmap); - break; - case KMultiTabBar::Right: - paint->rotate(90); - paint->drawPixmap(0,1-pixmap.height(),pixmap); - break; - - default: - paint->drawPixmap(0,0,pixmap); - break; - } - -} - -void KMultiTabBarTab::drawButtonClassic(QPainter *paint) -{ - QPixmap pixmap; - if( iconSet() ) - pixmap = iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ); - - paint->fillRect(0, 0, 24, 24, palette().background()); - - if (!isOn()) - { - - if (m_position==KMultiTabBar::Right) - { - paint->fillRect(0,0,21,21,QBrush(palette().background())); - - paint->setPen(palette().background().dark(150)); - paint->drawLine(0,22,23,22); - - paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap); - - paint->setPen(palette().shadow()); - paint->drawLine(0,0,0,23); - paint->setPen(palette().background().dark(120)); - paint->drawLine(1,0,1,23); - - } - else - if ((m_position==KMultiTabBar::Bottom) || (m_position==KMultiTabBar::Top)) - { - paint->fillRect(0,1,23,22,QBrush(palette().background())); - - paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap); - - paint->setPen(palette().background().dark(120)); - paint->drawLine(23,0,23,23); - - - paint->setPen(palette().light()); - paint->drawLine(0,22,23,22); - paint->drawLine(0,23,23,23); - paint->setPen(palette().shadow()); - paint->drawLine(0,0,23,0); - paint->setPen(palette().background().dark(120)); - paint->drawLine(0,1,23,1); - - } - else - { - paint->setPen(palette().background().dark(120)); - paint->drawLine(0,23,23,23); - paint->fillRect(0,0,23,21,QBrush(palette().background())); - paint->drawPixmap(12-pixmap.width()/2,12-pixmap.height()/2,pixmap); - - paint->setPen(palette().light()); - paint->drawLine(23,0,23,23); - paint->drawLine(22,0,22,23); - - paint->setPen(palette().shadow()); - paint->drawLine(0,0,0,23); - - } - - - } - else - { - if (m_position==KMultiTabBar::Right) - { - paint->setPen(palette().shadow()); - paint->drawLine(0,height()-1,23,height()-1); - paint->drawLine(0,height()-2,23,height()-2); - paint->drawLine(23,0,23,height()-1); - paint->drawLine(22,0,22,height()-1); - paint->fillRect(0,0,21,height()-3,QBrush(palette().light())); - paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap); - - if (m_showActiveTabText) - { - if (height()<25+4) return; - - QPixmap tpixmap(height()-25-3, width()-2); - QPainter painter(&tpixmap); - - painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),QBrush(palette().light())); - - painter.setPen(palette().text()); - painter.drawText(0,+width()/2+QFontMetrics(QFont()).height()/2,m_text); - - paint->rotate(90); - paint->drawPixmap(25,-tpixmap.height()+1,tpixmap); - } - - } - else - if (m_position==KMultiTabBar::Top) - { - paint->fillRect(0,0,width()-1,23,QBrush(palette().light())); - paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap); - if (m_showActiveTabText) - { - paint->setPen(palette().text()); - paint->drawText(25,height()/2+QFontMetrics(QFont()).height()/2,m_text); - } - } - else - if (m_position==KMultiTabBar::Bottom) - { - paint->setPen(palette().shadow()); - paint->drawLine(0,23,width()-1,23); - paint->drawLine(0,22,width()-1,22); - paint->fillRect(0,0,width()-1,21,QBrush(palette().light())); - paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap); - if (m_showActiveTabText) - { - paint->setPen(palette().text()); - paint->drawText(25,height()/2+QFontMetrics(QFont()).height()/2,m_text); - } - - } - else - { - - - paint->setPen(palette().shadow()); - paint->drawLine(0,height()-1,23,height()-1); - paint->drawLine(0,height()-2,23,height()-2); - paint->fillRect(0,0,23,height()-3,QBrush(palette().light())); - paint->drawPixmap(10-pixmap.width()/2,10-pixmap.height()/2,pixmap); - if (m_showActiveTabText) - { - - if (height()<25+4) return; - - QPixmap tpixmap(height()-25-3, width()-2); - QPainter painter(&tpixmap); - - painter.fillRect(0,0,tpixmap.width(),tpixmap.height(),QBrush(palette().light())); - - painter.setPen(palette().text()); - painter.drawText(tpixmap.width()-QFontMetrics(QFont()).width(m_text),+width()/2+QFontMetrics(QFont()).height()/2,m_text); - - paint->rotate(-90); - - paint->drawPixmap(-24-tpixmap.width(),2,tpixmap); - - } - - } - - } -} - - - - - - - -KMultiTabBar::KMultiTabBar( KMultiTabBarMode m, QWidget *parent):QWidget(parent) -{ - m_buttons.setAutoDelete(false); - if (m==Vertical) - { - m_l=new QVBoxLayout(this); - setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding , true)); - } - else - { - m_l=new QHBoxLayout(this); - setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed , true)); - } - m_l->setMargin(0); - m_l->setAutoAdd(false); - m_internal=new KMultiTabBarInternal(this,m); - setPosition((m==Vertical)?KMultiTabBar::Right:KMultiTabBar::Bottom); - setStyle(VSNET); - m_l->insertWidget(0,m_internal); - m_l->insertWidget(0,m_btnTabSep=new QFrame(this)); - m_btnTabSep->setFixedHeight(4); - m_btnTabSep->setFrameStyle(QFrame::Panel | QFrame::Sunken); - m_btnTabSep->setLineWidth(2); - m_btnTabSep->hide(); - - updateGeometry(); -} - -KMultiTabBar::~KMultiTabBar() { -} - - -int KMultiTabBar::appendButton(const QPixmap &pic ,int id,QMenu *popup,const QString&) -{ - KMultiTabBarButton *btn; - m_buttons.append(btn= new KMultiTabBarButton(pic,QString::null, - popup,id,this,m_position,m_internal->m_style)); - m_l->insertWidget(0,btn); - btn->show(); - m_btnTabSep->show(); - return 0; -} - -void KMultiTabBar::updateSeparator() { - bool hideSep=true; - for (QPtrListIterator it(m_buttons);it.current();++it){ - if (it.current()->isVisibleTo(this)) { - hideSep=false; - break; - } - } - if (hideSep) m_btnTabSep->hide(); - else m_btnTabSep->show(); - -} - -int KMultiTabBar::appendTab(const QPixmap &pic ,int id ,const QString& text) -{ - m_internal->appendTab(pic,id,text); - return 0; -} - -KMultiTabBarButton* KMultiTabBar::button(int id) const -{ - for (QPtrListIterator it(m_buttons);it.current();++it){ - if (it.current()->id()==id) return it.current(); - } - return 0; -} - -KMultiTabBarTab* KMultiTabBar::tab(int id) const -{ - return m_internal->tab(id); -} - - - -void KMultiTabBar::removeButton(int id) -{ - for (csize pos=0;posid()==id) - { - m_buttons.at(pos)->deleteLater(); - m_buttons.remove(pos); - break; - } - } - if (m_buttons.count()==0) m_btnTabSep->hide(); -} - -void KMultiTabBar::removeTab(int id) -{ - m_internal->removeTab(id); -} - -void KMultiTabBar::setTab(int id,bool state) -{ - KMultiTabBarTab *ttab=tab(id); - if (ttab) - { - ttab->setState(state); - } -} - -bool KMultiTabBar::isTabRaised(int id) const -{ - KMultiTabBarTab *ttab=tab(id); - if (ttab) - { - return ttab->isOn(); - } - - return false; -} - - -void KMultiTabBar::showActiveTabTexts(bool show) -{ - m_internal->showActiveTabTexts(show); -} - -void KMultiTabBar::setStyle(KMultiTabBarStyle style) -{ - m_internal->setStyle(style); -} - -void KMultiTabBar::setPosition(KMultiTabBarPosition pos) -{ - m_position=pos; - m_internal->setPosition(pos); - for (csize i=0;isetPosition(pos); -} -void KMultiTabBar::fontChange(const QFont& /* oldFont */) -{ - for (csize i=0;icount();i++) - tabs()->at(i)->resize(); - update(); -} - -tabList * KMultiTabBar::tabs() {return m_internal->tabs();} -buttonList * KMultiTabBar::buttons() {return &m_buttons;} - - -#include "kmultitabbar-qt3.moc" - -#endif - - - #endif diff --git a/src/widgets/knob.cpp b/src/widgets/knob.cpp index cfb416ede..7bddd84c1 100644 --- a/src/widgets/knob.cpp +++ b/src/widgets/knob.cpp @@ -28,10 +28,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -42,23 +38,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define addSeparator insertSeparator - -#endif #ifndef __USE_XOPEN #define __USE_XOPEN @@ -67,7 +46,6 @@ #include "knob.h" #include "automatable_object_templates.h" -/*#include "midi_client.h"*/ #include "embed.h" #include "spc_bg_hndl_widget.h" #include "config_mgr.h" @@ -88,11 +66,7 @@ textFloat * knob::s_textFloat = NULL; knob::knob( int _knob_num, QWidget * _parent, const QString & _name, track * _track ) : - QWidget( _parent -#ifndef QT4 - , _name.ascii() -#endif - ), + QWidget( _parent ), autoObj( _track ), m_mouseOffset( 0.0f ), m_buttonPressed( FALSE ), @@ -110,15 +84,10 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name, setAcceptDrops( TRUE ); -#ifdef QT4 setAccessibleName( _name ); m_knobPixmap = new QPixmap( embed::getIconPixmap( QString( "knob0" + QString::number( m_knobNum + 1 ) ).toAscii().constData() ) ); -#else - setBackgroundMode( Qt::NoBackground ); - m_knobPixmap = new QPixmap( embed::getIconPixmap( "knob0" + - QString::number( m_knobNum + 1 ) ) ); -#endif + if( _track != NULL ) { getAutomationPattern(); @@ -353,9 +322,9 @@ void knob::contextMenuEvent( QContextMenuEvent * ) mouseReleaseEvent( NULL ); QMenu contextMenu( this ); -#ifdef QT4 contextMenu.setTitle( accessibleName() ); -#else +#warning TODO: css-formatting +#if 0 QLabel * caption = new QLabel( "" + QString( accessibleName() ) + "", this ); caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); @@ -546,37 +515,23 @@ void knob::mouseDoubleClickEvent( QMouseEvent * ) void knob::paintEvent( QPaintEvent * _me ) { QRect ur = _me->rect(); -#ifndef QT4 - if( ur.isValid() ) - { -#endif -#ifdef QT4 - QPainter p( this ); -#else - QPixmap pix( ur.size() ); - pix.fill( this, ur.topLeft() ); - QPainter p( &pix, this ); -#endif - p.translate( -ur.x(), -ur.y() ); - drawKnob( &p ); - if( m_label != "" ) - { - p.setFont( pointSize<6>( p.font() ) ); - p.setPen( QColor( 64, 64, 64 ) ); - p.drawText( width() / 2 - - p.fontMetrics().width( m_label ) / 2 + 1, - height() - 1, m_label ); - p.setPen( QColor( 255, 255, 255 ) ); - p.drawText( width() / 2 - - p.fontMetrics().width( m_label ) / 2, - height() - 2, m_label ); - } -#ifndef QT4 - p.end(); - bitBlt( this, ur.topLeft(), &pix ); - } -#endif + QPainter p( this ); + + p.translate( -ur.x(), -ur.y() ); + drawKnob( &p ); + if( m_label != "" ) + { + p.setFont( pointSize<6>( p.font() ) ); + p.setPen( QColor( 64, 64, 64 ) ); + p.drawText( width() / 2 - + p.fontMetrics().width( m_label ) / 2 + 1, + height() - 1, m_label ); + p.setPen( QColor( 255, 255, 255 ) ); + p.drawText( width() / 2 - + p.fontMetrics().width( m_label ) / 2, + height() - 2, m_label ); + } } @@ -712,19 +667,13 @@ void knob::enterValue( void ) { bool ok; float new_val = QInputDialog::getDouble( -#ifdef QT4 this, -#endif accessibleName(), tr( "Please enter a new value between " "%1 and %2:" ).arg( minValue() ).arg( maxValue() ), value(), minValue(), maxValue(), - 4, &ok -#ifndef QT4 - , this -#endif - ); + 4, &ok ); if( ok ) { setValue( new_val ); @@ -744,13 +693,8 @@ void knob::connectToMidiDevice( void ) void knob::displayHelp( void ) { -#ifdef QT4 QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), whatsThis() ); -#else - QWhatsThis::display( QWhatsThis::textFor( this ), mapToGlobal( - rect().bottomRight() ) ); -#endif } @@ -759,8 +703,4 @@ void knob::displayHelp( void ) #include "knob.moc" -#ifndef QT4 -#undef addSeparator -#endif - #endif diff --git a/src/widgets/lcd_spinbox.cpp b/src/widgets/lcd_spinbox.cpp index e4c4f6a04..d68205835 100644 --- a/src/widgets/lcd_spinbox.cpp +++ b/src/widgets/lcd_spinbox.cpp @@ -25,26 +25,12 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include #include -#else - -#include -#include -#include -#include - -#endif - - #include "lcd_spinbox.h" #include "automatable_object_templates.h" #include "embed.h" @@ -55,11 +41,7 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent, const QString & _name, track * _track ) : - QWidget( _parent -#ifndef QT4 - , _name.ascii() -#endif - ), + QWidget( _parent ), autoObj( _track, 0, _min, _max ), m_label( NULL ), m_origMousePos() @@ -68,7 +50,7 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent, m_number->setFrameShape( QFrame::Panel ); m_number->setFrameShadow( QFrame::Sunken ); m_number->setSegmentStyle( QLCDNumber::Flat ); -#ifndef QT3 + QPalette pal; pal.setColor( QPalette::Light, Qt::gray ); pal.setColor( QPalette::Mid, Qt::darkGray ); @@ -76,7 +58,7 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent, pal.setColor( m_number->backgroundRole(), Qt::black ); m_number->setPalette( pal ); m_number->setAutoFillBackground( TRUE ); -#endif + setEnabled( TRUE ); if( _track != NULL ) @@ -86,9 +68,8 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent, // value is automatically limited to given range setInitValue( 0 ); -#ifdef QT4 + setAccessibleName( _name ); -#endif m_number->setFixedSize( m_number->sizeHint() * 0.9 ); setFixedSize( m_number->size() ); @@ -163,15 +144,11 @@ void lcdSpinBox::setEnabled( bool _on ) { fg = QColor( 160, 160, 160 ); } -#ifdef QT4 QPalette pal = m_number->palette(); pal.setColor( QPalette::Background, QColor( 32, 32, 32 ) ); pal.setColor( QPalette::Foreground, fg ); m_number->setPalette( pal ); -#else - m_number->setPaletteBackgroundColor( QColor( 32, 32, 32 ) ); - m_number->setPaletteForegroundColor( fg ); -#endif + QWidget::setEnabled( _on ); } @@ -195,9 +172,9 @@ void lcdSpinBox::contextMenuEvent( QContextMenuEvent * _me ) mouseReleaseEvent( NULL ); QMenu contextMenu( this ); -#ifdef QT4 contextMenu.setTitle( accessibleName() ); -#else +#warning TODO: CSS-formatting +#if 0 QLabel * caption = new QLabel( "" + QString( accessibleName() ) + "", this ); caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); @@ -229,11 +206,7 @@ void lcdSpinBox::mousePressEvent( QMouseEvent * _me ) void lcdSpinBox::mouseMoveEvent( QMouseEvent * _me ) { -#ifdef QT4 if( _me->buttons() & Qt::LeftButton ) -#else - if( _me->modifiers() == Qt::LeftButton ) -#endif { int dy = _me->globalY() - m_origMousePos.y(); if( dy > 1 || dy < -1 ) diff --git a/src/widgets/led_checkbox.cpp b/src/widgets/led_checkbox.cpp index 584f14c49..8f58bdfe4 100644 --- a/src/widgets/led_checkbox.cpp +++ b/src/widgets/led_checkbox.cpp @@ -25,22 +25,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include - -#endif - - #include "led_checkbox.h" #include "automatable_object_templates.h" #include "embed.h" @@ -67,17 +55,10 @@ ledCheckBox::ledCheckBox( const QString & _text, QWidget * _parent, { _color = YELLOW; } - m_ledOnPixmap = new QPixmap( embed::getIconPixmap( names[_color] -#ifdef QT4 - .toAscii().constData() -#endif - ) ); + m_ledOnPixmap = new QPixmap( embed::getIconPixmap( + names[_color].toAscii().constData() ) ); m_ledOffPixmap = new QPixmap( embed::getIconPixmap( "led_off" ) ); -#ifndef QT4 - setBackgroundMode( Qt::PaletteBackground ); -#endif - setFont( pointSizeF( font(), 7.5f ) ); setFixedSize( m_ledOffPixmap->width() + 4 + QFontMetrics( font() ).width( text() ), @@ -98,14 +79,8 @@ ledCheckBox::~ledCheckBox() void ledCheckBox::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( rect().size() ); - //draw_pm.fill( this, rect().topLeft() ); - QPainter p( &draw_pm, this ); -#endif p.drawPixmap( 0, 0, specialBgHandlingWidget::getBackground( this ) ); if( isChecked() == TRUE ) @@ -121,11 +96,6 @@ void ledCheckBox::paintEvent( QPaintEvent * ) p.drawText( m_ledOffPixmap->width() + 3, 9, text() ); p.setPen( QColor( 255, 255, 255 ) ); p.drawText( m_ledOffPixmap->width() + 2, 8, text() ); - -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } diff --git a/src/widgets/nstate_button.cpp b/src/widgets/nstate_button.cpp index b00d6a90d..2a4092522 100644 --- a/src/widgets/nstate_button.cpp +++ b/src/widgets/nstate_button.cpp @@ -25,15 +25,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#endif - - #include "nstate_button.h" #include "embed.h" #include "tooltip.h" diff --git a/src/widgets/pixmap_button.cpp b/src/widgets/pixmap_button.cpp index c792aab69..bce5a1bab 100644 --- a/src/widgets/pixmap_button.cpp +++ b/src/widgets/pixmap_button.cpp @@ -26,20 +26,9 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include - -#endif - - #include "pixmap_button.h" #include "automatable_object_templates.h" #include "embed.h" @@ -56,10 +45,6 @@ pixmapButton::pixmapButton( QWidget * _parent, const QString & _name, setActiveGraphic( embed::getIconPixmap( "led_yellow" ) ); setInactiveGraphic( embed::getIconPixmap( "led_off" ), FALSE ); -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif - //setCheckable( TRUE ); } @@ -75,14 +60,7 @@ pixmapButton::~pixmapButton() void pixmapButton::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( rect().size() ); - draw_pm.fill( this, rect().topLeft() ); - - QPainter p( &draw_pm, this ); -#endif if( !m_bgPixmap.isNull() ) { @@ -100,11 +78,6 @@ void pixmapButton::paintEvent( QPaintEvent * ) { p.drawPixmap( 0, 0, m_inactivePixmap ); } - -#ifndef QT4 - // and blit all the drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } diff --git a/src/widgets/project_notes.cpp b/src/widgets/project_notes.cpp index c545576f1..d267ff5b0 100644 --- a/src/widgets/project_notes.cpp +++ b/src/widgets/project_notes.cpp @@ -25,10 +25,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -40,32 +36,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define isChecked isOn -#define setChecked setOn -#define setFontWeight setBold -#define setFontUnderline setUnderline -#define setFontItalic setItalic -#define setFontFamily setFamily -#define setFontPointSize setPointSize -#define setTextColor setColor -#define setHtml setText -#define toHtml text - -#endif - - #include "project_notes.h" #include "embed.h" #include "engine.h" @@ -75,26 +45,16 @@ projectNotes::projectNotes( void ) : - QMainWindow( engine::getMainWindow()->workspace() -#ifndef QT4 - , 0, Qt::WStyle_Title -#endif - ) + QMainWindow( engine::getMainWindow()->workspace() ) { -#ifdef QT4 engine::getMainWindow()->workspace()->addWindow( this ); -#endif m_edit = new QTextEdit( this ); -#ifdef QT4 m_edit->setAutoFillBackground( TRUE ); QPalette pal; pal.setColor( m_edit->backgroundRole(), QColor( 64, 64, 64 ) ); m_edit->setPalette( pal ); -#else - m_edit->setTextFormat( RichText ); - m_edit->setPaletteBackgroundColor( QColor( 64, 64, 64 ) ); -#endif + clear(); connect( m_edit, SIGNAL( currentFontChanged( const QFont & ) ), @@ -141,15 +101,9 @@ projectNotes::~projectNotes() void projectNotes::clear( void ) { m_edit->setHtml( tr( "Put down your project notes here." ) ); -#ifdef QT4 m_edit->selectAll(); m_edit->setTextColor( QColor( 224, 224, 224 ) ); m_edit->setTextCursor( QTextCursor() ); -#else - m_edit->selectAll( TRUE ); - m_edit->setTextColor( QColor( 224, 224, 224 ) ); - m_edit->selectAll( FALSE ); -#endif } @@ -168,9 +122,6 @@ void projectNotes::setupActions() QToolBar * tb = new QToolBar( tr( "Edit Actions" ), this ); QAction * a; - // changes between qt3's toolbar-system and this of qt4 are too - // big, so we completely implement two versions -#ifdef QT4 a = new QAction( embed::getIconPixmap( "edit_undo" ), tr( "&Undo" ), tb ); a->setShortcut( tr( "Ctrl+Z" ) ); @@ -209,8 +160,8 @@ void projectNotes::setupActions() m_comboSize = new QComboBox( tb ); m_comboSize->setEditable( TRUE ); - vlist sizes = db.standardSizes(); - vlist::Iterator it = sizes.begin(); + QList sizes = db.standardSizes(); + QList::Iterator it = sizes.begin(); for ( ; it != sizes.end(); ++it ) { m_comboSize->addItem( QString::number( *it ) ); @@ -269,167 +220,6 @@ void projectNotes::setupActions() connect( m_actionTextColor, SIGNAL( activated() ), this, SLOT( textColor() ) ); -#else -#if QT_VERSION >= 0x030100 - a = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "edit_undo" ), tr( "&Undo" ), - CTRL + Key_Z, this ); - connect( a, SIGNAL( activated() ), m_edit, SLOT( undo() ) ); - a->addTo( tb ); - - a = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "edit_redo" ), tr( "&Redo" ), - CTRL + Key_Y, this ); - connect( a, SIGNAL( activated() ), m_edit, SLOT( redo() ) ); - a->addTo( tb ); - - a = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "edit_copy" ), tr( "&Copy" ), - CTRL + Key_C, this ); - connect( a, SIGNAL( activated() ), m_edit, SLOT( copy() ) ); - a->addTo( tb ); - - a = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "edit_cut" ), tr( "Cu&t" ), - CTRL + Key_X, this ); - connect( a, SIGNAL( activated() ), m_edit, SLOT( cut() ) ); - a->addTo( tb ); - - a = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "edit_paste" ), tr( "&Paste" ), - CTRL + Key_V, this ); - connect( a, SIGNAL( activated() ), m_edit, SLOT( paste() ) ); - a->addTo( tb ); - - - tb = new QToolBar( this ); - tb->setLabel( tr( "Format Actions" ) ); - - m_comboFont = new QComboBox( TRUE, tb ); - QFontDatabase db; - m_comboFont->insertStringList( db.families() ); - connect( m_comboFont, SIGNAL( activated( const QString & ) ), - m_edit, SLOT( setFamily( const QString & ) ) ); - m_comboFont->lineEdit()->setText( QApplication::font().family() ); - - m_comboSize = new QComboBox( TRUE, tb ); - vlist sizes = db.standardSizes(); - vlist::Iterator it = sizes.begin(); - for ( ; it != sizes.end(); ++it ) - { - m_comboSize->insertItem( QString::number( *it ) ); - } - connect( m_comboSize, SIGNAL( activated( const QString & ) ), - this, SLOT( textSize( const QString & ) ) ); - m_comboSize->lineEdit()->setText( QString::number( - QApplication::font().pointSize() ) ); - - m_actionTextBold = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "text_bold" ), - tr( "&Bold" ), CTRL + Key_B, this ); - connect( m_actionTextBold, SIGNAL( activated() ), this, - SLOT( textBold() ) ); - m_actionTextBold->addTo( tb ); - m_actionTextBold->setToggleAction( TRUE ); - - m_actionTextItalic = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "text_italic" ), - tr( "&Italic" ), CTRL + Key_I, this ); - connect( m_actionTextItalic, SIGNAL( activated() ), this, - SLOT( textItalic() ) ); - m_actionTextItalic->addTo( tb ); - m_actionTextItalic->setToggleAction( TRUE ); - - m_actionTextUnderline = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( - "text_under" ), - tr( "&Underline" ), - CTRL + Key_U, this ); - connect( m_actionTextUnderline, SIGNAL( activated() ), this, - SLOT( textUnderline() ) ); - m_actionTextUnderline->addTo( tb ); - m_actionTextUnderline->setToggleAction( TRUE ); - - QActionGroup * grp = new QActionGroup( this ); - connect( grp, SIGNAL( selected( QAction* ) ), this, - SLOT( textAlign( QAction* ) ) ); - - m_actionAlignLeft = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "text_left" ), - tr( "&Left" ), CTRL + Key_L, - grp ); - m_actionAlignLeft->setToggleAction( TRUE ); - m_actionAlignCenter = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( - "text_center" ), - tr( "C&enter" ), CTRL + Key_E, - grp ); - m_actionAlignCenter->setToggleAction( TRUE ); - - m_actionAlignRight = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( "text_right" ), - tr( "&Right" ), CTRL + Key_R, - grp ); - m_actionAlignRight->setToggleAction( TRUE ); - - m_actionAlignJustify = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - embed::getIconPixmap( - "text_block" ), - tr( "&Justify" ), CTRL + Key_J, - grp ); - m_actionAlignJustify->setToggleAction( TRUE ); - - grp->addTo( tb ); - - - QPixmap pix( 16, 16 ); - pix.fill( Qt::black ); - m_actionTextColor = new QAction( -#if QT_VERSION < 0x030200 - "", -#endif - pix, tr( "&Color..." ), 0, this ); - connect( m_actionTextColor, SIGNAL( activated() ), this, - SLOT( textColor() ) ); - m_actionTextColor->addTo( tb ); -#endif -#endif } @@ -492,11 +282,7 @@ void projectNotes::textColor() m_edit->setTextColor( col ); QPixmap pix( 16, 16 ); pix.fill( Qt::black ); -#ifdef QT4 m_actionTextColor->setIcon( pix ); -#else - m_actionTextColor->setIconSet( pix ); -#endif } @@ -542,11 +328,7 @@ void projectNotes::colorChanged( const QColor & _c ) { QPixmap pix( 16, 16 ); pix.fill( _c ); -#ifdef QT4 m_actionTextColor->setIcon( pix ); -#else - m_actionTextColor->setIconSet( pix ); -#endif engine::getSongEditor()->setModified(); } @@ -555,11 +337,7 @@ void projectNotes::colorChanged( const QColor & _c ) void projectNotes::alignmentChanged( int _a ) { - if ( -#ifndef QT4 - ( _a == Qt::AlignAuto ) || -#endif - ( _a & Qt::AlignLeft ) ) + if ( _a & Qt::AlignLeft ) { m_actionAlignLeft->setChecked( TRUE ); } diff --git a/src/widgets/qxembed.cpp b/src/widgets/qxembed.cpp deleted file mode 100644 index 8378abff0..000000000 --- a/src/widgets/qxembed.cpp +++ /dev/null @@ -1,1368 +0,0 @@ -#ifndef SINGLE_SOURCE_COMPILE - -/**************************************************************************** - Implementation of QXEmbed class - - Copyright (C) 1999-2002 Trolltech AS - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*****************************************************************************/ - - -// L-000: About comments marked with Lxxxx. -// -// These comments represent an attempt to provide a more adequate -// documentation to KDE developpers willing to modify QXEmbed. Keep in -// mind that these comments were written long after most of the code. -// Please improve them if you spot something wrong or missing -// (Leon Bottou, 26-10-2003). -// -// Relevant documents: -// - QXEmbed developper documentation -// (see comments in qxembed.h) -// - Xlib Reference Manual -// (sections about focus, reparenting, window management) -// - ICCCM Manual -// (window management) -// - XEMBED specification -// (http://www.freedesktop.org/Standards/xembed-spec) -// - XPLAIN and XEMBED. -// -// - Accumulated community knowledge. -// -// -// -// - -#include "qt3support.h" - -#ifndef QT4 - - -#include -#include -#include -#include -#include -#include - -// L0001: QXEmbed works only under X windows. -#ifdef Q_WS_X11 - -# include -# include -# include -# include -# define XK_MISCELLANY -# define XK_LATIN1 -# include -/*# include -# include */ - -// L0002: Is file config.h KDE specific? -# include -# ifdef HAVE_UNISTD_H -# include -# ifdef HAVE_USLEEP -# define USLEEP(x) usleep(x) -# else -# define USLEEP(x) sleep(0) -# endif -# else -# define USLEEP(x) sleep(0) -# endif - -# include "qxembed.h" - -// L0003: This keysym is used for focus navigation. -# ifndef XK_ISO_Left_Tab -# define XK_ISO_Left_Tab 0xFE20 -# endif - -// L0004: Conflicts between X11 and Qt definitions. -const int XFocusOut = FocusOut; -const int XFocusIn = FocusIn; -const int XKeyPress = KeyPress; -const int XKeyRelease = KeyRelease; -# undef KeyRelease -# undef KeyPress -# undef FocusOut -# undef FocusIn - -// L0005: Variables defined in qapplication_x11.cpp -extern Atom qt_wm_protocols; -extern Atom qt_wm_delete_window; -extern Atom qt_wm_take_focus; -extern Atom qt_wm_state; -extern Time qt_x_time; - -// L0006: X11 atoms private to QXEmbed -static Atom xembed = 0; -static Atom context_help = 0; - -// L0007: Xembed message codes (see XEmbed spec) -#define XEMBED_EMBEDDED_NOTIFY 0 -#define XEMBED_WINDOW_ACTIVATE 1 -#define XEMBED_WINDOW_DEACTIVATE 2 -#define XEMBED_REQUEST_FOCUS 3 -#define XEMBED_FOCUS_IN 4 -#define XEMBED_FOCUS_OUT 5 -#define XEMBED_FOCUS_NEXT 6 -#define XEMBED_FOCUS_PREV 7 - -// L0008: Xembed message details (see XEmbed spec) -// -- XEMBED_FOCUS_IN: -#define XEMBED_FOCUS_CURRENT 0 -#define XEMBED_FOCUS_FIRST 1 -#define XEMBED_FOCUS_LAST 2 - - -// L0100: Private data held by the QXEmbed object. -// This belongs to the embedder side. -class QXEmbedData -{ -public: - QXEmbedData(){ - autoDelete = true; - xplain = false; - xgrab = false; - mapAfterRelease = false; - lastPos = QPoint(0,0); - } - ~QXEmbedData(){}; - - bool autoDelete; // L0101: See L2600 - bool xplain; // L0102: See L1100 - bool xgrab; // L0103: See L2800 - bool mapAfterRelease; - QWidget* focusProxy; // L0104: See XEmbed spec - QPoint lastPos; // L0105: See L1390 -}; - -namespace -{ - // L0200: This application wide event filter handles focus - // issues in the embedded client. - class QXEmbedAppFilter : public QObject - { - public: - QXEmbedAppFilter() { qApp->installEventFilter( this ); } - ~QXEmbedAppFilter() { }; - bool eventFilter( QObject *, QEvent * ); - }; -} - -// L0201: See L0200, L0740 -static QXEmbedAppFilter* filter = 0; -// L0202: See L0610, L0730 -static QPtrDict > *focusMap = 0; -// L0203: See L0660, L1400, L1450 -static XKeyEvent last_key_event; - -// L0300: This class gives access protected members of class QWidget. -// Function focusData() is useful to reimplement tab focus management -// (L0620) Function topData() returns a structure QTLWExtra containing -// information unique to toplevel windows. This structure contains two -// members for the sole use of QXEmbed. Flag `embedded' indicates whether -// the toplevel window is embedded using the XEMBED protocol (L0680). -// Handle `parentWinId' then records the id of the embedding window. - -class QPublicWidget : public QWidget -{ -public: - QTLWExtra* topData() { return QWidget::topData(); } - QFocusData *focusData(){ return QWidget::focusData(); } - bool focusNextPrev(bool b) { return focusNextPrevChild(b); } -}; - -// L0400: This sets a very low level filter for X11 messages. -// See qapplication_x11.cpp -typedef int (*QX11EventFilter) (XEvent*); -extern QX11EventFilter qt_set_x11_event_filter (QX11EventFilter filter); -static QX11EventFilter oldFilter = 0; - - -// L0500: Helper to send XEmbed messages. -static void sendXEmbedMessage( WId window, long message, long detail = 0, - long data1 = 0, long data2 = 0) -{ - if (!window) return; - XEvent ev; - memset(&ev, 0, sizeof(ev)); - ev.xclient.type = ClientMessage; - ev.xclient.window = window; - ev.xclient.message_type = xembed; - ev.xclient.format = 32; - ev.xclient.data.l[0] = qt_x_time; - ev.xclient.data.l[1] = message; - ev.xclient.data.l[2] = detail; - ev.xclient.data.l[3] = data1; - ev.xclient.data.l[4] = data2; - XSendEvent(qt_xdisplay(), window, false, NoEventMask, &ev); -} - -// L0501: Helper to send ICCCM Client messages. -// See X11 ICCCM Specification. -static void sendClientMessage(Window window, Atom a, long x) -{ - if (!window) return; - XEvent ev; - memset(&ev, 0, sizeof(ev)); - ev.xclient.type = ClientMessage; - ev.xclient.window = window; - ev.xclient.message_type = a; - ev.xclient.format = 32; - ev.xclient.data.l[0] = x; - ev.xclient.data.l[1] = qt_x_time; - XSendEvent(qt_xdisplay(), window, false, NoEventMask, &ev); -} - -// L0502: Helper to send fake X11 focus messages. -// See X11 Reference Manual and Window Management stuff. -static void sendFocusMessage(Window window, int type, int mode, int detail) -{ - if (!window) return; - XEvent ev; - memset(&ev, 0, sizeof(ev)); - ev.xfocus.type = type; - ev.xfocus.window = window; - ev.xfocus.mode = mode; - ev.xfocus.detail = detail; - XSendEvent(qt_xdisplay(), window, false, FocusChangeMask, &ev); -} - - -// ------------------------------------------------------------ -// L0600: MOST OF WHAT FOLLOWS CONCERNS THE CLIENT SIDE. -// The following code mostly executes inside a Qt application swallowed -// by QXEmbed widget. It mostly consists of event filters that fight -// the normal Qt mechanisms in order to implement the XEMBED protocol. -// All this would be a lot simpler if it was implemented by Qt itself. - - - -// L0610: This event filter receives all Qt events. Its main purpose is to -// capture the Qt focus events in the embedded client in order to -// implement the XEMBED protocol. -// -// Let's start with a few reminders: -// -// - X11 only has the concept of the "X11 focus window". This window -// basically receives all key events. The ICCCM conventions define -// how the window manager and the applications must cooperate to -// choose the X11 focus window. -// -// - Most toolkits, including Qt, maintain the concepts of 'active -// widget' and 'Qt focus widget'. A toplevel widget is active when -// the X11 focus is set to one of its children. By extension a -// widget is active when its toplevel widget is active. There is one -// Qt focus widget for each toplevel widget. When the toplevel -// widget is active, all key events are sent to the Qt focus widget, -// regardless of which descendant of the toplevel window has the X11 -// focus. Widgets can adjust their appearance according to both -// their activation and focus states. The Qt FocusIn and FocusOut -// events indicate when a widget simultaneously is active and has -// the Qt focus. -// -// The XEMBED protocol defines ways to communicate abouth both -// activation and focus. The embedded client is active as soon as the -// embedding window is active (L0676, L0677). A widget in the embedded -// client receives key events when (1) it has the Qt focus in the -// embedded application, and (2) the QXEmbed widget in the embedding -// application is active and has the Qt focus. The Qt library in the -// embedded application is unaware of the focus status of the QXEmbed -// widget. We must make sure it does the right thing regarding the -// sending of focus events and the visual appearance of the focussed -// widgets. When the QXEmbed widget looses the Qt focus, we clear the -// focus in the embedded client (L1570, L0688). Conversely, when -// the QXEmbed widget gains the Qt focus, we restore the Qt focus -// window in the embedded client (L1530, L0680, L0683). -// Variable focusMap is used to remember which was the Qt focus -// widget in the embedded application. All this would be a lot -// simpler if it was implemented inside Qt... -// -// The XPLAIN protocol is much less refined in this respect. -// The activation status of the embedded client simply reflect -// the focus status of the QXEmbed widget. This is achieved -// by sending fake X11 focus message to the client (L1521, L1561). -// A passive button grab (L2800) intercepts mouse activity in the -// embedded client and sets the Qt focus to the QXEmbed widget -// when this happens (L2060). This can be achieved without -// cooperation from the client. - -bool QXEmbedAppFilter::eventFilter( QObject *o, QEvent * e) -{ - static bool obeyFocus = false; - switch ( e->type() ) { - case QEvent::MouseButtonPress: - // L0612: This will become clear with L0614 - if ( !((QWidget*)o)->isActiveWindow() ) - obeyFocus = true; - break; - case QEvent::FocusIn: - // L0613: FocusIn events either occur because the widget already was - // active and has just been given the Qt focus (L0614) or - // because the widget already had the Qt focus and just became - // active (L0615). - if ( qApp->focusWidget() == o && - ((QPublicWidget*)qApp->focusWidget()->topLevelWidget())->topData()->embedded ) { - QFocusEvent* fe = (QFocusEvent*) e; - if ( obeyFocus || fe->reason() == QFocusEvent::Mouse || - fe->reason() == QFocusEvent::Shortcut ) { - // L0614: A widget in the embedded client was just given the Qt focus. - // Variable `obeyFocus' suggests that this is the result of mouse - // activity in the client. The XEMBED_REQUEST_FOCUS message causes - // the embedding widget to take the Qt focus (L2085). - WId window = ((QPublicWidget*)qApp->focusWidget()->topLevelWidget())->topData()->parentWinId; - focusMap->remove( qApp->focusWidget()->topLevelWidget() ); - sendXEmbedMessage( window, XEMBED_REQUEST_FOCUS ); - } else if ( fe->reason() == QFocusEvent::ActiveWindow ) { - // L0615: Both the embedder and the embedded client became active. - // But we do not know whether the QXEmbed widget has the Qt focus. - // So we clear the Qt focus for now. If indeed the QXEmbed widget - // has the focus, it will receive a FocusIn message (L1530) and - // tell us to restore the focus (L0680, L0683). - focusMap->remove( qApp->focusWidget()->topLevelWidget() ); - focusMap->insert( qApp->focusWidget()->topLevelWidget(), - new QGuardedPtr(qApp->focusWidget()->topLevelWidget()->focusWidget() ) ); - // L0616: qApp->focusWidget() might belong to a modal dialog and not be - // equal to qApp->focusWidget()->topLevelWidget()->focusWidget() ! - qApp->focusWidget()->clearFocus(); - // L0617: ??? [why not {obeyFocus=false; return true;} here?] - } - obeyFocus = false; - } - break; - case QEvent::KeyPress: - if (qApp->focusWidget() == o && - ((QPublicWidget*)qApp->focusWidget()->topLevelWidget())->topData()->embedded ) { - // L0620: The following code replaces the Qt code that - // handles focus focus changes with the tab key. See the - // XEMBED specification for details. The keypress event - // arrives here after an interesting itinerary. It is first - // saved in the embedding application (L0660). After being - // rejected for tab navigation in the embedding application - // (L1901), it gets forwarded to the embedded client - // (L1400) and arrives here. Depending on the status of - // the tab chain in the embedded client, focus navigation - // messages are sent back to the embedding application - // (L0653, L0654) which then performs tab navigation - // (L2081). - QKeyEvent *k = (QKeyEvent *)e; - QWidget *w = qApp->focusWidget(); - // L0621: The following tests are copied from QWidget::event(). - bool res = false; - bool tabForward = true; - if ( !(k->state() & ControlButton || k->state() & AltButton) ) { - if ( k->key() == Key_Backtab || (k->key() == Key_Tab && (k->state() & ShiftButton)) ) { - QFocusEvent::setReason( QFocusEvent::Backtab ); - res = ((QPublicWidget*)w)->focusNextPrev( tabForward = false ); - QFocusEvent::resetReason(); - } else if ( k->key() == Key_Tab ) { - QFocusEvent::setReason( QFocusEvent::Tab ); - res = ((QPublicWidget*)w)->focusNextPrev( tabForward = true ); - QFocusEvent::resetReason(); - } - } - if (res) { - // L0625: We changed the focus because of tab/backtab key - // Now check whether we have been looping around. - QFocusData *fd = ((QPublicWidget*)w)->focusData(); - WId window = ((QPublicWidget*)w->topLevelWidget())->topData()->parentWinId; - QWidget *cw = 0; - QWidget *fw = fd->home(); - if (tabForward && window) { - while (cw != w && cw != fw && cw != w->topLevelWidget()) - cw = fd->prev(); - if (cw != w) - sendXEmbedMessage( window, XEMBED_FOCUS_NEXT ); - } else if (window) { - while (cw != w && cw != fw && cw != w->topLevelWidget()) - cw = fd->next(); - if (cw != w) - sendXEmbedMessage( window, XEMBED_FOCUS_PREV ); - } - // L0628: Qt should no longer process this event. - return true; - } - } - break; - default: - break; - } - // L0640: Application gets to see the events anyway. - return false; -} - -// L0650: This filter receives all XEvents in both the client and the embedder. -// Most of it involves the embedded client (except L0660, L0671). -static int qxembed_x11_event_filter( XEvent* e) -{ - switch ( e->type ) { - case XKeyPress: - case XKeyRelease: { - // L0660: This is for the embedding side (L1450). - last_key_event = e->xkey; - break; - } - case ClientMessage: - if ( e->xclient.message_type == xembed ) { - // L0670: This is where the XEmbed messages are - // processed on the client side. - Time msgtime = (Time) e->xclient.data.l[0]; - long message = e->xclient.data.l[1]; - long detail = e->xclient.data.l[2]; - // L0671: Keep Qt message time up to date - if ( msgtime > qt_x_time ) - qt_x_time = msgtime; - QWidget* w = QWidget::find( e->xclient.window ); - if ( !w ) - break; - switch ( message) { - case XEMBED_EMBEDDED_NOTIFY: { - // L0675: We just have been embedded into a XEMBED aware widget. - QTLWExtra *extra = ((QPublicWidget*)w->topLevelWidget())->topData(); - extra->embedded = 1; - extra->parentWinId = e->xclient.data.l[3]; - w->topLevelWidget()->show(); - break; - } - case XEMBED_WINDOW_ACTIVATE: { - // L0676: Embedding window becomes active. Send a fake XFocusIn - // to convince Qt that we are active as well. Qt will send - // us a focus notification (L0615) that we will intercept to - // ensure that we have no Qt focus widget yet. The Qt focus - // widget might later be set in L0680. - XEvent ev; - memset(&ev, 0, sizeof(ev)); - ev.xfocus.display = qt_xdisplay(); - ev.xfocus.type = XFocusIn; - ev.xfocus.window = w->topLevelWidget()->winId(); - ev.xfocus.mode = NotifyNormal; - ev.xfocus.detail = NotifyAncestor; - qApp->x11ProcessEvent( &ev ); - } - break; - case XEMBED_WINDOW_DEACTIVATE: { - // L0677: Embedding window becomes inactive. Send a fake XFocusOut - // event to convince Qt that we no longer are active. We will - // receive extra Qt FocusOut events but we do not care. - XEvent ev; - memset(&ev, 0, sizeof(ev)); - ev.xfocus.display = qt_xdisplay(); - ev.xfocus.type = XFocusOut; - ev.xfocus.window = w->topLevelWidget()->winId(); - ev.xfocus.mode = NotifyNormal; - ev.xfocus.detail = NotifyAncestor; - qApp->x11ProcessEvent( &ev ); - } - break; - case XEMBED_FOCUS_IN: - // L0680: Embedding application gives us the focus. - { - // L0681: Search saved focus widget. - QWidget* focusCurrent = 0; - QGuardedPtr* fw = focusMap->find( w->topLevelWidget() ); - if ( fw ) { - focusCurrent = *fw; - // L0682: Remove it from the map - focusMap->remove( w->topLevelWidget() ); - } - switch ( detail ) { - case XEMBED_FOCUS_CURRENT: - // L0683: Set focus on saved focus widget - if ( focusCurrent ) - focusCurrent->setFocus(); - else if ( !w->topLevelWidget()->focusWidget() ) - w->topLevelWidget()->setFocus(); - break; - case XEMBED_FOCUS_FIRST: - { - // L0684: Search first widget in tab chain - QFocusEvent::setReason( QFocusEvent::Tab ); - w->topLevelWidget()->setFocus(); - ((QPublicWidget*)w->topLevelWidget())->focusNextPrev(true); - QFocusEvent::resetReason(); - } - break; - case XEMBED_FOCUS_LAST: - { - // L0686: Search last widget in tab chain - QFocusEvent::setReason( QFocusEvent::Backtab ); - w->topLevelWidget()->setFocus(); - ((QPublicWidget*)w->topLevelWidget())->focusNextPrev(false); - QFocusEvent::resetReason(); - } - break; - default: - break; - } - } - break; - case XEMBED_FOCUS_OUT: - // L0688: Embedding application takes the focus away - // We first record what the focus widget was - // and clear the Qt focus. - if ( w->topLevelWidget()->focusWidget() ) { - focusMap->insert( w->topLevelWidget(), - new QGuardedPtr(w->topLevelWidget()->focusWidget() ) ); - w->topLevelWidget()->focusWidget()->clearFocus(); - } - break; - default: - break; - } - } else if ( e->xclient.format == 32 && e->xclient.message_type ) { - if ( e->xclient.message_type == qt_wm_protocols ) { - QWidget* w = QWidget::find( e->xclient.window ); - if ( !w ) - break; - // L0690: This is for the embedding side! - // See L0902 for more information about the focus proxy. - // Window manager may send WM_TAKE_FOCUS messages to the - // embedding application to indicate that it becomes active. - // But this also suggests that the window manager has - // changed the X11 focus. We want to make sure it goes - // to the focus proxy window eventually. - Atom a = e->xclient.data.l[0]; - if ( a == qt_wm_take_focus ) { - // L0695: update Qt message time variable - if ( (ulong) e->xclient.data.l[1] > qt_x_time ) - qt_x_time = e->xclient.data.l[1]; - // L0696: There is no problem when the window is not active. - // Qt will generate a WindowActivate event that will - // do the job (L1310). This does not happen if the - // window is already active. So we simulate it. - if ( w->isActiveWindow() ) { - QEvent e( QEvent::WindowActivate ); - QApplication::sendEvent( w, &e ); - } - } - } - } - break; - default: - break; - } - // L0698: The next x11 filter - if ( oldFilter ) - return oldFilter( e ); - // L0699: Otherwise process the event as usual. - return false; -} - - - -// L0700: Install the xembed filters in both client and embedder sides. -// This function is called automatically when using -// embedClientIntoWindow() or creating an instance of QXEmbed You may -// have to call it manually for a client when using embedder-side -// embedding, though. -void QXEmbed::initialize() -{ - static bool is_initialized = false; - if ( is_initialized ) - return; - - // L0710: Atom used by the XEMBED protocol. - xembed = XInternAtom( qt_xdisplay(), "_XEMBED", false ); - // L0720: Install low level filter for X11 events (L0650) - oldFilter = qt_set_x11_event_filter( qxembed_x11_event_filter ); - // L0730: See L0610 for an explanation about focusMap. - focusMap = new QPtrDict >; - focusMap->setAutoDelete( true ); - // L0740: Create client side application wide event filter (L0610) - filter = new QXEmbedAppFilter; - - is_initialized = true; -} - - - - - -// ------------------------------------------------------------ -// L0800: MOST OF WHAT FOLLOWS CONCERNS THE EMBEDDER SIDE. -// Things that happen inside a Qt application that contain -// a QXEmbed widget for embedding other applications. -// This applies to both the XEMBED and XPLAIN protocols. -// Deviations are commented below. - - - -// L0810: Class QXEmbed. -// A QXEmbed widget serves as an embedder that can manage one single -// embedded X-window. These so-called client windows can be arbitrary -// Qt or non Qt applications. There are two different ways of using -// QXEmbed, from the client side or from the embedder's side. - - -// L0900: Constructs a xembed widget. -QXEmbed::QXEmbed(QWidget *parent, const char *name, WFlags f) - : QWidget(parent, name, f) -{ - // L0901: Create private data. See L0100. - d = new QXEmbedData; - // L0902: Create focus proxy widget. See XEmbed specification. - // Each QXEmbed widget has a focus proxy window. Every single - // QXEmbed widget tries to force its focus proxy window onto the - // whole embedding application. They compete between themselves and - // against Qt (L0690, L0914, L1040, L1310, L1510, L1580). - // This would be much simpler if implemented within Qt. - d->focusProxy = new QWidget( topLevelWidget(), "xembed_focus" ); - d->focusProxy->setGeometry( -1, -1, 1, 1 ); - d->focusProxy->show(); - // make sure it's shown - for XSetInputFocus - QApplication::sendPostedEvents( d->focusProxy, 0 ); - // L0903: Install the client side event filters - // because they also provide services for the embedder side - // See L0660, L0671, L0685. - initialize(); - window = 0; - setFocusPolicy(StrongFocus); - setKeyCompression( false ); - - // L0910: Trick Qt to create extraData(); - (void) topData(); - - // L0912: We are mostly interested in SubstructureNotify - // This is sent when something happens to the children of - // the X11 window associated with the QXEmbed widget. - XSelectInput(qt_xdisplay(), winId(), - KeyPressMask | KeyReleaseMask | - ButtonPressMask | ButtonReleaseMask | - KeymapStateMask | - ButtonMotionMask | - PointerMotionMask | // may need this, too - EnterWindowMask | LeaveWindowMask | - FocusChangeMask | - ExposureMask | - StructureNotifyMask | - SubstructureRedirectMask | - SubstructureNotifyMask - ); - // L0913: all application events pass through eventFilter(). - // This is mostly used to force the X11 focus on the - // proxy focus window. See L1300. - topLevelWidget()->installEventFilter( this ); - qApp->installEventFilter( this ); - - // L0914: Start moving the X11 focus on the focus proxy window. - // See L1581 to know why we do not use isActiveWindow(). - if ( qApp->activeWindow() == topLevelWidget() ) - if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) - XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), - RevertToParent, qt_x_time ); - // L0915: ??? [drag&drop?] - setAcceptDrops( true ); -} - -// L1000: Destructor must dispose of the embedded client window. -QXEmbed::~QXEmbed() -{ - // L1010: Make sure no pointer grab is left. - if ( d && d->xgrab) - XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, winId() ); - if ( window && ( autoDelete() || !d->xplain )) - { - // L1021: Hide the window and safely reparent it into the root, - // otherwise it would be destroyed by X11 together - // with this QXEmbed's window. -#if 0 -// TODO: The proper XEmbed way would be to unmap the window, and the embedded -// app would detect the embedding has ended, and do whatever it finds appropriate. -// However, QXEmbed currently doesn't provide support for this detection, -// so for the time being, it's better to leave the window mapped as toplevel window. -// This will be ever more complicated with the systray windows, as the simple API -// for them (KWin::setSystemTrayWindowFor()) doesn't make it possible to detect -// themselves they have been released from systray, but KWin requires them -// to be visible to allow next Kicker instance to swallow them. -// See also below the L1022 comment. -// XUnmapWindow( qt_xdisplay(), window ); -#else - if( autoDelete()) - XUnmapWindow( qt_xdisplay(), window ); -#endif - XReparentWindow(qt_xdisplay(), window, qt_xrootwin(), 0, 0); - if( !d->xplain ) - XRemoveFromSaveSet( qt_xdisplay(), window ); - if( d->mapAfterRelease ) - XMapWindow( qt_xdisplay(), window ); - XSync(qt_xdisplay(), false); - // L1022: Send the WM_DELETE_WINDOW message - if( autoDelete() /*&& d->xplain*/ ) - // This sendDelete should only apply to XPLAIN. - // XEMBED apps are supposed to detect when the embedding ends. - // ??? [We do not do this detection yet! - // So we sendDelete() instead.] - sendDelete(); - } - window = 0; - // L01040: Our focus proxy window will be destroyed as well. - // Make sure that the X11 focus is not lost in the process. - Window focus; - int revert; - XGetInputFocus( qt_xdisplay(), &focus, &revert ); - if( focus == d->focusProxy->winId()) - XSetInputFocus( qt_xdisplay(), topLevelWidget()->winId(), RevertToParent, qt_x_time ); - // L01045: Delete our private data. - delete d; -} - - -// L1050: Sends a WM_DELETE_WINDOW message to the embedded window. This is -// what typically happens when you click on the close button of a -// window manager decoration. -void QXEmbed::sendDelete( void ) -{ - if (window) - { - sendClientMessage(window, qt_wm_protocols, qt_wm_delete_window); - XFlush( qt_xdisplay() ); - } -} - -// L1100: Sets the protocol used for embedding windows. -// This function must be called before embedding a window. -// Protocol XEMBED provides maximal functionality (focus, tabs, etc) -// but requires explicit cooperation from the embedded window. -// Protocol XPLAIN provides maximal compatibility with -// embedded applications that do not support the XEMBED protocol. -// The default is XEMBED. -void QXEmbed::setProtocol( Protocol proto ) -{ - if (!window) { - d->xplain = false; - if (proto == XPLAIN) - d->xplain = true; - } -} - -// L1150: Returns the protocol used for embedding the current window. -QXEmbed::Protocol QXEmbed::protocol() -{ - if (d->xplain) - return XPLAIN; - return XEMBED; -} - - -// L1200: QXEmbed widget size changes: resize embedded window. -void QXEmbed::resizeEvent(QResizeEvent*) -{ - if (window) - XResizeWindow(qt_xdisplay(), window, width(), height()); -} - -// L1250: QXEmbed widget is shown: make sure embedded window is visible. -void QXEmbed::showEvent(QShowEvent*) -{ - if (window) - XMapRaised(qt_xdisplay(), window); -} - - -// L1300: This event filter sees all application events (L0913). -bool QXEmbed::eventFilter( QObject *o, QEvent * e) -{ - - switch ( e->type() ) { - case QEvent::WindowActivate: - if ( o == topLevelWidget() ) { - // L1310: Qt thinks the application window has just been activated. - // Make sure the X11 focus is on the focus proxy window. See L0686. - if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) - if (! hasFocus() ) - XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), - RevertToParent, qt_x_time ); - if (d->xplain) - // L1311: Activation has changed. Grab state might change. See L2800. - checkGrab(); - else - // L1312: Let the client know that we just became active - sendXEmbedMessage( window, XEMBED_WINDOW_ACTIVATE ); - } - break; - case QEvent::WindowDeactivate: - if ( o == topLevelWidget() ) { - if (d->xplain) - // L1321: Activation has changed. Grab state might change. See L2800. - checkGrab(); - else - // L1322: Let the client know that we are no longer active - sendXEmbedMessage( window, XEMBED_WINDOW_DEACTIVATE ); - } - break; - case QEvent::Move: - { - QWidget* pos = this; - while( pos != o && pos != topLevelWidget()) - pos = pos->parentWidget(); - if( pos == o ) { - // L1390: Send fake configure notify events whenever the - // global position of the client changes. See L2900. - QPoint globalPos = mapToGlobal(QPoint(0,0)); - if (globalPos != d->lastPos) { - d->lastPos = globalPos; - sendSyntheticConfigureNotifyEvent(); - } - } - } - break; - default: - break; - } - return false; -} - -// L1350: ??? [why this?] -bool QXEmbed::event( QEvent * e) -{ - return QWidget::event( e ); -} - -// L1400: Forward keypress event to the client -// Receiving a Qt key event indicates that -// the QXEmbed object has the Qt focus. -// The X11 event that caused the Qt key event -// must be forwarded to the client. -// See L0660. -void QXEmbed::keyPressEvent( QKeyEvent *) -{ - if (!window) - return; - last_key_event.window = window; - XSendEvent(qt_xdisplay(), window, false, KeyPressMask, (XEvent*)&last_key_event); - -} - -// L1450: Forward keyrelease event to the client. -// See comment L1400. -void QXEmbed::keyReleaseEvent( QKeyEvent *) -{ - if (!window) - return; - last_key_event.window = window; - XSendEvent(qt_xdisplay(), window, false, KeyReleaseMask, (XEvent*)&last_key_event); -} - -// L1500: Handle Qt focus in event. -void QXEmbed::focusInEvent( QFocusEvent * e ){ - if (!window) - return; - // L1510: This is a good time to set the X11 focus on the focus proxy window. - // Except if the the embedding application itself is embedded into another. - if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) - if ( qApp->activeWindow() == topLevelWidget() ) - // L1511: Alter X focus only when window is active. - // This is dual safety here because FocusIn implies this. - // But see L1581 for an example where this really matters. - XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), - RevertToParent, qt_x_time ); - if (d->xplain) { - // L1520: Qt focus has changed. Grab state might change. See L2800. - checkGrab(); - // L1521: Window managers activate applications by setting the X11 focus. - // We cannot do this (see L1510) but we can send a fake focus event - // and forward the X11 key events ourselves (see L1400, L1450). - sendFocusMessage(window, XFocusIn, NotifyNormal, NotifyPointer ); - } else { - // L1530: No need for fake events with XEMBED. - // Just inform the client. It knows what to do. - int detail = XEMBED_FOCUS_CURRENT; - // L1531: When the focus change is caused by the tab key, - // the client must select the first (or last) widget of - // its own tab chain. - if ( e->reason() == QFocusEvent::Tab ) - detail = XEMBED_FOCUS_FIRST; - else if ( e->reason() == QFocusEvent::Backtab ) - detail = XEMBED_FOCUS_LAST; - sendXEmbedMessage( window, XEMBED_FOCUS_IN, detail); - } -} - -// L1550: Handle Qt focus out event. -void QXEmbed::focusOutEvent( QFocusEvent * ){ - if (!window) - return; - if (d->xplain) { - // L1560: Qt focus has changed. Grab state might change. See L2800. - checkGrab(); - // L1561: Send fake focus out message. See L1521. - sendFocusMessage(window, XFocusOut, NotifyNormal, NotifyPointer ); - } else { - // L1570: Send XEMBED focus out message. See L1531. - sendXEmbedMessage( window, XEMBED_FOCUS_OUT ); - } - // L1580: The QXEmbed object might loose the focus because its - // toplevel window looses the X11 focus and is no longer active, - // or simply because the Qt focus has been moved to another widget. - // In the latter case only, we want to make sure that the X11 focus - // is properly set to the X11 focus widget. We do this because - // the client application might have moved the X11 focus after - // receiving the fake focus messages. - if ( !((QPublicWidget*) topLevelWidget())->topData()->embedded ) - if ( qApp->activeWindow() == topLevelWidget() ) - // L1581: Alter X focus only when window is active. - // The test above is not the same as isActiveWindow(). - // Function isActiveWindow() also returns true when a modal - // dialog child of this window is active. - XSetInputFocus( qt_xdisplay(), d->focusProxy->winId(), - RevertToParent, qt_x_time ); -} - - -// L1600: Helper for QXEmbed::embed() -// Check whether a window is in withdrawn state. -static bool wstate_withdrawn( WId winid ) -{ - Atom type; - int format; - unsigned long length, after; - unsigned char *data; - int r = XGetWindowProperty( qt_xdisplay(), winid, qt_wm_state, 0, 2, - false, AnyPropertyType, &type, &format, - &length, &after, &data ); - bool withdrawn = true; - // L1610: Non managed windows have no WM_STATE property. - // Returning true ensures that the loop L1711 stops. - if ( r == Success && data && format == 32 ) { - Q_UINT32 *wstate = (Q_UINT32*)data; - withdrawn = (*wstate == WithdrawnState ); - XFree( (char *)data ); - } - return withdrawn; -} - -// L1650: Helper for QXEmbed::embed() -// Get the X11 id of the parent window. -static int get_parent(WId winid, Window *out_parent) -{ - Window root, *children=0; - unsigned int nchildren; - int st = XQueryTree(qt_xdisplay(), winid, &root, out_parent, &children, &nchildren); - if (st && children) - XFree(children); - return st; -} - -// L1700: Embeds the window w into this QXEmbed widget. -// See doc in qxembed.h. -void QXEmbed::embed(WId w) -{ -/* kdDebug() << "*** Embed " << w << " into " << winId() << ". window=" << window << endl;*/ - if (!w) - return; - // L1701: The has_window variable prevents embedding a same window twice. - // ??? [what happens if one embed two windows into the same QXEmbed?] - bool has_window = (w == window); - window = w; - if ( !has_window ) { - //KXErrorHandler errhandler; // make X BadWindow errors silent - // L1710: Try hard to withdraw the window. - // This makes sure that the window manager will - // no longer try to manage this window. - if ( !wstate_withdrawn(window) ) { - XWithdrawWindow(qt_xdisplay(), window, qt_xscreen()); - QApplication::flushX(); - // L1711: See L1610 - while (!wstate_withdrawn(window)) - USLEEP(1000); - } - // L1710: It would be sufficient in principle to reparent - // window w into winId(). Everything else happens in L2020. - // The following code might be useful when the X11 server takes - // time to create the embedded application main window. - Window parent = 0; - get_parent(w, &parent); -/* kdDebug() << QString("> before reparent: parent=0x%1").arg(parent,0,16) << endl;*/ - for (int i = 0; i < 50; i++) { - // this is done once more when finishing embedding, but it's done also here - // just in case we crash before reaching that place - if( !d->xplain ) - XAddToSaveSet( qt_xdisplay(), w ); - XReparentWindow(qt_xdisplay(), w, winId(), 0, 0); - if (get_parent(w, &parent) && parent == winId()) { -/* kdDebug() << QString("> Loop %1: ").arg(i) - << QString("> reparent of 0x%1").arg(w,0,16) - << QString(" into 0x%1").arg(winId(),0,16) - << QString(" successful") << endl;*/ - break; - } -/* kdDebug() << QString("> Loop %1: ").arg(i) - << QString("> reparent of 0x%1").arg(w,0,16) - << QString(" into 0x%1").arg(winId(),0,16) - << QString(" failed") << endl;*/ - USLEEP(1000); - } - if( parent != winId()) // failed - window = 0; - } -} - - -// L1800: Returns the window identifier of the embedded window -WId QXEmbed::embeddedWinId() const -{ - return window; -} - - -// L1900: Control Qt tab focus management. -// See Qt documentation. -bool QXEmbed::focusNextPrevChild( bool next ) -{ - if ( window ) - // L1901: Return false when there is an embedded window - // When the user presses TAB, Qt will not change - // the focus and pass the TAB key events to the QXEmbed widget. - // These key events will be forwarded to the client (L1400, L1450) - // who eventually will manage the tab focus (L0620) and possible - // instruct us to call QWidget::focusNextPrevChild (L2081). - return false; - else - // L1920: Default behavior otherwise. - return QWidget::focusNextPrevChild( next ); -} - - -// L2000: Filter for X11 events sent to the QXEmbed window. -bool QXEmbed::x11Event( XEvent* e) -{ - switch ( e->type ) { - case DestroyNotify: - if ( e->xdestroywindow.window == window ) { - // L2005: Client window is being destroyed. - window = 0; - windowChanged( window ); - emit embeddedWindowDestroyed(); - } - break; - case ReparentNotify: - if ( e->xreparent.window == d->focusProxy->winId() ) - break; // ignore proxy - if ( window && e->xreparent.window == window && - e->xreparent.parent != winId() ) { - // L2010: We lost the window - window = 0; - windowChanged( window ); - emit embeddedWindowDestroyed(); - // L2011: Remove window from save set - // ??? [not sure it is good to touch this window since - // someone else has taken control of it already.] - if( !d->xplain ) - XRemoveFromSaveSet( qt_xdisplay(), window ); - } else if ( e->xreparent.parent == winId()){ - // L2020: We got a window. Complete the embedding process. - window = e->xreparent.window; - // only XEMBED apps can survive crash, - // see http://lists.kde.org/?l=kfm-devel&m=106752026501968&w=2 - if( !d->xplain ) - XAddToSaveSet( qt_xdisplay(), window ); - XResizeWindow(qt_xdisplay(), window, width(), height()); - XMapRaised(qt_xdisplay(), window); - // L2024: see L2900. - sendSyntheticConfigureNotifyEvent(); - // L2025: ??? [any idea about drag&drop?] - extraData()->xDndProxy = window; - if ( parent() ) { - // L2030: embedded window might have new size requirements. - // see L2500, L2520, L2550. - QEvent * layoutHint = new QEvent( QEvent::LayoutHint ); - QApplication::postEvent( parent(), layoutHint ); - } - windowChanged( window ); - if (d->xplain) { - // L2040: Activation has changed. Grab state might change. See L2800. - checkGrab(); - if ( hasFocus() ) - // L2041: Send fake focus message to inform the client. See L1521. - sendFocusMessage(window, XFocusIn, NotifyNormal, NotifyPointer ); - } else { - // L2050: Send XEMBED messages (see L0670, L1312, L1322, L1530) - sendXEmbedMessage( window, XEMBED_EMBEDDED_NOTIFY, 0, (long) winId() ); - if (isActiveWindow()) - sendXEmbedMessage( window, XEMBED_WINDOW_ACTIVATE); - else - sendXEmbedMessage( window, XEMBED_WINDOW_DEACTIVATE); - if ( hasFocus() ) - sendXEmbedMessage( window, XEMBED_FOCUS_IN, XEMBED_FOCUS_CURRENT ); - } - } - break; - case ButtonPress: - if (d->xplain && d->xgrab) { - // L2060: The passive grab has intercepted a mouse click - // in the embedded client window. Take the focus. - QFocusEvent::setReason( QFocusEvent::Mouse ); - setFocus(); - QFocusEvent::resetReason(); - // L2064: Resume X11 event processing. - XAllowEvents(qt_xdisplay(), ReplayPointer, CurrentTime); - // L2065: Qt should not know about this. - return true; - } - break; - case ButtonRelease: - if (d->xplain && d->xgrab) { - // L2064: Resume X11 event processing after passive grab (see L2060) - XAllowEvents(qt_xdisplay(), SyncPointer, CurrentTime); - return true; - } - break; - case MapRequest: - // L2070: Behave like a window manager. - if ( window && e->xmaprequest.window == window ) - XMapRaised(qt_xdisplay(), window ); - break; - case ClientMessage: - // L2080: This is where the QXEmbed object receives XEMBED - // messaged from the client application. - if ( e->xclient.format == 32 && e->xclient.message_type == xembed ) { - long message = e->xclient.data.l[1]; - switch ( message ) { - // L2081: Tab focus management. It is very important to call the - // focusNextPrevChild() defined by QWidget (not QXEmbed). - // See L1901. - case XEMBED_FOCUS_NEXT: - QWidget::focusNextPrevChild( true ); - break; - case XEMBED_FOCUS_PREV: - QWidget::focusNextPrevChild( false ); - break; - // L2085: The client asks for the focus. - case XEMBED_REQUEST_FOCUS: - if( ((QPublicWidget*)topLevelWidget())->topData()->embedded ) { - WId window = ((QPublicWidget*)topLevelWidget())->topData()->parentWinId; - sendXEmbedMessage( window, XEMBED_REQUEST_FOCUS ); - } else { - QFocusEvent::setReason( QFocusEvent::Mouse ); - setFocus(); - QFocusEvent::resetReason(); - } - break; - default: - break; - } - } - break; - - case ConfigureRequest: - // L2090: Client wants to change its geometry. - // Just inform it that nothing has changed. - if (e->xconfigurerequest.window == window) - { - sendSyntheticConfigureNotifyEvent(); - } - break; - case MotionNotify: - // fall through, workaround for Qt 3.0 < 3.0.3 - case EnterNotify: - // L2095: See L2200. - if ( QWhatsThis::inWhatsThisMode() ) - enterWhatsThisMode(); - break; - default: - break; - } - return false; -} - - -// L2200: Try to handle Qt's "what's this" mode. Broken. -// "temporary, fix in Qt (Matthias, Mon Jul 17 15:20:55 CEST 2000" -void QXEmbed::enterWhatsThisMode() -{ - // L2210: When the what-s-this pointer enters the embedded window (L2095) - // cancel what-s-this mode, and use a non stantard _NET_WM_ message - // to instruct the embedded client to enter the "what's this" mode. - // This works only one way... - QWhatsThis::leaveWhatsThisMode(); - if ( !context_help ) - context_help = XInternAtom( x11Display(), "_NET_WM_CONTEXT_HELP", false ); - sendClientMessage(window , qt_wm_protocols, context_help ); -} - - -// L2300: indicates that the embedded window has been changed. -void QXEmbed::windowChanged( WId ) -{ -} - - -// L2400: Utility function for clients that embed themselves. -// This is client side code. -bool QXEmbed::processClientCmdline( QWidget* client, int& argc, char ** argv ) -{ - int myargc = argc; - WId window = 0; - int i, j; - - j = 1; - for ( i=1; iwinId(), window, 0, 0); - // L2451: These two lines are redundant. See L0680. - ((QXEmbed*)client)->topData()->embedded = true; - ((QXEmbed*)client)->topData()->parentWinId = window; - // L2452: This seems redundant because L2020 maps the window. - // But calling show() might also set Qt internal flags. - client->show(); -} - - - -// L2500: Specifies that this widget can use additional space, -// and that it can survive on less than sizeHint(). -QSizePolicy QXEmbed::sizePolicy() const -{ - return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); -} - - -// L2520: Returns a size sufficient for the embedded window -QSize QXEmbed::sizeHint() const -{ - return minimumSizeHint(); -} - -// L2550: Returns the minimum size specified by the embedded window. -QSize QXEmbed::minimumSizeHint() const -{ - int minw = 0; - int minh = 0; - if ( window ) { - XSizeHints size; - long msize; - if (XGetWMNormalHints(qt_xdisplay(), window, &size, &msize) - && ( size.flags & PMinSize) ) { - minw = size.min_width; - minh = size.min_height; - } - } - - return QSize( minw, minh ); -} - -// L2600: Tells what shoud be done with the embedded window when -// the embedding window is destroyed. -void QXEmbed::setAutoDelete( bool b) -{ - d->autoDelete = b; -} - -// L2650: See L2600. -bool QXEmbed::autoDelete() const -{ - return d->autoDelete; -} - -// L2700: See L2200. -bool QXEmbed::customWhatsThis() const -{ - return true; -} - -// L2800: When using the XPLAIN protocol, this function maintains -// a passive button grab when (1) the application is active -// and (2) the Qt focus is not on the QXEmbed. This passive -// grab intercepts button clicks in the client window and -// give us chance to request the Qt focus (L2060). -void QXEmbed::checkGrab() -{ - if (d->xplain && isActiveWindow() && !hasFocus()) { - if (! d->xgrab) - XGrabButton(qt_xdisplay(), AnyButton, AnyModifier, winId(), - false, ButtonPressMask, GrabModeSync, GrabModeAsync, - None, None ); - d->xgrab = true; - } else { - if (d->xgrab) - XUngrabButton( qt_xdisplay(), AnyButton, AnyModifier, winId() ); - d->xgrab = false; - } -} - -// L2900: This sends fake configure notify events to inform -// the client about its window geometry. See L1390, L2024 and L2090. -void QXEmbed::sendSyntheticConfigureNotifyEvent() -{ - // L2910: It seems that the x and y coordinates are global. - // But this is what ICCCM section 4.1.5 wants. - // See http://lists.kde.org/?l=kfm-devel&m=107090222032378 - QPoint globalPos = mapToGlobal(QPoint(0,0)); - if (window) { - XConfigureEvent c; - memset(&c, 0, sizeof(c)); - c.type = ConfigureNotify; - c.display = qt_xdisplay(); - c.send_event = True; - c.event = window; - c.window = winId(); - c.x = globalPos.x(); - c.y = globalPos.y(); - c.width = width(); - c.height = height(); - c.border_width = 0; - c.above = None; - c.override_redirect = 0; - XSendEvent( qt_xdisplay(), c.event, true, StructureNotifyMask, (XEvent*)&c ); - } -} - -// L3000: One should not call QWidget::reparent after embedding a window. -void QXEmbed::reparent( QWidget * parent, WFlags f, const QPoint & p, bool showIt ) -{ - // QWidget::reparent() destroys the old X Window for the widget, and - // creates a new one, thus QXEmbed after reparenting is no longer the - // parent of the embedded window. I think reparenting of QXEmbed can be - // done only by a mistake, so just complain. - Q_ASSERT( !window ); - QWidget::reparent( parent, f, p, showIt ); -} - -// for KDE -#include "qxembed.moc" -#endif -#endif // Q_WS_X11 - -#endif diff --git a/src/widgets/rack_plugin.cpp b/src/widgets/rack_plugin.cpp index a18bc4b98..3b1da70b4 100644 --- a/src/widgets/rack_plugin.cpp +++ b/src/widgets/rack_plugin.cpp @@ -26,10 +26,6 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include @@ -37,22 +33,6 @@ #include #include -#else - -#include -#include -#include -#include -#include -#include -#include -#include - -#define addSeparator insertSeparator -#define addMenu insertItem - -#endif - #include "rack_plugin.h" #include "audio_port.h" #include "knob.h" @@ -79,14 +59,11 @@ rackPlugin::rackPlugin( QWidget * _parent, setFixedSize( 210, 60 ); QPixmap bg = embed::getIconPixmap( "effect_plugin" ); -#ifdef QT4 + setAutoFillBackground( TRUE ); QPalette pal; pal.setBrush( backgroundRole(), bg ); setPalette( pal ); -#else - setErasePixmap( bg ); -#endif m_bypass = new ledCheckBox( "", this, tr( "Turn the effect off" ), m_track ); @@ -95,14 +72,8 @@ rackPlugin::rackPlugin( QWidget * _parent, toolTip::add( m_bypass, tr( "On/Off" ) ); m_bypass->setChecked( TRUE ); m_bypass->move( 3, 3 ); -#ifdef QT4 - m_bypass->setWhatsThis( -#else - QWhatsThis::add( m_bypass, -#endif - tr( -"Toggles the effect on or off." ) ); - + m_bypass->setWhatsThis( tr( "Toggles the effect on or off." ) ); + m_wetDry = new knob( knobBright_26, this, tr( "Wet/Dry mix" ), m_track ); connect( m_wetDry, SIGNAL( valueChanged( float ) ), @@ -112,14 +83,9 @@ rackPlugin::rackPlugin( QWidget * _parent, m_wetDry->setInitValue( 1.0f ); m_wetDry->move( 27, 5 ); m_wetDry->setHintText( tr( "Wet Level:" ) + " ", "" ); -#ifdef QT4 - m_wetDry->setWhatsThis( -#else - QWhatsThis::add( m_wetDry, -#endif - tr( -"The Wet/Dry knob sets the ratio between the input signal and the effect that " -"shows up in the output." ) ); + m_wetDry->setWhatsThis( tr( "The Wet/Dry knob sets the ratio between " + "the input signal and the effect that " + "shows up in the output." ) ); m_autoQuit = new tempoSyncKnob( knobBright_26, this, tr( "Decay" ), m_track ); @@ -130,12 +96,7 @@ rackPlugin::rackPlugin( QWidget * _parent, m_autoQuit->setInitValue( 1 ); m_autoQuit->move( 60, 5 ); m_autoQuit->setHintText( tr( "Time:" ) + " ", "ms" ); -#ifdef QT4 - m_autoQuit->setWhatsThis( -#else - QWhatsThis::add( m_autoQuit, -#endif - tr( + m_autoQuit->setWhatsThis( tr( "The Decay knob controls how many buffers of silence must pass before the " "plugin stops processing. Smaller values will reduce the CPU overhead but " "run the risk of clipping the tail on delay effects." ) ); @@ -148,12 +109,7 @@ rackPlugin::rackPlugin( QWidget * _parent, m_gate->setInitValue( 0.0f ); m_gate->move( 93, 5 ); m_gate->setHintText( tr( "Gate:" ) + " ", "" ); -#ifdef QT4 - m_gate->setWhatsThis( -#else - QWhatsThis::add( m_gate, -#endif - tr( + m_gate->setWhatsThis( tr( "The Gate knob controls the signal level that is considered to be 'silence' " "while deciding when to stop processing signals." ) ); @@ -171,20 +127,13 @@ rackPlugin::rackPlugin( QWidget * _parent, m_label->setFont( pointSize<7>( f ) ); m_label->setGeometry( 5, 44, 195, 10 ); -#ifdef QT4 m_label->setAutoFillBackground( TRUE ); pal.setBrush( backgroundRole(), QPixmap::fromImage( bg.toImage().copy( 5, 44, 195, 10 ) ) ); m_label->setPalette( pal ); -#else - m_label->setErasePixmap( QPixmap( bg.convertToImage().copy( 5, 44, - 195, 10 ) ) ); -#endif - + m_controlView = m_effect->createControlDialog( m_track ); -#ifndef QT3 engine::getMainWindow()->workspace()->addWindow( m_controlView ); -#endif connect( m_controlView, SIGNAL( closed() ), this, SLOT( closeEffects() ) ); m_controlView->hide(); @@ -194,12 +143,7 @@ rackPlugin::rackPlugin( QWidget * _parent, m_editButton->hide(); } -#ifdef QT4 - this->setWhatsThis( -#else - QWhatsThis::add( this, -#endif - tr( + setWhatsThis( tr( "Effect plugins function as a chained series of effects where the signal will " "be processed from top to bottom.\n\n" @@ -296,9 +240,9 @@ void rackPlugin::setGate( float _value ) void rackPlugin::contextMenuEvent( QContextMenuEvent * ) { QPointer contextMenu = new QMenu( this ); -#ifdef QT4 contextMenu->setTitle( m_effect->publicName() ); -#else +#warning TODO: CSS-formatting +#if 0 QLabel * caption = new QLabel( "" + QString( m_effect->publicName() ) + "", @@ -353,13 +297,8 @@ void rackPlugin::deletePlugin() void rackPlugin::displayHelp( void ) { -#ifdef QT4 QWhatsThis::showText( mapToGlobal( rect().bottomRight() ), whatsThis() ); -#else - QWhatsThis::display( QWhatsThis::textFor( this ), - mapToGlobal( rect().bottomRight() ) ); -#endif } diff --git a/src/widgets/rack_view.cpp b/src/widgets/rack_view.cpp index c550e4339..39ab64f7e 100644 --- a/src/widgets/rack_view.cpp +++ b/src/widgets/rack_view.cpp @@ -25,19 +25,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - - #include "rack_view.h" #include "audio_port.h" #include "rack_plugin.h" @@ -55,12 +44,9 @@ rackView::rackView( QWidget * _parent, track * _track, audioPort * _port ) : m_mainLayout->setSpacing( 0 ); m_scrollArea = new QScrollArea( this ); m_scrollArea->setFixedSize( 230, 184 ); -#ifdef QT4 m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); m_scrollArea->setPalette( QApplication::palette( m_scrollArea ) ); -#else - m_scrollArea->setVScrollBarMode( QScrollArea::AlwaysOn ); -#endif + m_mainLayout->addWidget( m_scrollArea ); m_lastY = 0; @@ -78,7 +64,6 @@ rackView::~rackView() void rackView::addEffect( effect * _e ) { -#ifdef QT4 if( !m_scrollArea->widget() ) { QWidget * w = new QWidget; @@ -86,9 +71,6 @@ void rackView::addEffect( effect * _e ) w->show(); } QWidget * w = m_scrollArea->widget(); -#else - QWidget * w = m_scrollArea->viewport(); -#endif rackPlugin * plugin = new rackPlugin( w, _e, m_track, m_port ); connect( plugin, SIGNAL( moveUp( rackPlugin * ) ), this, SLOT( moveUp( rackPlugin * ) ) ); @@ -96,19 +78,10 @@ void rackView::addEffect( effect * _e ) this, SLOT( moveDown( rackPlugin * ) ) ); connect( plugin, SIGNAL( deletePlugin( rackPlugin * ) ), this, SLOT( deletePlugin( rackPlugin * ) ) ); -#ifndef QT3 plugin->move( 0, m_lastY ); -#else - m_scrollArea->addChild( plugin ); - m_scrollArea->moveChild( plugin, 0, m_lastY ); -#endif plugin->show(); m_lastY += plugin->height(); -#ifdef QT4 m_scrollArea->widget()->setFixedSize( 210, m_lastY ); -#else - m_scrollArea->resizeContents( 210, m_lastY ); -#endif m_rackInserts.append( plugin ); } @@ -119,7 +92,7 @@ void FASTCALL rackView::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "numofeffects", m_rackInserts.count() ); - for( vvector::iterator it = m_rackInserts.begin(); + for( QVector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++ ) { QDomElement ef = ( *it )->saveState( _doc, _this ); @@ -173,7 +146,7 @@ void FASTCALL rackView::loadSettings( const QDomElement & _this ) void rackView::deleteAllPlugins( void ) { - for( vvector::iterator it = m_rackInserts.begin(); + for( QVector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); ++it ) { delete *it; @@ -189,7 +162,7 @@ void rackView::moveUp( rackPlugin * _plugin ) if( _plugin != m_rackInserts.first() ) { int i = 0; - for( vvector::iterator it = + for( QVector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++, i++ ) { @@ -217,7 +190,7 @@ void rackView::moveDown( rackPlugin * _plugin ) if( _plugin != m_rackInserts.last() ) { int i = 0; - for( vvector::iterator it = + for( QVector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++, i++ ) { @@ -241,10 +214,6 @@ void rackView::moveDown( rackPlugin * _plugin ) void rackView::deletePlugin( rackPlugin * _plugin ) { -#ifdef QT3 - m_scrollArea->removeChild( _plugin ); -#endif - m_rackInserts.erase( qFind( m_rackInserts.begin(), m_rackInserts.end(), _plugin ) ); delete _plugin; @@ -257,21 +226,13 @@ void rackView::deletePlugin( rackPlugin * _plugin ) void rackView::redraw() { m_lastY = 0; - for( vvector::iterator it = m_rackInserts.begin(); + for( QVector::iterator it = m_rackInserts.begin(); it != m_rackInserts.end(); it++ ) { -#ifdef QT4 ( *it )->move( 0, m_lastY ); -#else - m_scrollArea->moveChild( *it, 0, m_lastY ); -#endif m_lastY += ( *it )->height(); } -#ifdef QT4 m_scrollArea->widget()->setFixedSize( 210, m_lastY ); -#else - m_scrollArea->resizeContents( 210, m_lastY ); -#endif } diff --git a/src/widgets/rename_dialog.cpp b/src/widgets/rename_dialog.cpp index b22517be4..840bb606d 100644 --- a/src/widgets/rename_dialog.cpp +++ b/src/widgets/rename_dialog.cpp @@ -25,20 +25,9 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include - -#endif - - #include "rename_dialog.h" diff --git a/src/widgets/rubberband.cpp b/src/widgets/rubberband.cpp index a1e7ef61a..f96e72649 100644 --- a/src/widgets/rubberband.cpp +++ b/src/widgets/rubberband.cpp @@ -28,27 +28,11 @@ #include "rubberband.h" -#ifdef QT3 - -#include -#include -#include -#include - -#endif - rubberBand::rubberBand( QWidget * _parent ) : -#ifndef QT3 QRubberBand( Rectangle, _parent ) -#else - QWidget( _parent ) -#endif { -#ifdef QT3 - setBackgroundColor( QColor( 0, 64, 255 ) ); -#endif } @@ -61,10 +45,10 @@ rubberBand::~rubberBand() -vvector rubberBand::selectedObjects( void ) const +QVector rubberBand::selectedObjects( void ) const { - vvector so = selectableObjects(); - for( vvector::iterator it = so.begin(); + QVector so = selectableObjects(); + for( QVector::iterator it = so.begin(); it != so.end(); ) { if( ( *it )->isSelected() == FALSE ) @@ -84,12 +68,9 @@ vvector rubberBand::selectedObjects( void ) const void rubberBand::resizeEvent( QResizeEvent * _re ) { - rubberBandBase::resizeEvent( _re ); -#ifdef QT3 - updateMask(); -#endif - vvector so = selectableObjects(); - for( vvector::iterator it = so.begin(); + QRubberBand::resizeEvent( _re ); + QVector so = selectableObjects(); + for( QVector::iterator it = so.begin(); it != so.end(); ++it ) { ( *it )->setSelected( QRect( pos(), size() ).intersects( @@ -102,44 +83,14 @@ void rubberBand::resizeEvent( QResizeEvent * _re ) -#ifdef QT3 - -bool rubberBand::event( QEvent * _e ) +QVector rubberBand::selectableObjects( void ) const { - bool ret = QWidget::event( _e ); - if( isVisible() == TRUE ) - { - raise(); - } - return( ret ); -} - - - - -void rubberBand::updateMask( void ) -{ - QBitmap rb_mask( size(), TRUE ); - QPainter p( &rb_mask ); - p.setPen( Qt::color1 ); - p.drawRect( 0, 0, width() - 1, height() - 1 ); - p.end(); - setMask( rb_mask ); -} - -#endif - - - - -vvector rubberBand::selectableObjects( void ) const -{ - vvector so; + QVector so; if( parentWidget() == NULL ) { return( so ); } -#ifndef QT3 + QList l = parentWidget()->findChildren(); for( QList::iterator it = l.begin(); it != l.end(); @@ -147,14 +98,6 @@ vvector rubberBand::selectableObjects( void ) const { so.push_back( *it ); } -#else - QObjectList * l = parentWidget()->queryList( "selectableObject" ); - for( QObjectListIt it = *l; it.current() != NULL; ++it ) - { - so.push_back( static_cast( *it ) ); - } - delete l; -#endif return( so ); } diff --git a/src/widgets/side_bar_widget.cpp b/src/widgets/side_bar_widget.cpp index 0dd3e3d38..326fab8bd 100644 --- a/src/widgets/side_bar_widget.cpp +++ b/src/widgets/side_bar_widget.cpp @@ -25,23 +25,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#endif - - #include "side_bar_widget.h" #include "types.h" #include "gui_templates.h" @@ -74,41 +61,21 @@ void sideBarWidget::paintEvent( QPaintEvent * ) { const Uint16 TITLE_FONT_HEIGHT = 13; -#ifdef QT4 QPainter p( this ); p.fillRect( 0, 0, width(), 27, palette().highlight().color() ); -#else - QPixmap draw_pm( rect().size() ); - draw_pm.fill( QApplication::palette().color( QPalette::Normal, - QColorGroup::Background ) ); - - QPainter p( &draw_pm, this ); - p.fillRect( 0, 0, width(), 27, QApplication::palette().color( - QPalette::Normal, - QColorGroup::Highlight ) ); -#endif QFont f = p.font(); f.setBold( TRUE ); p.setFont( pointSize( f ) ); -#ifdef QT4 p.setPen( palette().highlightedText().color() ); -#else - p.setPen( QApplication::palette().color( QPalette::Normal, - QColorGroup::HighlightedText ) ); -#endif + const Uint16 tx = m_icon.width()+4; const Uint16 ty = 2+TITLE_FONT_HEIGHT; p.drawText( tx, ty, m_title ); p.drawLine( tx, ty+4, width()-4, ty+4 ); p.drawPixmap( 2, 2, m_icon ); - -#ifndef QT4 - // and blit all drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } @@ -117,7 +84,7 @@ void sideBarWidget::resizeEvent( QResizeEvent * ) { const Uint16 MARGIN = 6; m_contents->setGeometry( MARGIN, 40 + MARGIN, width() - MARGIN * 2, - height() - MARGIN * 2 - 40 ); + height() - MARGIN * 2 - 40 ); } diff --git a/src/widgets/tab_bar.cpp b/src/widgets/tab_bar.cpp index 5b0b676e1..3345ece40 100644 --- a/src/widgets/tab_bar.cpp +++ b/src/widgets/tab_bar.cpp @@ -30,29 +30,17 @@ #include "gui_templates.h" #include "tooltip.h" -#ifndef QT4 - -#define value data -#define removeWidget remove - -#endif - tabBar::tabBar( QWidget * _parent, QBoxLayout::Direction _dir ) : QWidget( _parent ), -#ifdef QT4 m_layout( new QBoxLayout( _dir, this ) ), -#else - m_layout( new QBoxLayout( this, _dir ) ), -#endif m_exclusive( FALSE ) { m_layout->setMargin( 0 ); m_layout->setSpacing( 0 ); -#ifdef QT4 + setLayout( m_layout ); -#endif } @@ -90,9 +78,7 @@ tabButton * tabBar::addTab( QWidget * _w, const QString & _text, int _id, QMap >::iterator it; for( it = m_tabs.begin(); it != m_tabs.end(); ++it ) { -#if QT_VERSION >= 0x030100 m_layout->removeWidget( it.value().first ); -#endif } m_tabs.insert( _id, qMakePair( b, _w ) ); for( it = m_tabs.begin(); it != m_tabs.end(); ++it ) diff --git a/src/widgets/tab_widget.cpp b/src/widgets/tab_widget.cpp index a32381ef3..7d22a9a97 100644 --- a/src/widgets/tab_widget.cpp +++ b/src/widgets/tab_widget.cpp @@ -25,23 +25,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include - -#endif - - #include "tab_widget.h" #include "gui_templates.h" @@ -54,15 +42,7 @@ tabWidget::tabWidget( const QString & _caption, QWidget * _parent ) : m_caption( _caption ) { setFont( pointSize<7>( font() ) ); -/*#ifdef QT4 - QPalette pal = palette(); - pal.setColor( QPalette::Background, QColor( 96, 96, 96 ) ); - setPalette( pal ); -#else - setPaletteBackgroundColor( QColor( 96, 96, 96 ) ); - setBackgroundMode( Qt::NoBackground ); -#endif*/ -#ifndef QT3 + setAutoFillBackground( TRUE ); QColor bg_color = QApplication::palette().color( QPalette::Active, QPalette::Background ). @@ -70,11 +50,6 @@ tabWidget::tabWidget( const QString & _caption, QWidget * _parent ) : QPalette pal = palette(); pal.setColor( QPalette::Background, bg_color ); setPalette( pal ); -#else - QColor bg_color = QApplication::palette().active().background().dark( - 132 ); - setPaletteBackgroundColor( bg_color ); -#endif } @@ -170,17 +145,11 @@ void tabWidget::resizeEvent( QResizeEvent * ) void tabWidget::paintEvent( QPaintEvent * _pe ) { -#ifdef QT4 QPainter p( this ); - p.fillRect( 0, 0, width() - 1, height() - 1, QColor( 96, 96, 96 ) ); - const int c = 0; -#else - QPixmap pm( size() ); - pm.fill( QColor( 96, 96, 96 ) ); - QPainter p( &pm ); - const int c = 1; -#endif + p.fillRect( 0, 0, width() - 1, height() - 1, QColor( 96, 96, 96 ) ); + + const int c = 0; bool big_tab_captions = ( m_caption == "" ); int add = big_tab_captions ? 1 : 0; @@ -232,10 +201,6 @@ void tabWidget::paintEvent( QPaintEvent * _pe ) p.setPen( cap_col ); cx += ( *it ).nwidth; } - -#ifndef QT4 - bitBlt( this, rect().topLeft(), &pm ); -#endif } @@ -246,7 +211,7 @@ void tabWidget::wheelEvent( QWheelEvent * _we ) _we->accept(); int dir = ( _we->delta() < 0 ) ? 1 : -1; int tab = m_activeTab; - while( tab > -1 && static_cast( tab ) < m_widgets.count() ) + while( tab > -1 && static_cast( tab ) < m_widgets.count() ) { tab += dir; if( m_widgets.contains( tab ) ) diff --git a/src/widgets/tempo_sync_knob.cpp b/src/widgets/tempo_sync_knob.cpp index f709fdb82..d88f79e09 100644 --- a/src/widgets/tempo_sync_knob.cpp +++ b/src/widgets/tempo_sync_knob.cpp @@ -26,26 +26,10 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include -#else - -#include -#include -#include - -#define addSeparator insertSeparator -#define addMenu insertItem - -#endif - - #include "tempo_sync_knob.h" #include "automatable_object_templates.h" #include "embed.h" @@ -90,9 +74,9 @@ tempoSyncKnob::~tempoSyncKnob() void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) { QMenu contextMenu( this ); -#ifdef QT4 contextMenu.setTitle( accessibleName() ); -#else +#warning TODO: CSS-formatting +#if 0 QLabel * caption = new QLabel( "" + QString( accessibleName() ) + "", this ); caption->setPaletteBackgroundColor( QColor( 0, 0, 192 ) ); @@ -118,15 +102,10 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) float limit = 60000.0f / ( engine::getSongEditor()->getTempo() * m_scale ); -#ifdef QT4 QMenu * syncMenu = contextMenu.addMenu( m_tempoSyncIcon, m_tempoSyncDescription ); -#else - QMenu * syncMenu = new QMenu( this ); -#endif if( limit / 8.0f <= maxValue() ) { -#ifdef QT4 connect( syncMenu, SIGNAL( triggered( QAction * ) ), this, SLOT( setTempoSync( QAction * ) ) ); syncMenu->addAction( embed::getIconPixmap( "note_none" ), @@ -174,74 +153,6 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) tr( "Custom..." ), this, SLOT( showCustom( void ) ) )->setData( (int) CUSTOM ); -#else - int menuId; - menuId = syncMenu->addAction( embed::getIconPixmap( "note_none" ), - tr( "No Sync" ), - this, SLOT( setTempoSync( int ) ) ); - syncMenu->setItemParameter( menuId, ( int ) NO_SYNC ); - if( limit / 0.125f <= maxValue() ) - { - menuId = syncMenu->addAction( - embed::getIconPixmap( "note_double_whole" ), - tr( "Eight beats" ), - this, SLOT( setTempoSync( int ) ) ); - syncMenu->setItemParameter( menuId, ( int ) DOUBLE_WHOLE_NOTE ); - } - if( limit / 0.25f <= maxValue() ) - { - menuId = syncMenu->addAction( - embed::getIconPixmap( "note_whole" ), - tr( "Whole note" ), - this, SLOT( setTempoSync( int ) ) ); - syncMenu->setItemParameter( menuId, ( int ) WHOLE_NOTE ); - } - if( limit / 0.5f <= maxValue() ) - { - menuId = syncMenu->addAction( - embed::getIconPixmap( "note_half" ), - tr( "Half note" ), - this, SLOT( setTempoSync( int ) ) ); - syncMenu->setItemParameter( menuId, ( int ) HALF_NOTE ); - } - if( limit <= maxValue() ) - { - menuId = syncMenu->addAction( - embed::getIconPixmap( "note_quarter" ), - tr( "Quarter note" ), - this, SLOT( setTempoSync( int ) ) ); - syncMenu->setItemParameter( menuId, ( int ) QUARTER_NOTE ); - } - if( limit / 2.0f <= maxValue() ) - { - menuId = syncMenu->addAction( - embed::getIconPixmap( "note_eighth" ), - tr( "8th note" ), - this, SLOT( setTempoSync( int ) ) ); - syncMenu->setItemParameter( menuId, ( int ) EIGHTH_NOTE ); - } - if( limit / 4.0f <= maxValue() ) - { - menuId = syncMenu->addAction( - embed::getIconPixmap( "note_sixteenth" ), - tr( "16th note" ), - this, SLOT( setTempoSync( int ) ) ); - syncMenu->setItemParameter( menuId, ( int ) SIXTEENTH_NOTE ); - } - menuId = syncMenu->addAction( embed::getIconPixmap( - "note_thirtysecond" ), - tr( "32nd note" ), - this, SLOT( setTempoSync( int ) ) ); - syncMenu->setItemParameter( menuId, ( int ) THIRTYSECOND_NOTE ); - menuId = syncMenu->addAction( embed::getIconPixmap( "dont_know" ), - tr( "Custom..." ), - this, SLOT( showCustom( void ) ) ); - syncMenu->setItemParameter( menuId, ( int ) CUSTOM ); - - contextMenu.addMenu( m_tempoSyncIcon, m_tempoSyncDescription, - syncMenu ); -#endif - contextMenu.addSeparator(); } @@ -282,19 +193,12 @@ void tempoSyncKnob::wheelEvent( QWheelEvent * _we ) -#ifdef QT4 void tempoSyncKnob::setTempoSync( QAction * _item ) { setTempoSync( _item->data().toInt() ); } -#else - -void tempoSyncKnob::setTempoSync( QAction * ) { } - -#endif - void tempoSyncKnob::setTempoSync( int _note_type ) @@ -552,11 +456,6 @@ void tempoSyncKnob::showCustom( void ) -#ifndef QT4 -#undef addSeparator -#endif - - #include "tempo_sync_knob.moc" diff --git a/src/widgets/text_float.cpp b/src/widgets/text_float.cpp index a7c109004..ee05228cf 100644 --- a/src/widgets/text_float.cpp +++ b/src/widgets/text_float.cpp @@ -3,7 +3,7 @@ /* * text_float.cpp - class textFloat, a floating text-label * - * Copyright (c) 2005-2006 Tobias Doerffel + * Copyright (c) 2005-2007 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -25,24 +25,9 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include -#else - -#include -#include -#include - -#define setParent reparent - -#endif - - #include "text_float.h" #include "gui_templates.h" #include "main_window.h" @@ -51,7 +36,7 @@ textFloat::textFloat( QWidget * _parent ) : QWidget( _parent -#ifndef QT4 +#if 0 , "textFloat", WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop #endif ), @@ -59,10 +44,6 @@ textFloat::textFloat( QWidget * _parent ) : m_text( "" ), m_pixmap() { -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif - reparent( parentWidget() ); resize( 20, 20 ); hide(); @@ -111,12 +92,7 @@ void textFloat::reparent( QWidget * _new_parent ) // Get position and reparent to either top level or dialog // while( _new_parent->parentWidget() && !_new_parent->isTopLevel() && -#ifdef QT4 - !_new_parent->windowType() == Qt::Dialog -#else - !_new_parent->isDialog() -#endif - ) + !_new_parent->windowType() == Qt::Dialog ) { _new_parent = _new_parent->parentWidget(); position += _new_parent->pos(); @@ -126,15 +102,8 @@ void textFloat::reparent( QWidget * _new_parent ) // //move(pos + QPoint(parent->width() + 5, 5)); - QWidget::setParent( _new_parent, -#ifdef QT4 - Qt::FramelessWindowHint | + QWidget::setParent( _new_parent, Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint ); -#else - WStyle_Customize | WStyle_NoBorder | - WStyle_StaysOnTop, - position + QPoint( 20, 5 ) ); -#endif } @@ -152,7 +121,6 @@ void textFloat::setVisibilityTimeOut( int _msecs ) textFloat * textFloat::displayMessage( const QString & _msg, int _timeout, QWidget * _parent, int _add_y_margin ) { -#ifdef QT4 QWidget * mw = QApplication::activeWindow(); if( mw == NULL ) { @@ -164,13 +132,7 @@ textFloat * textFloat::displayMessage( const QString & _msg, int _timeout, } } } -#else - QWidget * mw = qApp->mainWidget(); - if( mw == NULL ) - { - mw = qApp->desktop(); - } -#endif + textFloat * tf = new textFloat( ( _parent == NULL ) ? mw : _parent ); if( _parent != NULL ) { @@ -186,11 +148,7 @@ textFloat * textFloat::displayMessage( const QString & _msg, int _timeout, tf->show(); if( _timeout > 0 ) { -#ifdef QT4 tf->setAttribute( Qt::WA_DeleteOnClose, TRUE ); -#else - tf->setWFlags( tf->getWFlags() | Qt::WDestructiveClose ); -#endif QTimer::singleShot( _timeout, tf, SLOT( close() ) ); } return( tf ); @@ -215,22 +173,15 @@ textFloat * textFloat::displayMessage( const QString & _title, void textFloat::paintEvent( QPaintEvent * _pe ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( size() ); - QPainter p( &draw_pm ); -#endif + p.setPen( QColor( 0, 0, 0 ) ); + p.setBrush( QColor( 224, 224, 224 ) ); p.setFont( pointSize<8>( p.font() ) ); -#ifndef QT3 p.drawRect( 0, 0, rect().right(), rect().bottom() ); -#else - p.drawRect( rect() ); -#endif // p.setPen( Qt::black ); // small message? @@ -252,10 +203,6 @@ void textFloat::paintEvent( QPaintEvent * _pe ) p.setFont( f ); p.drawText( text_x, 12, m_title ); } - -#ifndef QT4 - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } diff --git a/src/widgets/tool_button.cpp b/src/widgets/tool_button.cpp index fa78e7396..7bfa8b8c0 100644 --- a/src/widgets/tool_button.cpp +++ b/src/widgets/tool_button.cpp @@ -41,14 +41,13 @@ toolButton::toolButton( const QPixmap & _pixmap, const QString & _tooltip, m_colorStandard( s_stdColor ), m_colorHighlighted( s_hlColor ) { -#ifndef QT3 setAutoFillBackground( TRUE ); QPalette pal = palette(); pal.setColor( backgroundRole(), m_colorStandard ); pal.setColor( QPalette::Window, m_colorStandard ); pal.setColor( QPalette::Button, m_colorStandard ); setPalette( pal ); -#endif + if( _receiver != NULL && _slot != NULL ) { connect( this, SIGNAL( clicked() ), _receiver, _slot ); @@ -73,15 +72,11 @@ toolButton::~toolButton() void toolButton::enterEvent( QEvent * ) { -#ifdef QT4 QPalette pal = palette(); pal.setColor( backgroundRole(), m_colorHighlighted ); pal.setColor( QPalette::Window, m_colorHighlighted ); pal.setColor( QPalette::Button, m_colorHighlighted ); setPalette( pal ); -#else - setPaletteBackgroundColor( m_colorHighlighted ); -#endif } @@ -89,15 +84,11 @@ void toolButton::enterEvent( QEvent * ) void toolButton::leaveEvent( QEvent * ) { -#ifdef QT4 QPalette pal = palette(); pal.setColor( backgroundRole(), m_colorStandard ); pal.setColor( QPalette::Window, m_colorStandard ); pal.setColor( QPalette::Button, m_colorStandard ); setPalette( pal ); -#else - setPaletteBackgroundColor( m_colorStandard ); -#endif } diff --git a/src/widgets/tooltip.cpp b/src/widgets/tooltip.cpp index b90b657ff..f0d312206 100644 --- a/src/widgets/tooltip.cpp +++ b/src/widgets/tooltip.cpp @@ -25,18 +25,8 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include -#else - -#include - -#endif - #include "tooltip.h" #include "config_mgr.h" @@ -45,11 +35,7 @@ void toolTip::add( QWidget * _w, const QString & _txt ) { if( !configManager::inst()->value( "tooltips", "disabled" ).toInt() ) { -#ifdef QT4 //_w->setToolTip( _txt ); -#else - QToolTip::add( _w, _txt ); -#endif } } diff --git a/src/widgets/visualization_widget.cpp b/src/widgets/visualization_widget.cpp index b517cb6a0..b9d235996 100644 --- a/src/widgets/visualization_widget.cpp +++ b/src/widgets/visualization_widget.cpp @@ -25,24 +25,11 @@ */ -#include "qt3support.h" - -#ifdef QT4 - #include #include #include #include -#else - -#include -#include -#include - -#endif - - #include "visualization_widget.h" #include "embed.h" #include "engine.h" @@ -60,9 +47,6 @@ visualizationWidget::visualizationWidget( const QPixmap & _bg, QWidget * _p, s_background( _bg ), m_enabled( TRUE ) { -#ifndef QT4 - setBackgroundMode( Qt::NoBackground ); -#endif setFixedSize( s_background.width(), s_background.height() ); @@ -113,13 +97,8 @@ void visualizationWidget::setAudioBuffer( const surroundSampleFrame * _ab, void visualizationWidget::paintEvent( QPaintEvent * ) { -#ifdef QT4 QPainter p( this ); -#else - QPixmap draw_pm( rect().size() ); - QPainter p( &draw_pm, this ); -#endif p.drawPixmap( 0, 0, s_background ); if( m_enabled == TRUE ) @@ -186,11 +165,6 @@ void visualizationWidget::paintEvent( QPaintEvent * ) } } - -#ifndef QT4 - // and blit all drawn stuff on the screen... - bitBlt( this, rect().topLeft(), &draw_pm ); -#endif } diff --git a/src/widgets/volume_knob.cpp b/src/widgets/volume_knob.cpp index ae81bfd3e..057ab7bd2 100644 --- a/src/widgets/volume_knob.cpp +++ b/src/widgets/volume_knob.cpp @@ -25,6 +25,11 @@ * */ + +#include +#include +#include + #include #include "volume_knob.h" @@ -35,19 +40,6 @@ #include "text_float.h" #include "string_pair_drag.h" -#ifndef QT3 - -#include -#include -#include - -#else - -#include -#include - -#endif - volumeKnob::volumeKnob( int _knob_num, QWidget * _parent, const QString & _name, @@ -196,19 +188,11 @@ void volumeKnob::enterValue( void ) if( configManager::inst()->value( "app", "displaydbv" ).toInt() ) { new_val = QInputDialog::getDouble( -#ifdef QT4 - this, -#endif - accessibleName(), + this, accessibleName(), tr( "Please enter a new value between " "-96.0 dbV and 6.0 dbV:" ), 20.0 * log10( value() / 100.0 ), - -96.0, 6.0, - 4, &ok -#ifndef QT4 - , this -#endif - ); + -96.0, 6.0, 4, &ok ); if( new_val <= -96.0 ) { new_val = 0.0f; @@ -221,19 +205,12 @@ void volumeKnob::enterValue( void ) else { new_val = QInputDialog::getDouble( -#ifdef QT4 - this, -#endif - accessibleName(), - tr( "Please enter a new value between " - "%1 and %2:" ).arg( + this, accessibleName(), + tr( "Please enter a new value between " + "%1 and %2:" ).arg( minValue() ).arg( maxValue() ), value(), minValue(), maxValue(), - 4, &ok -#ifndef QT4 - , this -#endif - ); + 4, &ok ); } if( ok )