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
This commit is contained in:
pouillot 2013-04-20 16:33:09 +00:00 committed by Xavier Del Campo Romero
parent ee33e7e02a
commit 613c44ef3f
Signed by: xavi
GPG Key ID: 84FF3612A9BF43F2
64 changed files with 308 additions and 226 deletions

View File

@ -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)

View File

@ -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\<Qt version>\bin;" at the beginning of the current value
(<Qt version> 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.

View File

@ -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,12 +95,30 @@ MACRO(INSTALL_3RDPARTY_RUNTIME)
SET(_QT_DBG_SFX "d")
ENDIF()
IF(OPTION_QT5)
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)
LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}")
@ -119,7 +137,28 @@ MACRO(INSTALL_3RDPARTY_RUNTIME)
ELSEIF(MINGW)
# Works with MinGW 4.4 and 4.7.
IF(OPTION_QT5)
# 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}")
@ -129,6 +168,8 @@ MACRO(INSTALL_3RDPARTY_RUNTIME)
MESSAGE(STATUS "Will install compiler run-time ${_DLL_PATHNAME}")
LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}")
ENDIF()
ENDIF(MSVC)
INSTALL(FILES ${_THIRDPARTY_DLL_PATHNAMES} DESTINATION bin)

View File

@ -7,7 +7,7 @@
#include <iostream>
#include <QtCore/QModelIndex>
#include <QModelIndex>
#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 ====================================================

View File

@ -8,8 +8,8 @@
#ifndef ATSDATAPROXYMODEL_H
#define ATSDATAPROXYMODEL_H
#include <QtGui/QAbstractProxyModel>
#include <QtCore/QModelIndex>
#include <QAbstractProxyModel>
#include <QModelIndex>
class ATSDataProxyModel : public QAbstractProxyModel

View File

@ -7,7 +7,7 @@
#include <iostream>
#include <QtCore/QModelIndex>
#include <QModelIndex>
#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 ====================================================

View File

@ -8,8 +8,8 @@
#ifndef ATSFRAMEDATAPROXYMODEL_H
#define ATSFRAMEDATAPROXYMODEL_H
#include <QtGui/QAbstractProxyModel>
#include <QtCore/QModelIndex>
#include <QAbstractProxyModel>
#include <QModelIndex>
class ATSFrameProxyModel : public QAbstractProxyModel

View File

@ -6,7 +6,7 @@
#include <iostream>
#include <QtCore/QModelIndex>
#include <QModelIndex>
#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;

View File

@ -7,7 +7,7 @@
#ifndef ATSMODEL_H
#define ATSMODEL_H
#include <QtCore/QAbstractItemModel>
#include <QAbstractItemModel>
class ATSRootItem;
class ATSSound;

View File

@ -11,7 +11,7 @@
#ifndef ATSMODELITEMS_H
#define ATSMODELITEMS_H
#include <QtCore/QVariant>
#include <QVariant>
#include "ATSSound.h"

View File

@ -5,7 +5,7 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtGui/QItemSelectionModel>
#include <QItemSelectionModel>
#include "ATSModelManager.h"

View File

@ -7,7 +7,7 @@
#include <iostream>
#include <QtGui/QItemSelection>
#include <QItemSelection>
#include "ATSModelItems.h"
#include "ATSPartialsProxyModel.h"

View File

@ -7,7 +7,7 @@
#ifndef ATSPARTIALSFRAMEPROXYMODEL_H
#define ATSPARTIALSFRAMEPROXYMODEL_H
#include <QtCore/QModelIndex>
#include <QModelIndex>
#include "ATSFrameProxyModel.h"

View File

@ -8,7 +8,7 @@
#include <iostream>
#include <QtGui/QItemSelection>
#include <QItemSelection>
#include "TypesAndConstants.h"
#include "ATSModel.h"
@ -205,11 +205,12 @@ void ATSPartialsProxyModel::addPartial(const QModelIndex& qmiToCopy)
ATSModel* pSourceModel = static_cast<ATSModel*>(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,7 +241,8 @@ 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,
@ -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;
}

