Commit 57fe2fdd authored by Antoine Regimbeau's avatar Antoine Regimbeau

MRG: Merge branch 'qt4to5' into develop

parents 51ee2477 b54cdbe5
......@@ -20,7 +20,7 @@
#
# Reset Qt I18N source files cache variable.
macro( reset_qt4_i18n_sources )
macro( reset_qt_i18n_sources )
set( OTB_QT_I18N_INCLUDE_PATH "" CACHE INTERNAL "" FORCE )
set( OTB_QT_I18N_HEADER_FILES "" CACHE INTERNAL "" FORCE )
set( OTB_QT_I18N_SOURCE_FILES "" CACHE INTERNAL "" FORCE )
......@@ -33,7 +33,7 @@ endmacro()
#
# Func
function( add_to_qt4_i18n_files RESULT )
function( add_to_qt_i18n_files RESULT )
foreach( F ${ARGN} )
#message( "${F}" )
......@@ -45,13 +45,13 @@ endfunction()
#
#
macro( add_to_qt4_i18n_include_path DIRECTORY )
macro( add_to_qt_i18n_include_path DIRECTORY )
set(OTB_I18N_INCLUDE_PATH ${OTB_I18N_INCLUDE_PATH} ${DIRECTORY} CACHE INTERNAL "")
endmacro()
#
#
macro( add_to_qt4_i18n_headers INCLUDE_DIR )
macro( add_to_qt_i18n_headers INCLUDE_DIR )
get_filename_component( ABS_INCLUDE_DIR ${INCLUDE_DIR} ABSOLUTE )
......@@ -68,20 +68,20 @@ endmacro()
#
# Add source files to Qt I18n translation build.
macro( add_to_qt4_i18n_sources )
add_to_qt4_i18n_files( OTB_QT_I18N_SOURCE_FILES ${ARGN} )
macro( add_to_qt_i18n_sources )
add_to_qt_i18n_files( OTB_QT_I18N_SOURCE_FILES ${ARGN} )
endmacro()
#
# Add source files to Qt I18n translation build.
macro( add_to_qt4_i18n_forms )
add_to_qt4_i18n_files( OTB_QT_I18N_FORM_FILES ${ARGN} )
macro( add_to_qt_i18n_forms )
add_to_qt_i18n_files( OTB_QT_I18N_FORM_FILES ${ARGN} )
endmacro()
#
#
macro( generate_qt4_project FILENAME )
message( STATUS "Generating Qt4 '${FILENAME}' project file for I18N." )
macro( generate_qt_project FILENAME )
message( STATUS "Generating Qt5 '${FILENAME}' project file for I18N." )
unset(_OTB_QT_I18N_INCLUDE_PATH_PRO)
unset(_OTB_QT_I18N_HEADER_PRO)
......
......@@ -100,9 +100,9 @@ include(PreventInBuildInstalls)
include(OTBModuleMacros)
include(OTBModuleRemote)
include(OTBModuleTest)
include( i18n_qt4 )
include( i18n_qt )
reset_qt4_i18n_sources()
reset_qt_i18n_sources()
repository_status(${PROJECT_SOURCE_DIR} OTB_GIT_STATUS_MESSAGE)
......@@ -531,7 +531,7 @@ endforeach()
# message("OTB_MODULES_ENABLED = ${modules_list_for_summary}")
# unset(modules_list_for_summary)
list(REMOVE_ITEM option_list "OTB_USE_6S" "OTB_USE_SIFTFAST" "OTB_USE_QT4")
list(REMOVE_ITEM option_list "OTB_USE_6S" "OTB_USE_SIFTFAST" "OTB_USE_QT")
foreach(item ${option_list})
if(NOT ${item})
list(REMOVE_ITEM option_list "${item}" )
......@@ -550,7 +550,7 @@ list(APPEND option_list TINYXML)
#Q: Why these two guys here? we already have option_list
#A: Because cmake case sensitivity with variables.
if(OTB_USE_QT4)
if(OTB_USE_QT)
list(APPEND option_list QT)
endif()
#sort again!
......
......@@ -118,7 +118,7 @@ GetExistingDirectory( QWidget * p = 0,
*/
QString
OTBQtAdapters_EXPORT
GetOpenFileName( QWidget * p =0,
GetOpenFilename( QWidget * p =0,
const QString & caption = QString(),
const QString & dir = QString(),
const QString & filter = QString(),
......@@ -145,7 +145,7 @@ GetOpenFileName( QWidget * p =0,
*/
QStringList
OTBQtAdapters_EXPORT
GetOpenFileNames( QWidget * p =0,
GetOpenFilenames( QWidget * p =0,
const QString & caption = QString(),
const QString & dir = QString(),
const QString & filter = QString(),
......@@ -172,7 +172,7 @@ GetOpenFileNames( QWidget * p =0,
*/
QString
OTBQtAdapters_EXPORT
GetSaveFileName( QWidget * p =0,
GetSaveFilename( QWidget * p =0,
const QString & caption = QString(),
const QString & dir = QString(),
const QString & filter = QString(),
......
......@@ -22,6 +22,6 @@ set( DOCUMENTATION "Adapters for the Qt Library.")
otb_module( OTBQtAdapters
ENABLE_SHARED
DEPENDS OTBQt4
DEPENDS OTBQt
DESCRIPTION "${DOCUMENTATION}"
)
......@@ -26,15 +26,15 @@ set( OTBQtAdapters_HEADERS_MOC
# otbQtAdapters.h
)
add_to_qt4_i18n_sources( ${OTBQtAdapters_SRCS} )
add_to_qt4_i18n_headers( "../include" ${OTBQtAdapters_SRCS} )
add_to_qt_i18n_sources( ${OTBQtAdapters_SRCS} )
add_to_qt_i18n_headers( "../include" ${OTBQtAdapters_SRCS} )
qt4_wrap_cpp( OTBQtAdapters_SRC_MOC ${OTBQtAdapters_HEADERS_MOC} )
qt5_wrap_cpp( OTBQtAdapters_SRC_MOC ${OTBQtAdapters_HEADERS_MOC} )
add_library( OTBQtAdapters ${OTBQtAdapters_SRC} ${OTBQtAdapters_SRC_MOC})
target_link_libraries( OTBQtAdapters
${OTBQt4_LIBRARIES}
${OTBQt_LIBRARIES}
)
otb_module_target( OTBQtAdapters )
......@@ -95,7 +95,7 @@ GetExistingDirectory( QWidget * p,
/*****************************************************************************/
QString
GetOpenFileName( QWidget * p,
GetOpenFilename( QWidget * p,
const QString& caption,
const QString& dir,
const QString& filter,
......@@ -129,7 +129,7 @@ GetOpenFileName( QWidget * p,
/*****************************************************************************/
QStringList
GetOpenFileNames( QWidget * p,
GetOpenFilenames( QWidget * p,
const QString & caption,
const QString & dir,
const QString & filter,
......@@ -163,7 +163,7 @@ GetOpenFileNames( QWidget * p,
/*****************************************************************************/
QString
GetSaveFileName( QWidget * p,
GetSaveFilename( QWidget * p,
const QString & caption,
const QString & dir,
const QString & filter,
......
......@@ -18,10 +18,17 @@
# limitations under the License.
#
project( OTBQt4 )
project( OTBQt )
set( OTBQt4_SYSTEM_INCLUDE_DIRS ${QT_INCLUDE_DIRS} )
set( OTBQt4_LIBRARIES "${QT_LIBRARIES}" )
set( QT_VERSION "${QTVERSION}" CACHE INTERNAL "" FORCE )
set( OTBQt_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5OpenGL_LIBRARIES})
set( OTBQt_SYSTEM_INCLUDE_DIRS ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} )
set( OTBQt_EXPORT_CODE_BUILD
"find_package(Qt5Core REQUIRED HINTS ${Qt5Core_DIR})
find_package(Qt5Gui REQUIRED HINTS ${Qt5Gui_DIR})
find_package(Qt5Widgets REQUIRED HINTS ${Qt5Widgets_DIR})
find_package(Qt5OpenGL REQUIRED HINTS ${Qt5OpenGL_DIR})
find_package(Qt5LinguistTools HINTS ${Qt5LinguistTools_DIR})
")
set( OTBQt_EXPORT_CODE_INSTALL ${OTBQt_EXPORT_CODE_BUILD})
otb_module_impl()
......@@ -18,7 +18,9 @@
# limitations under the License.
#
find_package( Qt4 REQUIRED QtCore QtGui QtOpenGL) # QtXml )
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5LinguistTools)
mark_as_advanced( QT_QMAKE_EXECUTABLE )
#set( QT_USE_QTXML 1 )
include( ${QT_USE_FILE} )
......@@ -18,9 +18,9 @@
# limitations under the License.
#
set(DOCUMENTATION "This module imports Qt4 to the build system")
set(DOCUMENTATION "This module imports Qt5 to the build system")
otb_module(OTBQt4
otb_module(OTBQt
DEPENDS
TEST_DEPENDS
......@@ -29,4 +29,4 @@ otb_module(OTBQt4
"${DOCUMENTATION}"
)
otb_module_activation_option("Enable Qt4 dependent modules" OFF)
otb_module_activation_option("Enable Qt5 dependent modules" OFF)
......@@ -22,7 +22,7 @@ set(DOCUMENTATION "This module imports Qwt to the build system")
otb_module(OTBQwt
DEPENDS
OTBQt4
OTBQt
TEST_DEPENDS
......
......@@ -190,7 +190,7 @@ private:
*/
Ui::MaplaMainWindow* m_UI;
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
/**
* \brief OTB-applications tool-box controller.
*/
......
......@@ -27,7 +27,7 @@ otb_module( OTBMapla
DEPENDS
OTBMonteverdiCore
OTBMonteverdiGUI
OTBQt4
OTBQt
OPTIONAL_DEPENDS
......
......@@ -61,14 +61,14 @@ if (WIN32)
endif()
#############################################################################
qt4_wrap_cpp( OTBMapla_SRC_MOC ${OTBMapla_HEADERS_MOC} )
qt4_wrap_ui( OTBMapla_FORMS_HEADERS ${OTBMapla_FORMS} )
qt4_add_resources( OTBMapla_RESOURCES_RCC ${OTBMapla_RESOURCES} OPTIONS "-no-compress")
qt5_wrap_cpp( OTBMapla_SRC_MOC ${OTBMapla_HEADERS_MOC} )
qt5_wrap_ui( OTBMapla_FORMS_HEADERS ${OTBMapla_FORMS} )
qt5_add_resources( OTBMapla_RESOURCES_RCC ${OTBMapla_RESOURCES} OPTIONS "-no-compress")
#############################################################################
add_to_qt4_i18n_sources( ${OTBMapla_SRCS} )
add_to_qt4_i18n_headers( "../include" ${OTBMapla_SRCS} )
add_to_qt4_i18n_forms( ${OTBMapla_FORMS} )
add_to_qt_i18n_sources( ${OTBMapla_SRCS} )
add_to_qt_i18n_headers( "../include" ${OTBMapla_SRCS} )
add_to_qt_i18n_forms( ${OTBMapla_FORMS} )
##########################[Mapla library]####################################
add_library( OTBMapla
......@@ -79,7 +79,7 @@ add_library( OTBMapla
target_link_libraries( OTBMapla
${OTBMonteverdiCore_LIBRARIES}
${OTBMonteverdiGUI_LIBRARIES}
${OTBQt4_LIBRARIES}
${OTBQt_LIBRARIES}
)
otb_module_target( OTBMapla )
......
......@@ -39,7 +39,7 @@
// Monteverdi includes (sorted by alphabetic order)
//
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
#include "mvdOTBApplicationsModel.h"
#endif
......
......@@ -29,7 +29,7 @@
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtGui>
#include <QtWidgets>
//
// System includes (sorted by alphabetic order)
......@@ -42,7 +42,7 @@
//
// Monteverdi includes (sorted by alphabetic order)
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
# include "mvdApplicationLauncher.h"
# include "mvdApplicationsToolBoxController.h"
# include "mvdOTBApplicationsModel.h"
......@@ -86,7 +86,7 @@ MaplaMainWindow
::MaplaMainWindow( QWidget * p, Qt::WindowFlags flags ) :
I18nMainWindow( p, flags ),
m_UI( new mvd::Ui::MaplaMainWindow() )
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
,
m_ApplicationsToolBoxController( NULL )
#endif
......@@ -110,7 +110,7 @@ MaplaMainWindow
setObjectName( "Mapla" );
setWindowTitle( PROJECT_NAME " Application Launcher" );
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
assert( m_ApplicationsToolBoxController==NULL );
......@@ -124,16 +124,16 @@ MaplaMainWindow
setCentralWidget( m_ApplicationsToolBoxController->GetWidget() );
#else // OTB_USE_QT4
#else // OTB_USE_QT
setCentralWidget(
new QLabel(
tr( "Enable OTB_USE_QT4 preprocessor definition at compile time!" ),
tr( "Enable OTB_USE_QT preprocessor definition at compile time!" ),
this
)
);
#endif // OTB_USE_QT4
#endif // OTB_USE_QT
if( !RestoreLayout( Monteverdi_UI_VERSION ) )
{
......@@ -148,7 +148,7 @@ MaplaMainWindow
{
//
// OTB application support.
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
QObject::connect(
m_ApplicationsToolBoxController->GetWidget(),
......@@ -217,7 +217,7 @@ MaplaMainWindow
::OnApplicationToLaunchSelected( const QString & appName,
const QString & )
{
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
assert( MaplaApplication::ConstInstance()!=NULL );
assert( MaplaApplication::ConstInstance()->GetModel()!=NULL );
......@@ -241,7 +241,7 @@ MaplaMainWindow
appWindow->show();
#endif // OTB_USE_QT4
#endif // OTB_USE_QT
}
/*****************************************************************************/
......
......@@ -221,9 +221,9 @@ protected slots:
/**
*/
#if defined( OTB_USE_QT4 ) && USE_OTB_APPS
#if defined( OTB_USE_QT ) && USE_OTB_APPS
void OnApplicationToLaunchSelected( const QString & appName, const QString & docName );
#endif // defined( OTB_USE_QT4 ) && USE_OTB_APPS
#endif // defined( OTB_USE_QT ) && USE_OTB_APPS
/**
*/
......@@ -396,7 +396,7 @@ private:
QDockWidget* m_HistogramDock;
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
/**
* \brief OTB-applications browser dock-widget.
*/
......
......@@ -33,7 +33,7 @@
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtGui>
#include <QtWidgets>
//
// System includes (sorted by alphabetic order)
......
......@@ -27,7 +27,7 @@ otb_module( OTBMonteverdi
DEPENDS
OTBMonteverdiCore
OTBMonteverdiGUI
OTBQt4
OTBQt
OTBQtAdapters
OPTIONAL_DEPENDS
......
......@@ -44,14 +44,14 @@ set( OTBMonteverdi_RESOURCES
)
#############################################################################
qt4_wrap_cpp( OTBMonteverdi_SRC_MOC ${OTBMonteverdi_HEADERS_MOC} )
qt4_wrap_ui( OTBMonteverdi_FORMS_HEADERS ${OTBMonteverdi_FORMS} )
qt4_add_resources( OTBMonteverdi_RESOURCES_RCC ${OTBMonteverdi_RESOURCES} OPTIONS "-no-compress")
qt5_wrap_cpp( OTBMonteverdi_SRC_MOC ${OTBMonteverdi_HEADERS_MOC} )
qt5_wrap_ui( OTBMonteverdi_FORMS_HEADERS ${OTBMonteverdi_FORMS} )
qt5_add_resources( OTBMonteverdi_RESOURCES_RCC ${OTBMonteverdi_RESOURCES} OPTIONS "-no-compress")
#############################################################################
add_to_qt4_i18n_sources( ${OTBMonteverdi_SRCS} )
add_to_qt4_i18n_headers( "../include" ${OTBMonteverdi_SRCS} )
add_to_qt4_i18n_forms( ${OTBMonteverdi_FORMS} )
add_to_qt_i18n_sources( ${OTBMonteverdi_SRCS} )
add_to_qt_i18n_headers( "../include" ${OTBMonteverdi_SRCS} )
add_to_qt_i18n_forms( ${OTBMonteverdi_FORMS} )
#############################################################################
add_library( OTBMonteverdi
......@@ -62,7 +62,7 @@ add_library( OTBMonteverdi
target_link_libraries( OTBMonteverdi
${OTBMonteverdiCore_LIBRARIES}
${OTBMonteverdiGUI_LIBRARIES}
${OTBQt4_LIBRARIES}
${OTBQt_LIBRARIES}
${OTBQtAdapters_LIBRARIES}
)
otb_module_target( OTBMonteverdi )
......
......@@ -40,7 +40,7 @@
#include "mvdStackedLayerModel.h"
//
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
# include "mvdOTBApplicationsModel.h"
#endif
......@@ -121,7 +121,7 @@ void
Application
::OpenApplicationsBrowser()
{
#ifdef OTB_USE_QT4
#ifdef OTB_USE_QT
m_OTBApplicationsModel = new OTBApplicationsModel( this );
m_OTBApplicationsModel->BuildModel();
......
......@@ -30,7 +30,7 @@
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtGui>
#include <QtWidgets>
//
// System includes (sorted by alphabetic order)
......@@ -44,7 +44,7 @@
//
// Monteverdi includes (sorted by alphabetic order)
#if defined( OTB_USE_QT4 ) && USE_OTB_APPS
#if defined( OTB_USE_QT ) && USE_OTB_APPS
# include "mvdApplicationLauncher.h"
# include "mvdApplicationsToolBoxController.h"
# include "mvdOTBApplicationsModel.h"
......@@ -132,7 +132,7 @@ MainWindow
m_PixelDescriptionDock(NULL),
#endif // USE_PIXEL_DESCRIPTION
m_HistogramDock( NULL ),
#if defined( OTB_USE_QT4 ) && USE_OTB_APPS
#if defined( OTB_USE_QT ) && USE_OTB_APPS
m_OtbApplicationsBrowserDock(NULL),
#endif
m_ImageView( NULL ),
......@@ -1811,7 +1811,7 @@ MainWindow
// Select filename.
QString caption(tr("Open file..."));
ImportImages(
otb::GetOpenFileNames( this, caption ),
otb::GetOpenFilenames( this, caption )
true
);
}
......@@ -2212,7 +2212,7 @@ MainWindow
}
/*****************************************************************************/
#if defined( OTB_USE_QT4 ) && USE_OTB_APPS
#if defined( OTB_USE_QT ) && USE_OTB_APPS
void
MainWindow
......@@ -2297,7 +2297,7 @@ MainWindow
);
}
#endif // defined( OTB_USE_QT4 ) && USE_OTB_APPS
#endif // defined( OTB_USE_QT ) && USE_OTB_APPS
/*****************************************************************************/
#if USE_TABBED_VIEW
......@@ -2327,7 +2327,7 @@ MainWindow
QWidget* appWidget = m_CentralTabWidget->widget( index );
assert( appWidget!=NULL );
#if defined( OTB_USE_QT4 ) && USE_OTB_APPS
#if defined( OTB_USE_QT ) && USE_OTB_APPS
assert( appWidget==qobject_cast< Wrapper::QtWidgetView* >( appWidget ) );
Wrapper::QtWidgetView* appWidgetView =
......
......@@ -454,7 +454,7 @@ PreferencesDialog
::on_geoidButton_clicked()
{
QString geoidFile(
otb::GetOpenFileName(
otb::GetOpenFilename(
this,
tr( "Select a geoid file." )
)
......
......@@ -260,7 +260,7 @@ ToLocalString( const QString & );
/**
* \brief Convert and copy a QString to a STL std::string.
*
* The Unicode data is converted to 8-bit using the QString::toAscii()
* The Unicode data is converted to 8-bit using the QString::toLatin1()
* method.
*
* \param str The Unicode string to convert.
......@@ -517,7 +517,7 @@ inline
std::string
ToStdString( const QString& str )
{
return std::string( str.toAscii().constData() );
return std::string( str.toLatin1().constData() );
}
/*******************************************************************************/
......@@ -525,7 +525,7 @@ inline
const char*
ToString( const QString& str )
{
return str.toAscii().constData();
return str.toLatin1().constData();
}
/*******************************************************************************/
......
......@@ -448,7 +448,11 @@ private:
* \param type Type of caught message.
* \param message Content of caught message.
*/
static void HandleQtMessage( QtMsgType type, const char* message );
static void HandleQtMessage( QtMsgType type, const QMessageLogContext & , const QString & message );
/* Old function was
static void HandleQtMessage( QtMsgType type, const char * message );
Qstring has a constructor QString(const char *str) but I have no idea
of the perf impact */
/**
*/
......
......@@ -37,7 +37,7 @@
//
// Qt includes (sorted by alphabetic order)
//// Must be included before system/custom includes.
#include <QtGui>
#include <QtWidgets>
//
// System includes (sorted by alphabetic order)
......
......@@ -36,7 +36,7 @@ otb_module( OTBMonteverdiCore
OTBObjectList
OTBOSSIMAdapters
OTBProjection
OTBQt4
OTBQt
OTBStatistics
OTBTransform
......
......@@ -90,11 +90,11 @@ if( OTBApplicationEngine_ENABLED )
endif()
#############################################################################
add_to_qt4_i18n_sources( ${OTBMonteverdiCore_SRCS} )
add_to_qt4_i18n_headers( "../include" ${OTBMonteverdiCore_SRCS} )
add_to_qt_i18n_sources( ${OTBMonteverdiCore_SRCS} )
add_to_qt_i18n_headers( "../include" ${OTBMonteverdiCore_SRCS} )
#############################################################################
qt4_wrap_cpp( OTBMonteverdiCore_SRC_MOC ${OTBMonteverdiCore_HEADERS_MOC} )
qt5_wrap_cpp( OTBMonteverdiCore_SRC_MOC ${OTBMonteverdiCore_HEADERS_MOC} )
add_library( OTBMonteverdiCore ${OTBMonteverdiCore_SRCS} ${OTBMonteverdiCore_SRC_MOC})
......@@ -111,7 +111,7 @@ target_link_libraries( OTBMonteverdiCore
${OTBObjectList_LIBRARIES}
${OTBOSSIMAdapters_LIBRARIES}
${OTBProjection_LIBRARIES}
${OTBQt4_LIBRARIES}
${OTBQt_LIBRARIES}
${OTBStatistics_LIBRARIES}
${OTBTransform_LIBRARIES}
)
......
......@@ -231,7 +231,7 @@ AbstractImageModel
" (" +
qApp->translate(
"mvd::AbstractImageModel",
it2->toAscii().constData()
it2->toLatin1().constData()
)
+ ")"
);
......
......@@ -160,7 +160,7 @@ I18nCoreApplication
// get the md5 of the filename
QByteArray result =
QCryptographicHash::hash( fileInfo.absoluteFilePath().toAscii(),
QCryptographicHash::hash( fileInfo.absoluteFilePath().toLatin1(),
QCryptographicHash::Md5 );
// MD5 hash-code.
......@@ -258,8 +258,12 @@ I18nCoreApplication
/*****************************************************************************/
void
I18nCoreApplication
::HandleQtMessage( QtMsgType type, const char* message )
::HandleQtMessage( QtMsgType type ,
const QMessageLogContext & ,
const QString & message )
{
std::string msg = ToStdString( message );
switch( type )
{
//
......@@ -267,13 +271,13 @@ I18nCoreApplication
case QtDebugMsg:
#if ECHO_QDEBUG || FORCE_QDEBUG
#if _WIN32
OutputDebugString( message );
OutputDebugString( msg.c_str() );
OutputDebugString( "\n" );
#endif
fprintf( stderr, "%s\n", message );
std::cerr << msg << std::endl;
#endif
#if LOG_QDEBUG