From 613c44ef3fdffd7b55e0755a16fc70279fc1a744 Mon Sep 17 00:00:00 2001 From: pouillot Date: Sat, 20 Apr 2013 16:33:09 +0000 Subject: [PATCH] Re #802 Qatsh port to Qt5 (still crashes with MinGW 4.7 at least) git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/subprojects/soundeditor/trunk@5414 30fe4595-0a0c-4342-8851-515496e4dcbd --- CMakeLists.txt | 2 +- INSTALL.txt | 68 ++++++++++++--------- cmake/thirdparty.cmake | 67 ++++++++++++++++---- qatsh/ATSDataProxyModel.cpp | 5 +- qatsh/ATSDataProxyModel.h | 4 +- qatsh/ATSFrameProxyModel.cpp | 8 ++- qatsh/ATSFrameProxyModel.h | 4 +- qatsh/ATSModel.cpp | 6 +- qatsh/ATSModel.h | 2 +- qatsh/ATSModelItems.h | 2 +- qatsh/ATSModelManager.cpp | 2 +- qatsh/ATSPartialsFrameProxyModel.cpp | 2 +- qatsh/ATSPartialsFrameProxyModel.h | 2 +- qatsh/ATSPartialsProxyModel.cpp | 15 +++-- qatsh/ATSPropertiesProxyModel.h | 4 +- qatsh/ATSResidualsFrameProxyModel.h | 2 +- qatsh/ATSResidualsProxyModel.h | 2 +- qatsh/AnalysisParamsDialog.cpp | 4 +- qatsh/AnalysisParamsDialog.h | 2 +- qatsh/AnalysisParamsWidget.cpp | 4 +- qatsh/AnalysisParamsWidget.h | 2 +- qatsh/CMakeLists.txt | 50 +++++++++++++-- qatsh/ColorMap.h | 4 +- qatsh/ColorScale.cpp | 52 +++++----------- qatsh/ColorScale.h | 2 +- qatsh/DataSelectionWidget.h | 2 +- qatsh/DocumentWindow.cpp | 14 ++--- qatsh/DocumentWindow.h | 4 +- qatsh/FilePropertiesDialog.cpp | 2 +- qatsh/FilePropertiesDialog.h | 2 +- qatsh/FilePropertiesView.cpp | 2 +- qatsh/FilePropertiesView.h | 2 +- qatsh/FrameAndDataEditionWidget.cpp | 10 +-- qatsh/FrameAndDataEditionWidget.h | 2 +- qatsh/FrameSelectionWidget.h | 2 +- qatsh/IATSAnalysis.h | 2 +- qatsh/Main.cpp | 2 +- qatsh/MainWindow.cpp | 14 ++--- qatsh/MainWindow.h | 4 +- qatsh/PartialsFrameTableView.cpp | 15 +++-- qatsh/PartialsFrameTableView.h | 2 +- qatsh/PartialsSpecgramGraphicsFrameItem.cpp | 6 +- qatsh/PartialsSpecgramGraphicsFrameItem.h | 2 +- qatsh/PartialsSpecgramGraphicsScene.cpp | 16 ++--- qatsh/PartialsSpecgramGraphicsScene.h | 6 +- qatsh/PartialsSpecgramGraphicsView.cpp | 18 +++--- qatsh/PartialsSpecgramGraphicsView.h | 2 +- qatsh/PartialsSpecgramWidget.h | 2 +- qatsh/PreferencesDialog.cpp | 4 +- qatsh/PreferencesDialog.h | 2 +- qatsh/ResidualsFrameTableView.cpp | 10 ++- qatsh/ResidualsFrameTableView.h | 2 +- qatsh/ResidualsSpecgramGraphicsScene.cpp | 16 ++--- qatsh/ResidualsSpecgramGraphicsScene.h | 2 +- qatsh/ResidualsSpecgramGraphicsView.cpp | 10 +-- qatsh/ResidualsSpecgramGraphicsView.h | 2 +- qatsh/ResidualsSpecgramWidget.h | 2 +- qatsh/Ruler.cpp | 10 +-- qatsh/Ruler.h | 2 +- qatsh/RulerSpec.h | 4 +- qatsh/SynthesisParamsWidget.cpp | 6 +- qatsh/SynthesisParamsWidget.h | 2 +- qatsh/TableAndToolsWidget.cpp | 8 +-- qatsh/TableAndToolsWidget.h | 2 +- 64 files changed, 308 insertions(+), 226 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd92c50..71387f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(qatsh) cmake_minimum_required(VERSION 2.8) # CMake Build options. -if(NOT CMAKE_BUILD_TYPE) +if(NOT DEFINED CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) diff --git a/INSTALL.txt b/INSTALL.txt index 2557177..c554f1b 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -20,7 +20,7 @@ III - Linux Installation from sources IV - Windows Installation from sources - 1 - Building with MinGW 4.4 + 1 - Building with MinGW 4.4 / 4.7 2 - Building with MS VC++ 2008 (9) / 2010 (10) 3 - Running Qatsh @@ -38,14 +38,14 @@ I - Pre-requisites a. Linux - * Qt 4.4 (or later) libraries + * Qt 4.4 (or later), or Qt 5.0 (or later) libraries Install them through your package manager : the package name should look - like "libqt-4.x.y...-dev" or "libqt-4.x.y...-devel" - (don't forget the "-dev(el)" at the end). + like "libqt4...-dev" or "libqt4...-devel" or "libqt-4.x.y...-dev" or "libqt-4.x.y...-devel" + (replace 4 by 5 for Qt 5, and don't forget the "-dev(el)" at the end). Example: - * Linux Mint Debian : TODO + * Linux Mint Debian : libqt4-dev * Ubuntu 12.10 : TODO * libSndFile 1.0.17 (or later) library @@ -56,32 +56,32 @@ I - Pre-requisites b. Windows - * Qt 4.4 (or later) libraries + * Qt 4.4 (or later), or Qt 5.0 (or later) libraries - Note : You may have them already installed if you installed a complete Qt 4 SDK - (bundling Qt 4 libs + MinGW + Qt Creator in 1 package) + Note : You may have them already installed if you installed a complete Qt 4 / 5 SDK + (bundling Qt 4 / 5 libs + MinGW + Qt Creator in an all-in-one package) Download the latest binary installer of the "Qt libraries" - for your platform (32 or 64 bits) and chosen compiler (MinGW 4.4 or MSVC 20XX) from : + for your platform (32 or 64 bits) and chosen compiler (MinGW 4.4/4.7 or MSVC 20XX) from : http://qt-project.org/downloads#qt-lib And then install it in the standard location (recommended). And then add the installed "bin" folder in your PATH environment variable - (to make have CMake detect Qt 4) : + (to have CMake detect Qt 4 / 5) : - Windows "Start Menu" - "Settings" / "Configuration panel" / "System" - "Advanced" tab / "Environment variables" button, - Select the "PATH" user variable and click on "Chnage" button, - - Add "C:\Qt\4.x.y\bin;" at the beginning of the current value - (4.x.y being the actual installed version of Qt libraries) , and click on "OK" + - Add "C:\Qt\\bin;" at the beginning of the current value + ( being the actual installed version of Qt libraries), and click on "OK" - Click on "OK" - Click on "OK" Notes for the MinGW version : - Be careful to specify the right folder - when asked to by the installation wizard about MinGW 4.4 ! + when asked to by the installation wizard about MinGW 4.4/4.7 ! * libSndFile 1.0.17 (or later) library @@ -91,7 +91,7 @@ I - Pre-requisites And then install it in the standard location (recommended). - Note: The shipped binaries work with both MinGW 4.4 and MSVC 20XX. + Note: The shipped binaries work with both MinGW 4.4/4.7 and MSVC 20XX. c. Mac OS X @@ -110,7 +110,7 @@ I - Pre-requisites like "gcc" or "g++" or "gnu-c++" or so ... Example: - * Linux Mint Debian : TODO + * Linux Mint Debian : gcc * Ubuntu 12.10 : TODO * CMake 2.8 (or later) @@ -126,10 +126,19 @@ I - Pre-requisites And then install it in the standard location (recommended). - * Compiler and IDE (option 1) : QtCreator 2.5 (or later) and MinGW 4.4 (no other) + * Compiler and IDE (option 1) : + + a) For Qt 5 : QtCreator 2.6.2 (or later) and MinGW 4.7 (no other) + + You'll find an all-in-one package : http://qt-project.org/downloads#qt-lib + + QtCreator is pre-configured for the bundled MinGW 4.7 + QT 5 libs, + but you'll need to configure it for CMake : see below specific instructions in b. + + b) For Qt 4 : QtCreator 2.5 (or later) and MinGW 4.4 (no other) As of early March 2013, there's no more all-in-one Qt 4 libs + MinGW + Qt Creator - package available (only for Qt 5). + package available. You need to get and install individual components yourself. - Download MinGW 4.4 (latest 4.7 is not compatible with Qt 4.8.x libraries) @@ -160,7 +169,7 @@ I - Pre-requisites (example : qt-creator-windows-opensource-2.6.2.exe) - Configure QtCreator (tell it where to find CMake, MinGW 4.4 and Qt libs, - in cae it didn't auto-detect them : ignore the relevant actions below if so) + in case it didn't auto-detect them : ignore the relevant actions below if so) - start it, - Tools / Options opens the Options windows, - Select "Compile & Run" in the list of the left, @@ -391,6 +400,10 @@ See above for pre-requisite conventions about where the sources are located. Usefull CMake variables for Qatsh (note that some might be "advanced" ones) : + - OPTION_QT5:BOOL : Set it to On to force building with Qt 5 libs + (usefull only if you also have Qt 4 libs installed) + (def: Off) + - CMAKE_BUILD_TYPE:STRING : Debug, Release, RelWithDebInfo, MinSizeRel (def: Release) @@ -477,15 +490,14 @@ See above for pre-requisite conventions about where the sources are located. * Run CMake page : use : + CMake generator : "MinGW generator" (mandatory choice here !) + CMake arguments : - -DOPTION_OFFICIAL_ONLY:BOOL=On -DCMAKE_BUILD_TYPE:STRING=Release + -DCMAKE_BUILD_TYPE:STRING=Release + Click on the Run CMake button - Note: See II.2.c above for more about possible / useful CMake arguments. + Note: See III.1.a above for more about possible / useful CMake arguments. Note: The 'Release' build gives you -O3-optimised binaries. - Apart from "won't build" or "won't install" message (don't care), - all should go smoothly, especially the detection of the 3rd party libraries. + All should go smoothly, especially the detection of the 3rd party libraries. * Done @@ -564,7 +576,7 @@ See above for pre-requisite conventions about where the sources are located. c. Press the "Generate" button. CMake will generate the solution file "qatsh.sln" in the ...\build folder, and associated project files (*.vcproj) in the ...\build folder and subfolders - (Note : .sln/.vcproj are OK for MSVC 2005, but you might get other files extensions + (Note : .sln/.vcproj are OK for MSVC 2005/8/10, but you might get other files extensions the later MSVC versions). d. Load qatsh.sln in MSVC IDE. @@ -573,11 +585,11 @@ See above for pre-requisite conventions about where the sources are located. f. Build the whole Solution (Build / Build Solution) - g. At this stage, you can already debug or run qatsh from MSVC - without installing (the built executable in the build/qatsh folder), - provided you have added "C:\Program files\Mega-Nerd\libsndfile\bin;" - at the beginning of your PATH environment variable - (see for how to do this). + g. At this stage, you can already debug or run qatsh from MSVC + without installing (the built executable in the build/qatsh folder), + provided you have added "C:\Program files\Mega-Nerd\libsndfile\bin;" + at the beginning of your PATH environment variable + (see for how to do this). h. But you can also install it (in C:\Program files\qatsh with default CMake settings) : Build the 'INSTALL' project (right click on it and select Build). diff --git a/cmake/thirdparty.cmake b/cmake/thirdparty.cmake index 3d834b9..27d7a5f 100644 --- a/cmake/thirdparty.cmake +++ b/cmake/thirdparty.cmake @@ -31,7 +31,7 @@ MACRO(_FIND_3RDPARTY_DLL LIB_PATH_NAMES LIB_NAME_HINTS DLL_NAME_PREFIXES DLL_PATHNAME_VAR) - #MESSAGE(STATUS "_FIND_3RDPARTY_DLL : Libs=${LIB_PATH_NAMES} Hints=${LIB_NAME_HINTS}") + MESSAGE(STATUS "_FIND_3RDPARTY_DLL : Libs=${LIB_PATH_NAMES} Hints=${LIB_NAME_HINTS}") FOREACH(_LIB_NAME_HINT ${LIB_NAME_HINTS}) @@ -95,11 +95,29 @@ MACRO(INSTALL_3RDPARTY_RUNTIME) SET(_QT_DBG_SFX "d") ENDIF() - _FIND_3RDPARTY_DLL("${QT_QTCORE_LIBRARY}" "QtCore${_QT_DBG_SFX}4" "" _DLL_PATHNAME) - LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + IF(OPTION_QT5) - _FIND_3RDPARTY_DLL("${QT_QTGUI_LIBRARY}" "QtGui${_QT_DBG_SFX}4" "" _DLL_PATHNAME) - LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + GET_TARGET_PROPERTY(_THIRDPARTY_LIB_PATHNAME "${Qt5Core_LIBRARIES}" LOCATION) + _FIND_3RDPARTY_DLL("${_THIRDPARTY_LIB_PATHNAME}" "Qt5Core${_QT_DBG_SFX}" "" _DLL_PATHNAME) + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + GET_TARGET_PROPERTY(_THIRDPARTY_LIB_PATHNAME "${Qt5Widgets_LIBRARIES}" LOCATION) + _FIND_3RDPARTY_DLL("${_THIRDPARTY_LIB_PATHNAME}" "Qt5Gui${_QT_DBG_SFX}" "" _DLL_PATHNAME) + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + STRING(REPLACE "Qt5Gui" "Qt5Widgets" _THIRDPARTY_LIB_PATHNAME "${_THIRDPARTY_LIB_PATHNAME}") + _FIND_3RDPARTY_DLL("${_THIRDPARTY_LIB_PATHNAME}" "Qt5Widgets${_QT_DBG_SFX}" "" _DLL_PATHNAME) + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + ELSE() + + _FIND_3RDPARTY_DLL("${QT_QTCORE_LIBRARY}" "QtCore${_QT_DBG_SFX}4" "" _DLL_PATHNAME) + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + _FIND_3RDPARTY_DLL("${QT_QTGUI_LIBRARY}" "QtGui${_QT_DBG_SFX}4" "" _DLL_PATHNAME) + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + ENDIF() # LibSndFile _FIND_3RDPARTY_DLL("${LIBSNDFILE_LIBRARY}" "sndfile;sndfile-1" "lib;" _DLL_PATHNAME) @@ -119,15 +137,38 @@ MACRO(INSTALL_3RDPARTY_RUNTIME) ELSEIF(MINGW) - # Works with MinGW 4.4 and 4.7. - GET_FILENAME_COMPONENT(_MINGW_BINDIR "${CMAKE_CXX_COMPILER}" PATH) - SET(_DLL_PATHNAME "${_MINGW_BINDIR}/mingwm10.dll") - MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}") - LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + IF(OPTION_QT5) - SET(_DLL_PATHNAME "${_MINGW_BINDIR}/libgcc_s_dw2-1.dll") - MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}") - LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + # Works with MinGW 4.7 shipped with QtCreator >= 2.6 and Qt 5. + SET(_DLL_PATHNAME "${_MINGW_BINDIR}/libstdc++-6.dll") + MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}") + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + SET(_DLL_PATHNAME "${_MINGW_BINDIR}/libgcc_s_sjlj-1.dll") + MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}") + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + SET(_DLL_PATHNAME "${_MINGW_BINDIR}/libwinpthread-1.dll") + MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}") + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + SET(_DLL_PATHNAME "${_MINGW_BINDIR}/libgcc_s_dw2-1.dll") + MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}") + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + ELSE() + + # Works with MinGW 4.4 shipped with QtCreator < 2.6 and with stock MinGW 4.7. + GET_FILENAME_COMPONENT(_MINGW_BINDIR "${CMAKE_CXX_COMPILER}" PATH) + SET(_DLL_PATHNAME "${_MINGW_BINDIR}/mingwm10.dll") + MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}") + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + SET(_DLL_PATHNAME "${_MINGW_BINDIR}/libgcc_s_dw2-1.dll") + MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}") + LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") + + ENDIF() ENDIF(MSVC) diff --git a/qatsh/ATSDataProxyModel.cpp b/qatsh/ATSDataProxyModel.cpp index 7f25fd5..62e716b 100644 --- a/qatsh/ATSDataProxyModel.cpp +++ b/qatsh/ATSDataProxyModel.cpp @@ -7,7 +7,7 @@ #include -#include +#include #include "ATSModel.h" #include "ATSDataProxyModel.h" @@ -39,7 +39,8 @@ void ATSDataProxyModel::onSourceModelReset() //std::cout << "ATSDataProxyModel::onSourceModelReset" << std::endl; // Warn attached views that we were reset - reset(); + beginResetModel(); + endResetModel(); } // Get number of frames ==================================================== diff --git a/qatsh/ATSDataProxyModel.h b/qatsh/ATSDataProxyModel.h index 254c97f..5f43ff4 100644 --- a/qatsh/ATSDataProxyModel.h +++ b/qatsh/ATSDataProxyModel.h @@ -8,8 +8,8 @@ #ifndef ATSDATAPROXYMODEL_H #define ATSDATAPROXYMODEL_H -#include -#include +#include +#include class ATSDataProxyModel : public QAbstractProxyModel diff --git a/qatsh/ATSFrameProxyModel.cpp b/qatsh/ATSFrameProxyModel.cpp index 332ae0f..94bdd52 100644 --- a/qatsh/ATSFrameProxyModel.cpp +++ b/qatsh/ATSFrameProxyModel.cpp @@ -7,7 +7,7 @@ #include -#include +#include #include "ATSDataProxyModel.h" #include "ATSFrameProxyModel.h" @@ -46,7 +46,8 @@ void ATSFrameProxyModel::onSourceModelReset() // << _nCurrFrameIndex << std::endl; // And also warn attached views that we were reset - reset(); + beginResetModel(); + endResetModel(); } // Set current frame ======================================================= @@ -56,7 +57,8 @@ void ATSFrameProxyModel::setCurrentFrame(int nFrameIndex) _nCurrFrameIndex = nFrameIndex; // Warn attached views that the whole model has changed. - reset(); + beginResetModel(); + endResetModel(); } // Get number of frames ==================================================== diff --git a/qatsh/ATSFrameProxyModel.h b/qatsh/ATSFrameProxyModel.h index 0ee8c5d..9a828e0 100644 --- a/qatsh/ATSFrameProxyModel.h +++ b/qatsh/ATSFrameProxyModel.h @@ -8,8 +8,8 @@ #ifndef ATSFRAMEDATAPROXYMODEL_H #define ATSFRAMEDATAPROXYMODEL_H -#include -#include +#include +#include class ATSFrameProxyModel : public QAbstractProxyModel diff --git a/qatsh/ATSModel.cpp b/qatsh/ATSModel.cpp index 723bb2f..ed21b11 100644 --- a/qatsh/ATSModel.cpp +++ b/qatsh/ATSModel.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include "ATSModel.h" #include "ATSModelItems.h" @@ -59,12 +59,14 @@ void ATSModel::reInitialize(EReInitType eReInitType) // Don't call before load() { case eEverything: + beginResetModel(); + if (_pmiRootItem) delete _pmiRootItem; _pmiRootItem = new ATSRootItem(_pATSSound); // Warn attached views and proxy models that the whole model has changed. - reset(); + endResetModel(); break; diff --git a/qatsh/ATSModel.h b/qatsh/ATSModel.h index f3e0de5..7bf19a2 100644 --- a/qatsh/ATSModel.h +++ b/qatsh/ATSModel.h @@ -7,7 +7,7 @@ #ifndef ATSMODEL_H #define ATSMODEL_H -#include +#include class ATSRootItem; class ATSSound; diff --git a/qatsh/ATSModelItems.h b/qatsh/ATSModelItems.h index 1d5b27a..a40436f 100644 --- a/qatsh/ATSModelItems.h +++ b/qatsh/ATSModelItems.h @@ -11,7 +11,7 @@ #ifndef ATSMODELITEMS_H #define ATSMODELITEMS_H -#include +#include #include "ATSSound.h" diff --git a/qatsh/ATSModelManager.cpp b/qatsh/ATSModelManager.cpp index 001e55e..cfd0ff8 100644 --- a/qatsh/ATSModelManager.cpp +++ b/qatsh/ATSModelManager.cpp @@ -5,7 +5,7 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include +#include #include "ATSModelManager.h" diff --git a/qatsh/ATSPartialsFrameProxyModel.cpp b/qatsh/ATSPartialsFrameProxyModel.cpp index bc3854e..0ca9530 100644 --- a/qatsh/ATSPartialsFrameProxyModel.cpp +++ b/qatsh/ATSPartialsFrameProxyModel.cpp @@ -7,7 +7,7 @@ #include -#include +#include #include "ATSModelItems.h" #include "ATSPartialsProxyModel.h" diff --git a/qatsh/ATSPartialsFrameProxyModel.h b/qatsh/ATSPartialsFrameProxyModel.h index 693e801..eccbac6 100644 --- a/qatsh/ATSPartialsFrameProxyModel.h +++ b/qatsh/ATSPartialsFrameProxyModel.h @@ -7,7 +7,7 @@ #ifndef ATSPARTIALSFRAMEPROXYMODEL_H #define ATSPARTIALSFRAMEPROXYMODEL_H -#include +#include #include "ATSFrameProxyModel.h" diff --git a/qatsh/ATSPartialsProxyModel.cpp b/qatsh/ATSPartialsProxyModel.cpp index 9d9b903..72335be 100644 --- a/qatsh/ATSPartialsProxyModel.cpp +++ b/qatsh/ATSPartialsProxyModel.cpp @@ -8,7 +8,7 @@ #include -#include +#include #include "TypesAndConstants.h" #include "ATSModel.h" @@ -205,11 +205,12 @@ void ATSPartialsProxyModel::addPartial(const QModelIndex& qmiToCopy) ATSModel* pSourceModel = static_cast(sourceModel()); pSourceModel->sound()->addPartial(nCopyIndex); - // Re-initialize the dedictated part of the source model. + // Re-initialize the dedicated part of the source model. pSourceModel->reInitialize(ATSModel::ePartialsListOnly); // Warn everyone that the model heavily changed. - reset(); + beginResetModel(); + endResetModel(); } void ATSPartialsProxyModel::removePartials(const QModelIndexList& qlmiToRemove) @@ -240,10 +241,11 @@ void ATSPartialsProxyModel::removePartials(const QModelIndexList& qlmiToRemove) pSourceModel->reInitialize(ATSModel::ePartialsListOnly); // Warn everyone that the model heavily changed. - reset(); + beginResetModel(); + endResetModel(); } -std::string ATSPartialsProxyModel::modifyPartials(const QModelIndexList& qlmiToModify, +std::string ATSPartialsProxyModel::modifyPartials(const QModelIndexList& qlmiToModify, const QString& qsFormula, TypesAndConstants::EPartialMagnitude eMagnitude) { @@ -275,7 +277,8 @@ std::string ATSPartialsProxyModel::modifyPartials(const QModelIndexList& qlmiTo pSourceModel->reInitialize(ATSModel::ePartialsListOnly); // Warn everyone that the model heavily changed. - reset(); + beginResetModel(); + endResetModel(); return strParsedFormula; } diff --git a/qatsh/ATSPropertiesProxyModel.h b/qatsh/ATSPropertiesProxyModel.h index 0ffa4c0..82d24cd 100644 --- a/qatsh/ATSPropertiesProxyModel.h +++ b/qatsh/ATSPropertiesProxyModel.h @@ -8,8 +8,8 @@ #ifndef ATSPPROPERTIESPROXYMODEL_H #define ATSPPROPERTIESPROXYMODEL_H -#include -#include +#include +#include class ATSPropertiesProxyModel : public QAbstractProxyModel diff --git a/qatsh/ATSResidualsFrameProxyModel.h b/qatsh/ATSResidualsFrameProxyModel.h index 0751f59..a79023a 100644 --- a/qatsh/ATSResidualsFrameProxyModel.h +++ b/qatsh/ATSResidualsFrameProxyModel.h @@ -8,7 +8,7 @@ #ifndef ATSRESIDUALSFRAMEPROXYMODEL_H #define ATSRESIDUALSFRAMEPROXYMODEL_H -#include +#include #include "ATSFrameProxyModel.h" diff --git a/qatsh/ATSResidualsProxyModel.h b/qatsh/ATSResidualsProxyModel.h index 7f79d6b..c3c60ac 100644 --- a/qatsh/ATSResidualsProxyModel.h +++ b/qatsh/ATSResidualsProxyModel.h @@ -7,7 +7,7 @@ #ifndef ATSRESIDUALSPROXYMODEL_H #define ATSRESIDUALSPROXYMODEL_H -#include +#include #include "ATSDataProxyModel.h" diff --git a/qatsh/AnalysisParamsDialog.cpp b/qatsh/AnalysisParamsDialog.cpp index 9f11a0c..7eb6547 100644 --- a/qatsh/AnalysisParamsDialog.cpp +++ b/qatsh/AnalysisParamsDialog.cpp @@ -4,8 +4,8 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include -#include +#include +#include #include "AnalysisParamsDialog.h" #include "ui_AnalysisParamsDialog.h" diff --git a/qatsh/AnalysisParamsDialog.h b/qatsh/AnalysisParamsDialog.h index c5c1d0b..9971b7c 100644 --- a/qatsh/AnalysisParamsDialog.h +++ b/qatsh/AnalysisParamsDialog.h @@ -7,7 +7,7 @@ #ifndef AnalysisParamsDialog_h #define AnalysisParamsDialog_h -#include +#include namespace Ui { class AnalysisParamsDialog; diff --git a/qatsh/AnalysisParamsWidget.cpp b/qatsh/AnalysisParamsWidget.cpp index 31f1809..d426dd3 100644 --- a/qatsh/AnalysisParamsWidget.cpp +++ b/qatsh/AnalysisParamsWidget.cpp @@ -4,8 +4,8 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include -#include +#include +#include #include "AnalysisParamsWidget.h" #include "ui_AnalysisParamsWidget.h" diff --git a/qatsh/AnalysisParamsWidget.h b/qatsh/AnalysisParamsWidget.h index 07522fa..12c8f6a 100644 --- a/qatsh/AnalysisParamsWidget.h +++ b/qatsh/AnalysisParamsWidget.h @@ -7,7 +7,7 @@ #ifndef AnalysisParamsWidget_h #define AnalysisParamsWidget_h -#include +#include namespace Ui { class AnalysisParamsWidget; diff --git a/qatsh/CMakeLists.txt b/qatsh/CMakeLists.txt index ba36567..27090d1 100644 --- a/qatsh/CMakeLists.txt +++ b/qatsh/CMakeLists.txt @@ -6,10 +6,33 @@ message(STATUS "Configuring qatsh ...") # External dependencies. -find_package(Qt4 4.4 COMPONENTS QtCore QtGui REQUIRED) -include(${QT_USE_FILE}) -set(QT_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) # Odd it is needed (CMake 2.8.8) ! +# 1) Qt (4 or 5) +if(NOT DEFINED OPTION_QT5 OR NOT OPTION_QT5) + SET(OPTION_QT5 Off CACHE BOOL "Check to build with Qt 5 (rather than Qt 4)" FORCE) +endif() +if(NOT OPTION_QT5) + find_package(Qt4 4.4 COMPONENTS QtCore QtGui REQUIRED) +endif() +if(NOT QT4_FOUND) + MESSAGE(STATUS "Qt 4 not found : Trying Qt 5") + SET(OPTION_QT5 On) +endif() +if(OPTION_QT5) + cmake_minimum_required(VERSION 2.8.8) +endif() +if(OPTION_QT5) + #set(CMAKE_AUTOMOC ON) + find_package(Qt5Core REQUIRED) + find_package(Qt5Widgets REQUIRED) + set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES}) + set(QT_INCLUDES ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) +else() + include(${QT_USE_FILE}) + set(QT_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) # Odd it is needed (CMake 2.8.8) ! +endif() + +# 2) LibSndFile find_package(LibSndFile REQUIRED) # Sources @@ -139,13 +162,25 @@ set(_UIS MainWindow.ui set(_RSCS qatsh.qrc) # Run moc on header files using Q_OBJECT -qt4_wrap_cpp(_MOC_SRCS ${_MOC_HDRS}) +if(OPTION_QT5) + qt5_wrap_cpp(_MOC_SRCS ${_MOC_HDRS}) +else() + qt4_wrap_cpp(_MOC_SRCS ${_MOC_HDRS}) +endif() # Run uic on .ui files. -qt4_wrap_ui(_UI_HDRS ${_UIS}) +if(OPTION_QT5) + qt5_wrap_ui(_UI_HDRS ${_UIS}) +else() + qt4_wrap_ui(_UI_HDRS ${_UIS}) +endif() # Generate code for resources. -qt4_add_resources(_RCC_SRCS ${_RSCS}) +if(OPTION_QT5) + qt5_add_resources(_RCC_SRCS ${_RSCS}) +else() + qt4_add_resources(_RCC_SRCS ${_RSCS}) +endif() # Embbed icon in executable. if(MINGW) @@ -165,6 +200,9 @@ include_directories(${CMAKE_SOURCE_DIR}/mathexpr ${CMAKE_SOURCE_DIR}/atsa add_executable(qatsh ${_SRCS} ${_MOC_SRCS} ${_MOC_HDRS} ${_HDRS} ${_UI_HDRS} ${_RCC_SRCS}) # Link libs. +#if(OPTION_QT5) +# qt5_use_modules(qatsh Widgets) +#endif() target_link_libraries(qatsh atsa mathexpr ${QT_LIBRARIES} ${LIBSNDFILE_LIBRARY}) # Installation. diff --git a/qatsh/ColorMap.h b/qatsh/ColorMap.h index c63e01a..0e022d1 100644 --- a/qatsh/ColorMap.h +++ b/qatsh/ColorMap.h @@ -7,8 +7,8 @@ #ifndef COLORMAP_H #define COLORMAP_H -#include -#include +#include +#include class ColorMap diff --git a/qatsh/ColorScale.cpp b/qatsh/ColorScale.cpp index df92d1e..efa5323 100644 --- a/qatsh/ColorScale.cpp +++ b/qatsh/ColorScale.cpp @@ -4,8 +4,8 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include -#include +#include +#include #include @@ -56,8 +56,6 @@ void ColorScale::redraw() { //std::cout << "ColorScale::redraw" << std::endl; - //setViewportUpdateMode(QGraphicsView::NoViewportUpdate); - double dLabelScaleX = 1.0; double dLabelScaleY = 1.0; if (_pqgiMinLabel) @@ -83,19 +81,15 @@ void ColorScale::redraw() const QColor& qColor = _pColorMap->color(nColorInd); QGraphicsRectItem* pgiRect = new QGraphicsRectItem(0.0, 0.0, 24.0, 1.0); - pgiRect->setPos(0.0, nColors - 1 - nColorInd); + pgiRect->setPos(0.0, nColors - 1 - nColorInd); pgiRect->setPen(QPen(qColor)); pgiRect->setBrush(QBrush(qColor)); pgiRect->setZValue(-1.0); // Ensure min/max labels not drawn behind this one. pqgvScene->addItem(pgiRect); } - // Draw min and max value. - //QFont qFont("Serif", 8); // Windows OK. - //QFont qFont("Courier", 8); // Windows OK. - //QFont qFont("Times", 8); // Windows OK. - //QFont qFont("Fixed", 8); // Windows OK. - QFont qFont("Tahoma", 8); // Windows OK. + // Draw min and max values (as fixed size labels). + QFont qFont("Tahoma", 8); // Note: Serif, Courier, Times, Fixed also OK under Windows. qFont.setStretch(80); //std::cout << "ColorScale::redraw : Font " << qFont.rawName().toStdString() // << ", size pt " << qFont.pointSize() @@ -104,13 +98,10 @@ void ColorScale::redraw() _pqgiMaxLabel = new QGraphicsSimpleTextItem(QString("%1").arg(_pColorMap->maxValue(), 0, 'g', 2)); _pqgiMaxLabel->setPos(1.0, 0.0); - //QPen qPen; // = _pqgiMaxLabel->pen(); - //qPen.setColor(Qt::white); - //qPen.setCosmetic(true); _pqgiMaxLabel->setPen(QPen(Qt::white)); - //_pqgiMaxLabel->setBrush(Qt::white); _pqgiMaxLabel->setFont(qFont); - _pqgiMaxLabel->scale(dLabelScaleX, dLabelScaleY); + _pqgiMaxLabel->setTransform(QTransform::fromScale(dLabelScaleX, dLabelScaleY), true); + _pqgiMaxLabel->setFlag(QGraphicsItem::ItemIgnoresTransformations); // Lock size. pqgvScene->addItem(_pqgiMaxLabel); @@ -118,16 +109,13 @@ void ColorScale::redraw() new QGraphicsSimpleTextItem(QString("%1").arg(_pColorMap->minValue(), 0, 'g', 2)); _pqgiMinLabel->setPos(1.0, nColors - _pqgiMinLabel->sceneBoundingRect().height()); _pqgiMinLabel->setPen(QPen(Qt::white)); - //_pqgiMinLabel->setPen(QColor(0, 0, 0)); - //_pqgiMinLabel->setBrush(QBrush(Qt::white)); _pqgiMinLabel->setFont(qFont); - _pqgiMinLabel->scale(dLabelScaleX, dLabelScaleY); + _pqgiMinLabel->setTransform(QTransform::fromScale(dLabelScaleX, dLabelScaleY), true); + _pqgiMinLabel->setFlag(QGraphicsItem::ItemIgnoresTransformations); // Lock size. pqgvScene->addItem(_pqgiMinLabel); QResizeEvent qre(size(), size()); resizeEvent(&qre); - - //setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); } @@ -136,26 +124,14 @@ void ColorScale::resizeEvent(QResizeEvent *pqEvent) //std::cout << "ColorScale::resizeEvent(" // << pqEvent->size().width() << "x" << pqEvent->size().height()<< ")"<< std::endl; - // Save previous view scale. - const QTransform qmOldTrans = transform(); - // Apply new scale because of resizing. - QTransform qmNewTrans; - const QRectF sceneRect = scene()->sceneRect(); - qmNewTrans.scale(pqEvent->size().width() / sceneRect.width(), - pqEvent->size().height() / sceneRect.height()); - setTransform(qmNewTrans); + setTransform(QTransform::fromScale(pqEvent->size().width() / scene()->sceneRect().width(), + pqEvent->size().height() / scene()->sceneRect().height())); - // Apply inverted scale to the labels (we don't want they change their size). - // TODO: Remove this awful trick and use QGraphicsItem::ItemIgnoresTransformations - // when creating the labels. - _pqgiMinLabel->scale(qmOldTrans.m11() / qmNewTrans.m11(), - qmOldTrans.m22() / qmNewTrans.m22()); + // Keep min. value label at the bottom (as if it was ignoring the scaling). _pqgiMinLabel->setPos(1.0, _pColorMap->nbColors() - - _pqgiMinLabel->sceneBoundingRect().height()); - _pqgiMaxLabel->scale(qmOldTrans.m11() / qmNewTrans.m11(), - qmOldTrans.m22() / qmNewTrans.m22()); - + - _pqgiMinLabel->boundingRect().height()); + //QTransform qtLabelTrans = _pqgiMinLabel->transform(); //std::cout << "ColorScale::resizeEvent : Label trans m11=" // << qtLabelTrans.m11() << ", m22=" << qtLabelTrans.m22() << std::endl; diff --git a/qatsh/ColorScale.h b/qatsh/ColorScale.h index 69b969e..1247793 100644 --- a/qatsh/ColorScale.h +++ b/qatsh/ColorScale.h @@ -7,7 +7,7 @@ #ifndef COLORSCALE_H #define COLORSCALE_H -#include +#include class QGraphicsSimpleTextItem; class ColorMap; diff --git a/qatsh/DataSelectionWidget.h b/qatsh/DataSelectionWidget.h index 62d4d56..f9cf37e 100644 --- a/qatsh/DataSelectionWidget.h +++ b/qatsh/DataSelectionWidget.h @@ -7,7 +7,7 @@ #ifndef DataSelectionWidget_h #define DataSelectionWidget_h -#include +#include #include "TypesAndConstants.h" diff --git a/qatsh/DocumentWindow.cpp b/qatsh/DocumentWindow.cpp index 5b63091..409a72d 100644 --- a/qatsh/DocumentWindow.cpp +++ b/qatsh/DocumentWindow.cpp @@ -12,17 +12,17 @@ #include #include -#include +#include -#include -#include -#include +#include +#include +#include #ifdef PHONON_AUDIO #include #include #else -#include +#include #endif #include "TypesAndConstants.h" @@ -276,12 +276,12 @@ bool DocumentWindow::synthesiseFile(const QString &qsFileName, { // Save the sampled sound to the given file. // TODO: Customizable sample format. - bDone = pSampSound->store(qsFileName.toAscii(), eFormat); + bDone = pSampSound->store(qsFileName.toStdString().c_str(), eFormat); // Free now useless sampled sound. delete pSampSound; - // Save a copy of the synthesis inputs for later. + // Save a copy of the synthesis inputs for later. _qsLastSyntResFileName = qsFileName; if (!_pLastSyntParams) _pLastSyntParams = new ATSSynthesis(); diff --git a/qatsh/DocumentWindow.h b/qatsh/DocumentWindow.h index 1b9868c..f7472c9 100644 --- a/qatsh/DocumentWindow.h +++ b/qatsh/DocumentWindow.h @@ -14,8 +14,8 @@ #include -#include -#include +#include +#include #include "SampledSound.h" diff --git a/qatsh/FilePropertiesDialog.cpp b/qatsh/FilePropertiesDialog.cpp index e4e6725..d3b41ee 100644 --- a/qatsh/FilePropertiesDialog.cpp +++ b/qatsh/FilePropertiesDialog.cpp @@ -4,7 +4,7 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include +#include #include "ATSModelItems.h" #include "ATSPropertiesProxyModel.h" diff --git a/qatsh/FilePropertiesDialog.h b/qatsh/FilePropertiesDialog.h index 3305966..b647b2e 100644 --- a/qatsh/FilePropertiesDialog.h +++ b/qatsh/FilePropertiesDialog.h @@ -7,7 +7,7 @@ #ifndef FilePropertiesDialog_h #define FilePropertiesDialog_h -#include +#include class QModelIndex; diff --git a/qatsh/FilePropertiesView.cpp b/qatsh/FilePropertiesView.cpp index 63ef8a1..ae7aa99 100644 --- a/qatsh/FilePropertiesView.cpp +++ b/qatsh/FilePropertiesView.cpp @@ -8,7 +8,7 @@ #include "ui_FilePropertiesView.h" -#include +#include #include "ATSModelItems.h" #include "ATSModel.h" diff --git a/qatsh/FilePropertiesView.h b/qatsh/FilePropertiesView.h index 2219faa..64f8a64 100644 --- a/qatsh/FilePropertiesView.h +++ b/qatsh/FilePropertiesView.h @@ -7,7 +7,7 @@ #ifndef FilePropertiesView_h #define FilePropertiesView_h -#include +#include class QModelIndex; diff --git a/qatsh/FrameAndDataEditionWidget.cpp b/qatsh/FrameAndDataEditionWidget.cpp index cc0cb84..e3f7c1d 100644 --- a/qatsh/FrameAndDataEditionWidget.cpp +++ b/qatsh/FrameAndDataEditionWidget.cpp @@ -6,11 +6,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "FrameAndDataEditionWidget.h" #include "ui_FrameAndDataEditionWidget.h" diff --git a/qatsh/FrameAndDataEditionWidget.h b/qatsh/FrameAndDataEditionWidget.h index 94c5e3d..c3ba957 100644 --- a/qatsh/FrameAndDataEditionWidget.h +++ b/qatsh/FrameAndDataEditionWidget.h @@ -7,7 +7,7 @@ #ifndef FrameAndDataEditionWidget_h #define FrameAndDataEditionWidget_h -#include +#include #include "TypesAndConstants.h" diff --git a/qatsh/FrameSelectionWidget.h b/qatsh/FrameSelectionWidget.h index 1d11ac1..53bc927 100644 --- a/qatsh/FrameSelectionWidget.h +++ b/qatsh/FrameSelectionWidget.h @@ -7,7 +7,7 @@ #ifndef FrameSelectionWidget_h #define FrameSelectionWidget_h -#include +#include #include "TypesAndConstants.h" diff --git a/qatsh/IATSAnalysis.h b/qatsh/IATSAnalysis.h index 9062eed..119c936 100644 --- a/qatsh/IATSAnalysis.h +++ b/qatsh/IATSAnalysis.h @@ -7,7 +7,7 @@ #ifndef IATSANALYSIS_H #define IATSANALYSIS_H -#include +#include class SampledSound; class ATSSound; diff --git a/qatsh/Main.cpp b/qatsh/Main.cpp index 07e5cb8..97de388 100644 --- a/qatsh/Main.cpp +++ b/qatsh/Main.cpp @@ -9,7 +9,7 @@ // Copyright 2009 Jean-Philippe MEURET -#include +#include #include "MainWindow.h" #include "PreferencesDialog.h" diff --git a/qatsh/MainWindow.cpp b/qatsh/MainWindow.cpp index c02c1ee..076c569 100644 --- a/qatsh/MainWindow.cpp +++ b/qatsh/MainWindow.cpp @@ -4,14 +4,14 @@ #include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include "IATSAnalysis.h" #include "DocumentWindow.h" diff --git a/qatsh/MainWindow.h b/qatsh/MainWindow.h index 4bd7683..31c7c1b 100644 --- a/qatsh/MainWindow.h +++ b/qatsh/MainWindow.h @@ -5,8 +5,8 @@ #ifndef MainWindow_h #define MainWindow_h -#include -#include +#include +#include #include "DocumentWindow.h" diff --git a/qatsh/PartialsFrameTableView.cpp b/qatsh/PartialsFrameTableView.cpp index 8be9215..7dcf25f 100644 --- a/qatsh/PartialsFrameTableView.cpp +++ b/qatsh/PartialsFrameTableView.cpp @@ -7,9 +7,9 @@ #include #include "ATSMath.h" -#include -#include -#include +#include +#include +#include #include "ATSModelItems.h" #include "ATSModelManager.h" @@ -26,9 +26,12 @@ PartialsFrameTableView::PartialsFrameTableView(QWidget *parent) : QFrame(parent), _pui(new Ui::PartialsFrameTableView), _pModelMgr(0) { _pui->setupUi(this); - +#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0)) + _pui->qtvPartials->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else _pui->qtvPartials->horizontalHeader()->setResizeMode(QHeaderView::Stretch); - +#endif + // Enable control value synchronization _bSynchronizeControls = true; } @@ -53,7 +56,7 @@ void PartialsFrameTableView::setModelManager(ATSModelManager* pModelMgr) const QItemSelection&)), this, SLOT(onSelectionChanged(const QItemSelection&, const QItemSelection&))); - std::cout << "PartialsFrameTableView::setModelManager" << std::endl; + //std::cout << "PartialsFrameTableView::setModelManager" << std::endl; _nMaxFrameIndex = _pModelMgr->partialsFrameModel()->nbFrames() - 1; _dFrameDuration = _pModelMgr->partialsFrameModel()->frameDuration(); diff --git a/qatsh/PartialsFrameTableView.h b/qatsh/PartialsFrameTableView.h index 84e90c6..76b9661 100644 --- a/qatsh/PartialsFrameTableView.h +++ b/qatsh/PartialsFrameTableView.h @@ -7,7 +7,7 @@ #ifndef PartialsFrameTableView_h #define PartialsFrameTableView_h -#include +#include namespace Ui { class PartialsFrameTableView; diff --git a/qatsh/PartialsSpecgramGraphicsFrameItem.cpp b/qatsh/PartialsSpecgramGraphicsFrameItem.cpp index 337cf78..ce9751a 100644 --- a/qatsh/PartialsSpecgramGraphicsFrameItem.cpp +++ b/qatsh/PartialsSpecgramGraphicsFrameItem.cpp @@ -6,9 +6,9 @@ #include -#include -#include -#include +#include +#include +#include #include "ColorMap.h" #include "PartialsSpecgramGraphicsScene.h" diff --git a/qatsh/PartialsSpecgramGraphicsFrameItem.h b/qatsh/PartialsSpecgramGraphicsFrameItem.h index f951755..4b340a6 100644 --- a/qatsh/PartialsSpecgramGraphicsFrameItem.h +++ b/qatsh/PartialsSpecgramGraphicsFrameItem.h @@ -7,7 +7,7 @@ #ifndef PartialsSpecgramGraphicsFrameItem_H #define PartialsSpecgramGraphicsFrameItem_H -#include +#include class ColorMap; class QGraphicsSceneHoverEvent; diff --git a/qatsh/PartialsSpecgramGraphicsScene.cpp b/qatsh/PartialsSpecgramGraphicsScene.cpp index 1904672..d4b98ed 100644 --- a/qatsh/PartialsSpecgramGraphicsScene.cpp +++ b/qatsh/PartialsSpecgramGraphicsScene.cpp @@ -7,15 +7,15 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include "ATSMath.h" diff --git a/qatsh/PartialsSpecgramGraphicsScene.h b/qatsh/PartialsSpecgramGraphicsScene.h index 813569f..a086088 100644 --- a/qatsh/PartialsSpecgramGraphicsScene.h +++ b/qatsh/PartialsSpecgramGraphicsScene.h @@ -7,9 +7,9 @@ #ifndef PartialsSpecgramGraphicsScene_H #define PartialsSpecgramGraphicsScene_H -#include -#include -#include +#include +#include +#include #include "ColorMap.h" #include "RulerSpec.h" diff --git a/qatsh/PartialsSpecgramGraphicsView.cpp b/qatsh/PartialsSpecgramGraphicsView.cpp index 4f6ec69..c24199f 100644 --- a/qatsh/PartialsSpecgramGraphicsView.cpp +++ b/qatsh/PartialsSpecgramGraphicsView.cpp @@ -4,11 +4,11 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // #ifndef QT_NO_OPENGL // # include @@ -109,8 +109,8 @@ void PartialsSpecgramGraphicsView::zoomShiftTime(double dAbsFactor, double dAbsS if (!_bInitialized) return; - std::cout << "PartialsSpecgramGraphicsView::zoomShiftTime(factor=" - << dAbsFactor << ", shiftVal=" << dAbsShiftValue << ") : newTrans=..." << std::endl; + //std::cout << "PartialsSpecgramGraphicsView::zoomShiftTime(factor=" + // << dAbsFactor << ", shiftVal=" << dAbsShiftValue << ") : newTrans=..." << std::endl; // Build new view transform. const QTransform qOldTrans = transform(); @@ -129,8 +129,8 @@ void PartialsSpecgramGraphicsView::zoomShiftFrequency(double dAbsFactor, double if (!_bInitialized) return; - std::cout << "PartialsSpecgramGraphicsView::zoomShiftFreq(factor=" - << dAbsFactor << ", shiftVal=" << dAbsShiftValue << ") : newTrans=..." << std::endl; + //std::cout << "PartialsSpecgramGraphicsView::zoomShiftFreq(factor=" + // << dAbsFactor << ", shiftVal=" << dAbsShiftValue << ") : newTrans=..." << std::endl; // Build new view transform. const QTransform qOldTrans = transform(); diff --git a/qatsh/PartialsSpecgramGraphicsView.h b/qatsh/PartialsSpecgramGraphicsView.h index 6dd520d..44e7c11 100644 --- a/qatsh/PartialsSpecgramGraphicsView.h +++ b/qatsh/PartialsSpecgramGraphicsView.h @@ -7,7 +7,7 @@ #ifndef PARTIALSSPECTRUMGRAPHICSVIEW_H #define PARTIALSSPECTRUMGRAPHICSVIEW_H -#include +#include class ATSModelManager; class ColorMap; diff --git a/qatsh/PartialsSpecgramWidget.h b/qatsh/PartialsSpecgramWidget.h index fdf7c51..47a3687 100644 --- a/qatsh/PartialsSpecgramWidget.h +++ b/qatsh/PartialsSpecgramWidget.h @@ -9,7 +9,7 @@ #ifndef PartialsSpecgramWidget_h #define PartialsSpecgramWidget_h -#include +#include namespace Ui { class PartialsSpecgramWidget; diff --git a/qatsh/PreferencesDialog.cpp b/qatsh/PreferencesDialog.cpp index da8b6ac..62aa988 100644 --- a/qatsh/PreferencesDialog.cpp +++ b/qatsh/PreferencesDialog.cpp @@ -4,8 +4,8 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include -#include +#include +#include #include "PreferencesDialog.h" #include "ui_PreferencesDialog.h" diff --git a/qatsh/PreferencesDialog.h b/qatsh/PreferencesDialog.h index 6cc9aae..5d783ef 100644 --- a/qatsh/PreferencesDialog.h +++ b/qatsh/PreferencesDialog.h @@ -7,7 +7,7 @@ #ifndef PreferencesDialog_h #define PreferencesDialog_h -#include +#include namespace Ui { class PreferencesDialog; diff --git a/qatsh/ResidualsFrameTableView.cpp b/qatsh/ResidualsFrameTableView.cpp index aba24eb..6becd57 100644 --- a/qatsh/ResidualsFrameTableView.cpp +++ b/qatsh/ResidualsFrameTableView.cpp @@ -6,9 +6,9 @@ #include -#include -#include -#include +#include +#include +#include #include "ATSMath.h" #include "ATSModelManager.h" @@ -24,7 +24,11 @@ ResidualsFrameTableView::ResidualsFrameTableView(QWidget *parent) { _pui->setupUi(this); +#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0)) + _pui->qtvResiduals->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); +#else _pui->qtvResiduals->horizontalHeader()->setResizeMode(QHeaderView::Stretch); +#endif // Enable control value synchronization _bSynchronizeControls = true; diff --git a/qatsh/ResidualsFrameTableView.h b/qatsh/ResidualsFrameTableView.h index 6a0b3d9..7e06cc6 100644 --- a/qatsh/ResidualsFrameTableView.h +++ b/qatsh/ResidualsFrameTableView.h @@ -7,7 +7,7 @@ #ifndef ResidualsFrameTableView_h #define ResidualsFrameTableView_h -#include +#include namespace Ui { class ResidualsFrameTableView; diff --git a/qatsh/ResidualsSpecgramGraphicsScene.cpp b/qatsh/ResidualsSpecgramGraphicsScene.cpp index b669da6..1705f93 100644 --- a/qatsh/ResidualsSpecgramGraphicsScene.cpp +++ b/qatsh/ResidualsSpecgramGraphicsScene.cpp @@ -6,15 +6,15 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include "ATSMath.h" diff --git a/qatsh/ResidualsSpecgramGraphicsScene.h b/qatsh/ResidualsSpecgramGraphicsScene.h index f24813b..0605eb6 100644 --- a/qatsh/ResidualsSpecgramGraphicsScene.h +++ b/qatsh/ResidualsSpecgramGraphicsScene.h @@ -7,7 +7,7 @@ #ifndef RESIDUALSSPECTRUMGRAPHICSSCENE_H #define RESIDUALSSPECTRUMGRAPHICSSCENE_H -#include +#include #include "ColorMap.h" #include "RulerSpec.h" diff --git a/qatsh/ResidualsSpecgramGraphicsView.cpp b/qatsh/ResidualsSpecgramGraphicsView.cpp index 5dc66b1..2439416 100644 --- a/qatsh/ResidualsSpecgramGraphicsView.cpp +++ b/qatsh/ResidualsSpecgramGraphicsView.cpp @@ -4,11 +4,11 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // #ifndef QT_NO_OPENGL // # include diff --git a/qatsh/ResidualsSpecgramGraphicsView.h b/qatsh/ResidualsSpecgramGraphicsView.h index f579f1b..08f65de 100644 --- a/qatsh/ResidualsSpecgramGraphicsView.h +++ b/qatsh/ResidualsSpecgramGraphicsView.h @@ -7,7 +7,7 @@ #ifndef RESIDUALSSPECGRAMGRAPHICSVIEW_H #define RESIDUALSSPECGRAMGRAPHICSVIEW_H -#include +#include class ATSModelManager; class ColorMap; diff --git a/qatsh/ResidualsSpecgramWidget.h b/qatsh/ResidualsSpecgramWidget.h index 6f726c4..7f95936 100644 --- a/qatsh/ResidualsSpecgramWidget.h +++ b/qatsh/ResidualsSpecgramWidget.h @@ -9,7 +9,7 @@ #ifndef ResidualsSpecgramWidget_h #define ResidualsSpecgramWidget_h -#include +#include namespace Ui { class ResidualsSpecgramWidget; diff --git a/qatsh/Ruler.cpp b/qatsh/Ruler.cpp index c966a79..1481d22 100644 --- a/qatsh/Ruler.cpp +++ b/qatsh/Ruler.cpp @@ -6,11 +6,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "ATSMath.h" #include "Ruler.h" diff --git a/qatsh/Ruler.h b/qatsh/Ruler.h index ce86647..4f67edb 100644 --- a/qatsh/Ruler.h +++ b/qatsh/Ruler.h @@ -7,7 +7,7 @@ #ifndef RULER_H #define RULER_H -#include +#include class RulerSpec; diff --git a/qatsh/RulerSpec.h b/qatsh/RulerSpec.h index 2b67c4f..e568a5f 100644 --- a/qatsh/RulerSpec.h +++ b/qatsh/RulerSpec.h @@ -7,8 +7,8 @@ #ifndef RULERSPEC_H #define RULERSPEC_H -#include -#include +#include +#include class RulerSpec diff --git a/qatsh/SynthesisParamsWidget.cpp b/qatsh/SynthesisParamsWidget.cpp index 3237db3..24a0053 100644 --- a/qatsh/SynthesisParamsWidget.cpp +++ b/qatsh/SynthesisParamsWidget.cpp @@ -4,8 +4,8 @@ // // QATSH Copyright 2009 Jean-Philippe MEURET -#include -#include +#include +#include #include "SynthesisParamsWidget.h" #include "ui_SynthesisParamsWidget.h" @@ -75,7 +75,7 @@ void SynthesisParamsWidget::setMaxDuration(double dMaxDuration) void SynthesisParamsWidget::setupSynthesis() { if (!_pSynthesis) - _pSynthesis = new ATSSynthesis(); + _pSynthesis = new ATSSynthesis(); _pSynthesis->setStartTime(_pui->qsbStartTime->value()); _pSynthesis->setDuration(_pui->qsbDuration->value()); diff --git a/qatsh/SynthesisParamsWidget.h b/qatsh/SynthesisParamsWidget.h index 7f246d8..159000f 100644 --- a/qatsh/SynthesisParamsWidget.h +++ b/qatsh/SynthesisParamsWidget.h @@ -7,7 +7,7 @@ #ifndef SynthesisParamsWidget_h #define SynthesisParamsWidget_h -#include +#include namespace Ui { class SynthesisParamsWidget; diff --git a/qatsh/TableAndToolsWidget.cpp b/qatsh/TableAndToolsWidget.cpp index 05e4cf5..43d2e55 100644 --- a/qatsh/TableAndToolsWidget.cpp +++ b/qatsh/TableAndToolsWidget.cpp @@ -10,10 +10,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include "TableAndToolsWidget.h" #include "ui_TableAndToolsWidget.h" diff --git a/qatsh/TableAndToolsWidget.h b/qatsh/TableAndToolsWidget.h index 2cd50bc..7e95e8c 100644 --- a/qatsh/TableAndToolsWidget.h +++ b/qatsh/TableAndToolsWidget.h @@ -11,7 +11,7 @@ #ifndef TableAndToolsWidget_h #define TableAndToolsWidget_h -#include +#include #include "TypesAndConstants.h"