View File

@ -8,8 +8,8 @@
#ifndef ATSPPROPERTIESPROXYMODEL_H
#define ATSPPROPERTIESPROXYMODEL_H
#include <QtCore/QModelIndex>
#include <QtGui/QAbstractProxyModel>
#include <QModelIndex>
#include <QAbstractProxyModel>
class ATSPropertiesProxyModel : public QAbstractProxyModel

View File

@ -8,7 +8,7 @@
#ifndef ATSRESIDUALSFRAMEPROXYMODEL_H
#define ATSRESIDUALSFRAMEPROXYMODEL_H
#include <QtCore/QModelIndex>
#include <QModelIndex>
#include "ATSFrameProxyModel.h"

View File

@ -7,7 +7,7 @@
#ifndef ATSRESIDUALSPROXYMODEL_H
#define ATSRESIDUALSPROXYMODEL_H
#include <QtCore/QModelIndex>
#include <QModelIndex>
#include "ATSDataProxyModel.h"

View File

@ -4,8 +4,8 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtGui/QPushButton>
#include <QtGui/QDoubleValidator>
#include <QPushButton>
#include <QDoubleValidator>
#include "AnalysisParamsDialog.h"
#include "ui_AnalysisParamsDialog.h"

View File

@ -7,7 +7,7 @@
#ifndef AnalysisParamsDialog_h
#define AnalysisParamsDialog_h
#include <QtGui/QDialog>
#include <QDialog>
namespace Ui {
class AnalysisParamsDialog;

View File

@ -4,8 +4,8 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtGui/QPushButton>
#include <QtGui/QDoubleValidator>
#include <QPushButton>
#include <QDoubleValidator>
#include "AnalysisParamsWidget.h"
#include "ui_AnalysisParamsWidget.h"

View File

@ -7,7 +7,7 @@
#ifndef AnalysisParamsWidget_h
#define AnalysisParamsWidget_h
#include <QtGui/QWidget>
#include <QWidget>
namespace Ui {
class AnalysisParamsWidget;

View File

@ -6,10 +6,33 @@
message(STATUS "Configuring qatsh ...")
# External dependencies.
# 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
if(OPTION_QT5)
qt5_wrap_cpp(_MOC_SRCS ${_MOC_HDRS})
else()
qt4_wrap_cpp(_MOC_SRCS ${_MOC_HDRS})
endif()
# Run uic on .ui files.
if(OPTION_QT5)
qt5_wrap_ui(_UI_HDRS ${_UIS})
else()
qt4_wrap_ui(_UI_HDRS ${_UIS})
endif()
# Generate code for resources.
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.

View File

@ -7,8 +7,8 @@
#ifndef COLORMAP_H
#define COLORMAP_H
#include <QtCore/QList>
#include <QtGui/QColor>
#include <QList>
#include <QColor>
class ColorMap

View File

@ -4,8 +4,8 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtGui/QResizeEvent>
#include <QtGui/QGraphicsSimpleTextItem>
#include <QResizeEvent>
#include <QGraphicsSimpleTextItem>
#include <iostream>
@ -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)
@ -90,12 +88,8 @@ void ColorScale::redraw()
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,25 +124,13 @@ 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="

View File

@ -7,7 +7,7 @@
#ifndef COLORSCALE_H
#define COLORSCALE_H
#include <QtGui/QGraphicsView>
#include <QGraphicsView>
class QGraphicsSimpleTextItem;
class ColorMap;

View File

@ -7,7 +7,7 @@
#ifndef DataSelectionWidget_h
#define DataSelectionWidget_h
#include <QtGui/QWidget>
#include <QWidget>
#include "TypesAndConstants.h"

View File

@ -12,17 +12,17 @@
#include <iostream>
#include <vector>
#include <QtCore/QSettings>
#include <QSettings>
#include <QtGui/QItemSelection>
#include <QtGui/QItemSelectionModel>
#include <QtGui/QMessageBox>
#include <QItemSelection>
#include <QItemSelectionModel>
#include <QMessageBox>
#ifdef PHONON_AUDIO
#include <Phonon/MediaObject>
#include <Phonon/MediaSource>
#else
#include <QtCore/QProcess>
#include <QProcess>
#endif
#include "TypesAndConstants.h"
@ -276,7 +276,7 @@ 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;

View File

@ -14,8 +14,8 @@
#include <vector>
#include <QtCore/QString>
#include <QtGui/QWidget>
#include <QString>
#include <QWidget>
#include "SampledSound.h"

View File

@ -4,7 +4,7 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtCore/QModelIndex>
#include <QModelIndex>
#include "ATSModelItems.h"
#include "ATSPropertiesProxyModel.h"

View File

@ -7,7 +7,7 @@
#ifndef FilePropertiesDialog_h
#define FilePropertiesDialog_h
#include <QtGui/QDialog>
#include <QDialog>
class QModelIndex;

View File

@ -8,7 +8,7 @@
#include "ui_FilePropertiesView.h"
#include <QtCore/QModelIndex>
#include <QModelIndex>
#include "ATSModelItems.h"
#include "ATSModel.h"

View File

@ -7,7 +7,7 @@
#ifndef FilePropertiesView_h
#define FilePropertiesView_h
#include <QtGui/QWidget>
#include <QWidget>
class QModelIndex;

View File

@ -6,11 +6,11 @@
#include <iostream>
#include <QtCore/QSettings>
#include <QtGui/QApplication>
#include <QtGui/QMessageBox>
#include <QtGui/QItemSelection>
#include <QtGui/QItemSelectionModel>
#include <QSettings>
#include <QApplication>
#include <QMessageBox>
#include <QItemSelection>
#include <QItemSelectionModel>
#include "FrameAndDataEditionWidget.h"
#include "ui_FrameAndDataEditionWidget.h"

View File

@ -7,7 +7,7 @@
#ifndef FrameAndDataEditionWidget_h
#define FrameAndDataEditionWidget_h
#include <QtGui/QWidget>
#include <QWidget>
#include "TypesAndConstants.h"

View File

@ -7,7 +7,7 @@
#ifndef FrameSelectionWidget_h
#define FrameSelectionWidget_h
#include <QtGui/QWidget>
#include <QWidget>
#include "TypesAndConstants.h"

View File

@ -7,7 +7,7 @@
#ifndef IATSANALYSIS_H
#define IATSANALYSIS_H
#include <QtCore/QString>
#include <QString>
class SampledSound;
class ATSSound;

View File

@ -9,7 +9,7 @@
// Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtGui/QApplication>
#include <QApplication>
#include "MainWindow.h"
#include "PreferencesDialog.h"

View File

@ -4,14 +4,14 @@
#include <iostream>
#include <QtCore/QSettings>
#include <QtCore/QFileInfo>
#include <QtCore/QModelIndex>
#include <QSettings>
#include <QFileInfo>
#include <QModelIndex>
#include <QtGui/QCloseEvent>
#include <QtGui/QVBoxLayout>
#include <QtGui/QMessageBox>
#include <QtGui/QFileDialog>
#include <QCloseEvent>
#include <QVBoxLayout>
#include <QMessageBox>
#include <QFileDialog>
#include "IATSAnalysis.h"
#include "DocumentWindow.h"

View File

@ -5,8 +5,8 @@
#ifndef MainWindow_h
#define MainWindow_h
#include <QtCore/QString>
#include <QtGui/QMainWindow>
#include <QString>
#include <QMainWindow>
#include "DocumentWindow.h"

View File

@ -7,9 +7,9 @@
#include <iostream>
#include "ATSMath.h"
#include <QtGui/QHeaderView>
#include <QtGui/QItemSelection>
#include <QtGui/QItemSelectionModel>
#include <QHeaderView>
#include <QItemSelection>
#include <QItemSelectionModel>
#include "ATSModelItems.h"
#include "ATSModelManager.h"
@ -26,8 +26,11 @@ 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();

View File

@ -7,7 +7,7 @@
#ifndef PartialsFrameTableView_h
#define PartialsFrameTableView_h
#include <QtGui/QFrame>
#include <QFrame>
namespace Ui {
class PartialsFrameTableView;

View File

@ -6,9 +6,9 @@
#include <iostream>
#include <QtGui/QItemSelectionModel>
#include <QtGui/QPen>
#include <QtGui/QGraphicsSceneHoverEvent>
#include <QItemSelectionModel>
#include <QPen>
#include <QGraphicsSceneHoverEvent>
#include "ColorMap.h"
#include "PartialsSpecgramGraphicsScene.h"

View File

@ -7,7 +7,7 @@
#ifndef PartialsSpecgramGraphicsFrameItem_H
#define PartialsSpecgramGraphicsFrameItem_H
#include <QtGui/QGraphicsLineItem>
#include <QGraphicsLineItem>
class ColorMap;
class QGraphicsSceneHoverEvent;

View File

@ -7,15 +7,15 @@
#include <limits>
#include <iostream>
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QtCore/QRectF>
#include <QtCore/QModelIndex>
#include <QObject>
#include <QList>
#include <QRectF>
#include <QModelIndex>
#include <QtGui/QPen>
#include <QtGui/QGraphicsView>
#include <QtGui/QGraphicsItemGroup>
#include <QtGui/QItemSelection>
#include <QPen>
#include <QGraphicsView>
#include <QGraphicsItemGroup>
#include <QItemSelection>
#include "ATSMath.h"

View File

@ -7,9 +7,9 @@
#ifndef PartialsSpecgramGraphicsScene_H
#define PartialsSpecgramGraphicsScene_H
#include <QtCore/QVector>
#include <QtGui/QItemSelectionModel>
#include <QtGui/QGraphicsScene>
#include <QVector>
#include <QItemSelectionModel>
#include <QGraphicsScene>
#include "ColorMap.h"
#include "RulerSpec.h"

View File

@ -4,11 +4,11 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtCore/QRectF>
#include <QtGui/QBrush>
#include <QtGui/QResizeEvent>
#include <QtGui/QWheelEvent>
#include <QtGui/QKeyEvent>
#include <QRectF>
#include <QBrush>
#include <QResizeEvent>
#include <QWheelEvent>
#include <QKeyEvent>
// #ifndef QT_NO_OPENGL
// # include <QtOpenGL/QGLWidget>
@ -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();

View File

@ -7,7 +7,7 @@
#ifndef PARTIALSSPECTRUMGRAPHICSVIEW_H
#define PARTIALSSPECTRUMGRAPHICSVIEW_H
#include <QtGui/QGraphicsView>
#include <QGraphicsView>
class ATSModelManager;
class ColorMap;

View File

@ -9,7 +9,7 @@
#ifndef PartialsSpecgramWidget_h
#define PartialsSpecgramWidget_h
#include <QtGui/QWidget>
#include <QWidget>
namespace Ui {
class PartialsSpecgramWidget;

View File

@ -4,8 +4,8 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtCore/QSettings>
#include <QtGui/QPushButton>
#include <QSettings>
#include <QPushButton>
#include "PreferencesDialog.h"
#include "ui_PreferencesDialog.h"

View File

@ -7,7 +7,7 @@
#ifndef PreferencesDialog_h
#define PreferencesDialog_h
#include <QtGui/QDialog>
#include <QDialog>
namespace Ui {
class PreferencesDialog;

View File

@ -6,9 +6,9 @@
#include <iostream>
#include <QtGui/QHeaderView>
#include <QtGui/QItemSelection>
#include <QtGui/QItemSelectionModel>
#include <QHeaderView>
#include <QItemSelection>
#include <QItemSelectionModel>
#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;

View File

@ -7,7 +7,7 @@
#ifndef ResidualsFrameTableView_h
#define ResidualsFrameTableView_h
#include <QtGui/QFrame>
#include <QFrame>
namespace Ui {
class ResidualsFrameTableView;

View File

@ -6,15 +6,15 @@
#include <iostream>
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QtCore/QRectF>
#include <QtCore/QModelIndex>
#include <QObject>
#include <QList>
#include <QRectF>
#include <QModelIndex>
#include <QtGui/QPen>
#include <QtGui/QGraphicsView>
#include <QtGui/QGraphicsRectItem>
#include <QtGui/QGraphicsItemGroup>
#include <QPen>
#include <QGraphicsView>
#include <QGraphicsRectItem>
#include <QGraphicsItemGroup>
#include "ATSMath.h"

View File

@ -7,7 +7,7 @@
#ifndef RESIDUALSSPECTRUMGRAPHICSSCENE_H
#define RESIDUALSSPECTRUMGRAPHICSSCENE_H
#include <QtGui/QGraphicsScene>
#include <QGraphicsScene>
#include "ColorMap.h"
#include "RulerSpec.h"

View File

@ -4,11 +4,11 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtCore/QRectF>
#include <QtGui/QBrush>
#include <QtGui/QResizeEvent>
#include <QtGui/QWheelEvent>
#include <QtGui/QKeyEvent>
#include <QRectF>
#include <QBrush>
#include <QResizeEvent>
#include <QWheelEvent>
#include <QKeyEvent>
// #ifndef QT_NO_OPENGL
// # include <QtOpenGL/QGLWidget>

View File

@ -7,7 +7,7 @@
#ifndef RESIDUALSSPECGRAMGRAPHICSVIEW_H
#define RESIDUALSSPECGRAMGRAPHICSVIEW_H
#include <QtGui/QGraphicsView>
#include <QGraphicsView>
class ATSModelManager;
class ColorMap;

View File

@ -9,7 +9,7 @@
#ifndef ResidualsSpecgramWidget_h
#define ResidualsSpecgramWidget_h
#include <QtGui/QWidget>
#include <QWidget>
namespace Ui {
class ResidualsSpecgramWidget;

View File

@ -6,11 +6,11 @@
#include <iostream>
#include <QtGui/QPainter>
#include <QtGui/QPalette>
#include <QtGui/QFontMetrics>
#include <QtGui/QResizeEvent>
#include <QtGui/QWheelEvent>
#include <QPainter>
#include <QPalette>
#include <QFontMetrics>
#include <QResizeEvent>
#include <QWheelEvent>
#include "ATSMath.h"
#include "Ruler.h"

View File

@ -7,7 +7,7 @@
#ifndef RULER_H
#define RULER_H
#include <QtGui/QWidget>
#include <QWidget>
class RulerSpec;

View File

@ -7,8 +7,8 @@
#ifndef RULERSPEC_H
#define RULERSPEC_H
#include <QtCore/Qt>
#include <QtCore/QList>
#include <Qt>
#include <QList>
class RulerSpec

View File

@ -4,8 +4,8 @@
//
// QATSH Copyright 2009 Jean-Philippe MEURET <jpmeuret@free.fr>
#include <QtGui/QPushButton>
#include <QtGui/QDoubleValidator>
#include <QPushButton>
#include <QDoubleValidator>
#include "SynthesisParamsWidget.h"
#include "ui_SynthesisParamsWidget.h"

View File

@ -7,7 +7,7 @@
#ifndef SynthesisParamsWidget_h
#define SynthesisParamsWidget_h
#include <QtGui/QWidget>
#include <QWidget>
namespace Ui {
class SynthesisParamsWidget;

View File

@ -10,10 +10,10 @@
#include <iostream>
#include <QtCore/QDir>
#include <QtGui/QHeaderView>
#include <QtGui/QPushButton>
#include <QtGui/QFileDialog>
#include <QDir>
#include <QHeaderView>
#include <QPushButton>
#include <QFileDialog>
#include "TableAndToolsWidget.h"
#include "ui_TableAndToolsWidget.h"

View File

@ -11,7 +11,7 @@
#ifndef TableAndToolsWidget_h
#define TableAndToolsWidget_h
#include <QtGui/QWidget>
#include <QWidget>
#include "TypesAndConstants.h"