From bbc5c50035b23e5c74dd2ba28468a6adede1abbc Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 2 Feb 2016 14:11:25 +0300 Subject: [PATCH] Merge relevant changes from V8_0_0_BR branch --- CMakeLists.txt | 37 ++++++-- SalomeGUIConfig.cmake.in | 48 +++++----- .../cmake_files/FindSalomeParaView.cmake | 7 +- adm_local/cmake_files/FindSalomeQt4.cmake | 11 +++ adm_local/cmake_files/UseQt4Ext.cmake | 2 + src/CAF/CAF_Study.cxx | 4 +- src/Event/CMakeLists.txt | 3 + src/GLViewer/GLViewer_BaseObjects.cxx | 40 ++++---- src/GLViewer/GLViewer_Context.cxx | 28 +++--- src/GLViewer/GLViewer_Context.h | 6 +- src/GLViewer/GLViewer_Grid.cxx | 4 +- src/GLViewer/GLViewer_ToolTip.cxx | 2 +- src/GLViewer/GLViewer_ViewFrame.cxx | 16 ++-- src/GLViewer/GLViewer_ViewPort2d.cxx | 6 +- src/GLViewer/GLViewer_Viewer2d.cxx | 16 ++-- src/GLViewer/GLViewer_Widget.cxx | 2 +- src/GraphicsView/GraphicsView_Object.cxx | 2 +- src/GuiHelpers/CMakeLists.txt | 2 + src/HelpBrowser/CMakeLists.txt | 2 + src/HelpBrowser/qtlocalpeer.cpp | 1 + src/HelpBrowser/qtlockedfile_win.cpp | 10 +- src/ImageComposer/CMakeLists.txt | 2 - src/LightApp/LightApp_Application.cxx | 8 +- src/LightApp/LightApp_Dialog.cxx | 6 +- src/LightApp/LightApp_Driver.cxx | 4 +- src/LightApp/LightApp_ModuleAction.cxx | 2 +- src/LightApp/LightApp_NameDlg.cxx | 6 +- src/LightApp/LightApp_Operation.cxx | 4 +- src/OBJECT/CMakeLists.txt | 4 +- .../OCCViewer_ClipPlaneInteractor.cxx | 6 +- src/OCCViewer/OCCViewer_ClippingDlg.cxx | 12 +-- .../OCCViewer_CreateRestoreViewDlg.cxx | 4 +- .../OCCViewer_SetRotationPointDlg.cxx | 4 +- src/OCCViewer/OCCViewer_SetRotationPointDlg.h | 2 +- src/OCCViewer/OCCViewer_Utilities.cxx | 2 +- src/OCCViewer/OCCViewer_ViewModel.cxx | 2 +- src/OCCViewer/OCCViewer_ViewPort.cxx | 30 ------ src/OCCViewer/OCCViewer_ViewPort.h | 4 - src/Plot2d/Plot2d_FitDataDlg.cxx | 8 +- src/Plot2d/Plot2d_PlotItems.cxx | 8 +- src/Plot2d/Plot2d_SetupViewDlg.cxx | 10 +- src/Plot2d/Plot2d_ViewFrame.cxx | 16 ++-- src/PyConsole/PyConsole_EnhEditor.cxx | 3 +- src/PyConsole/PyConsole_EnhEditor.h | 2 +- src/PyEditor/PyEditor_SettingsDlg.cxx | 8 +- src/PyViewer/PyViewer_ViewWindow.cxx | 7 +- src/QDS/QDS_Datum.cxx | 2 +- src/Qtx/Qtx.cxx | 6 +- src/Qtx/QtxActionToolMgr.cxx | 2 +- src/Qtx/QtxColorButton.cxx | 2 +- src/Qtx/QtxDialog.cxx | 2 +- src/Qtx/QtxDockAction.cxx | 4 +- src/Qtx/QtxFontEdit.cxx | 4 +- src/Qtx/QtxMainWindow.cxx | 2 +- src/Qtx/QtxPathDialog.cxx | 10 +- src/Qtx/QtxPathEdit.cxx | 2 +- src/Qtx/QtxPreferenceMgr.cxx | 2 +- src/Qtx/QtxResourceMgr.cxx | 8 +- src/Qtx/QtxSearchTool.cxx | 10 +- src/Qtx/QtxTreeView.cxx | 8 +- src/Qtx/QtxWebBrowser.cxx | 16 ++-- src/Qtx/QtxWorkspace.cxx | 32 ++++--- src/Qtx/QtxWorkspace.h | 10 +- src/Qtx/QtxWorkspaceAction.cxx | 28 +++--- src/Qtx/QtxWorkstack.cxx | 6 +- src/Qtx/QtxWorkstackAction.cxx | 4 +- .../SALOME_PYQT_GUI/CMakeLists.txt | 1 + .../SALOME_PYQT_GUILight/CMakeLists.txt | 1 + .../SALOME_PYQT_GUILight.sip | 1 + src/SALOME_PYQT/SalomePyQt/CMakeLists.txt | 1 + src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx | 8 +- src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip | 28 ++++++ src/STD/STD_Application.cxx | 12 +-- src/STD/STD_MDIDesktop.cxx | 17 ++-- src/SUIT/SUIT_ActionOperation.cxx | 2 +- src/SUIT/SUIT_Application.cxx | 18 ++-- src/SUIT/SUIT_Application.h | 2 +- src/SUIT/SUIT_DataObjectKey.cxx | 6 +- src/SUIT/SUIT_Desktop.cxx | 2 +- src/SUIT/SUIT_FileDlg.cxx | 20 ++-- src/SUIT/SUIT_Operation.cxx | 38 ++++---- src/SUIT/SUIT_ResourceMgr.cxx | 2 +- src/SUIT/SUIT_Study.cxx | 26 +++--- src/SUIT/SUIT_ViewManager.cxx | 2 +- src/SUIT/SUIT_ViewWindow.cxx | 4 +- src/SVTK/SVTK_ComboAction.cxx | 2 +- .../SVTK_GenericRenderWindowInteractor.cxx | 2 +- src/SVTK/SVTK_NonIsometricDlg.cxx | 10 +- src/SVTK/SVTK_SetRotationPointDlg.cxx | 4 +- src/SVTK/SVTK_UpdateRateDlg.cxx | 16 ++-- src/SVTK/SVTK_ViewModel.cxx | 2 +- src/SVTK/SVTK_ViewParameterDlg.cxx | 4 +- src/SVTK/SVTK_ViewWindow.cxx | 36 ++++---- src/SalomeApp/SalomeApp_Application.cxx | 29 ++++-- src/SalomeApp/SalomeApp_Engine_i.cxx | 22 ++++- .../SalomeApp_StudyPropertiesDlg.cxx | 2 +- src/SalomeApp/pluginsdemo/CMakeLists.txt | 14 ++- src/SalomeApp/pluginsdemo/minmax_dialog.py | 91 ------------------- src/SalomeApp/pluginsdemo/minmax_plugin.py | 2 +- src/Session/SALOME_Session_Server.cxx | 10 +- src/Session/Session_ServerCheck.cxx | 58 ++++++++---- src/Session/Session_Session_i.cxx | 2 +- src/Style/Style_Salome.cxx | 3 +- src/TreeData/Test/mainwindow.cxx | 3 +- src/TreeData/TreeModel.cxx | 2 - src/VTKViewer/VTKViewer_Filter.cxx | 2 +- src/VTKViewer/VTKViewer_InteractorStyle.cxx | 4 +- .../VTKViewer_RenderWindowInteractor.cxx | 2 +- src/VTKViewer/VTKViewer_ViewWindow.cxx | 32 +++---- src/ViewerTools/ViewerTools_DialogBase.h | 2 +- tools/dlgfactory/CMakeLists.txt | 2 + tools/dlgfactory/GenericDialog.cxx | 9 +- tools/dlgfactory/GenericDialog.h | 25 ++--- tools/dlgfactory/__GDIALOG__.cxx | 2 +- tools/dlgfactory/__GDIALOG__.h | 11 +-- tools/dlgfactory/__QDIALOG__.cxx | 4 +- tools/dlgfactory/__QDIALOG__.h | 20 ++-- tools/dlgfactory/gtester.cxx | 5 +- tools/dlgfactory/qtester.cxx | 5 +- 119 files changed, 618 insertions(+), 585 deletions(-) delete mode 100644 src/SalomeApp/pluginsdemo/minmax_dialog.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 317a1b3ce..347ee31e5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,18 +149,31 @@ ENDIF() # Qt4 FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork) -INCLUDE(${QT_USE_FILE}) # PyQt4 FIND_PACKAGE(SalomePyQt4 REQUIRED) -# Optional prerequisites for GUI +# Optional packages for GUI and their pre-requisites + +# - GL viewer: no prereqs IF(NOT SALOME_USE_GLVIEWER) ADD_DEFINITIONS("-DDISABLE_GLVIEWER") ENDIF() + +# - OCC viewer: no prereqs IF(NOT SALOME_USE_OCCVIEWER) ADD_DEFINITIONS("-DDISABLE_OCCVIEWER") ENDIF() + +# - PV viewer: ParaView +IF (SALOME_USE_PVVIEWER) + FIND_PACKAGE(SalomeParaView) + SALOME_LOG_OPTIONAL_PACKAGE(ParaView SALOME_USE_PVVIEWER) +ELSE() + ADD_DEFINITIONS("-DDISABLE_PVVIEWER") +ENDIF() + +# - VTK viewer: VTK IF(SALOME_USE_VTKVIEWER) # Required components are listed in the FindSalomeVTK.cmake file: FIND_PACKAGE(SalomeVTK) @@ -168,33 +181,39 @@ IF(SALOME_USE_VTKVIEWER) ELSE() ADD_DEFINITIONS("-DDISABLE_VTKVIEWER") ENDIF() + +# - Plot2d viewer: Qwt IF(SALOME_USE_PLOT2DVIEWER) FIND_PACKAGE(SalomeQwt) SALOME_LOG_OPTIONAL_PACKAGE(Qwt SALOME_USE_PLOT2DVIEWER) ELSE() ADD_DEFINITIONS("-DDISABLE_PLOT2DVIEWER") ENDIF() -IF (SALOME_USE_PVVIEWER) - FIND_PACKAGE(SalomeParaView) - SALOME_LOG_OPTIONAL_PACKAGE(ParaView SALOME_USE_PVVIEWER) -ELSE() - ADD_DEFINITIONS("-DDISABLE_PVVIEWER") -ENDIF() + +# - Graphics viewer: no prereqs IF (NOT SALOME_USE_GRAPHICSVIEW) ADD_DEFINITIONS("-DDISABLE_GRAPHICSVIEW") ENDIF() + +# - Python editor: no prereqs IF (NOT SALOME_USE_PYVIEWER) ADD_DEFINITIONS("-DDISABLE_PYVIEWER") ENDIF() + +# - Python console: no prereqs IF(SALOME_USE_PYCONSOLE) # Build with obsolete Python module's methods ADD_DEFINITIONS(-DCALL_OLD_METHODS) ELSE() ADD_DEFINITIONS("-DDISABLE_PYCONSOLE") ENDIF() + +# - Qx viewer: no prereqs IF(NOT SALOME_USE_QXGRAPHVIEWER) ADD_DEFINITIONS("-DDISABLE_QXGRAPHVIEWER") ENDIF() + +# - SALOME object: no prereqs IF(NOT SALOME_USE_SALOMEOBJECT) ADD_DEFINITIONS("-DDISABLE_SALOMEOBJECT") ENDIF() @@ -383,7 +402,7 @@ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets} # Create the configuration files: # - in the build tree: -# Ensure the variables are always defined for the configure: +# Ensure the variables are always defined for the configure: SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}") SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}") SET(QT4_ROOT_DIR "${QT4_ROOT_DIR}") diff --git a/SalomeGUIConfig.cmake.in b/SalomeGUIConfig.cmake.in index 5010a661f..9b5b44472 100644 --- a/SalomeGUIConfig.cmake.in +++ b/SalomeGUIConfig.cmake.in @@ -124,32 +124,34 @@ IF(SALOME_USE_PLOT2DVIEWER) SET_AND_CHECK(QWT_ROOT_DIR_EXP "@PACKAGE_QWT_ROOT_DIR@") ENDIF() -# For all prerequisites, load the corresponding targets if the package was used +# For all prerequisites, load the corresponding targets if the package was used # in CONFIG mode. This ensures dependent projects link correctly # without having to set LD_LIBRARY_PATH: -SET(_PREREQ @_PREREQ_LIST@) -SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@) -SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@") -LIST(LENGTH _PREREQ_CONFIG_DIR _list_len) -IF(NOT _list_len EQUAL 0) +SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@) +SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@) +SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@") +LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@) +IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0) # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ... - MATH(EXPR _range "${_list_len}-1") - FOREACH(_p RANGE ${_range}) - LIST(GET _PREREQ ${_p} _pkg ) - LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir) - LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo) - MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...") - IF(NOT _pkg_compo) - FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE - PATHS "${_pkg_dir}" - NO_DEFAULT_PATH) - ELSE() - STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}") - MESSAGE(STATUS "===> (components: ${_pkg_compo})") - FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE - COMPONENTS ${_compo_lst} - PATHS "${_pkg_dir}" - NO_DEFAULT_PATH) + MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1") + FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@}) + LIST(GET _PREREQ_@PROJECT_NAME@ ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@ ) + LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@) + LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@) + IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@}) + MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...") + IF(NOT _pkg_compo_@PROJECT_NAME@) + FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE + PATHS "${_pkg_dir_@PROJECT_NAME@}" + NO_DEFAULT_PATH) + ELSE() + STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}") + MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})") + FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE + COMPONENTS ${_compo_lst_@PROJECT_NAME@} + PATHS "${_pkg_dir_@PROJECT_NAME@}" + NO_DEFAULT_PATH) + ENDIF() ENDIF() ENDFOREACH() ENDIF() diff --git a/adm_local/cmake_files/FindSalomeParaView.cmake b/adm_local/cmake_files/FindSalomeParaView.cmake index 4363516ba..1af971299 100644 --- a/adm_local/cmake_files/FindSalomeParaView.cmake +++ b/adm_local/cmake_files/FindSalomeParaView.cmake @@ -19,12 +19,15 @@ # Author: Adrien Bruneton # -# Graphviz detection for salome +# ParaView detection for salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # +IF(NOT QT_VERSION) + MESSAGE(FATAL_ERROR "Detection of ParaView requires Qt to be detected first!") +ENDIF() + SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParaView PARAVIEW_USE_FILE 4) -#MARK_AS_ADVANCED() INCLUDE(${PARAVIEW_USE_FILE}) diff --git a/adm_local/cmake_files/FindSalomeQt4.cmake b/adm_local/cmake_files/FindSalomeQt4.cmake index a89fc81a8..86faa8232 100644 --- a/adm_local/cmake_files/FindSalomeQt4.cmake +++ b/adm_local/cmake_files/FindSalomeQt4.cmake @@ -23,11 +23,22 @@ # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # + SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt4 QT_INCLUDES 2) MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE) +# This is only needed to correctly detect Qt help generator tool, to workaround an error +# coming from ParaView detection procedure +FIND_PROGRAM(QT_HELP_GENERATOR qhelpgenerator + PATHS "${QT_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH + DOC "qhelpgenerator used to compile Qt help project files" + ) +MARK_AS_ADVANCED(QT_HELP_GENERATOR) + IF(QT4_FOUND) SALOME_ACCUMULATE_HEADERS(QT_INCLUDES) SALOME_ACCUMULATE_ENVIRONMENT(PATH ${QT_QMAKE_EXECUTABLE}) SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QT_QTCORE_LIBRARY}) + SET(QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}") + MESSAGE(STATUS "Qt version is ${QT_VERSION}") ENDIF() diff --git a/adm_local/cmake_files/UseQt4Ext.cmake b/adm_local/cmake_files/UseQt4Ext.cmake index 32e776c62..e57f46f0b 100644 --- a/adm_local/cmake_files/UseQt4Ext.cmake +++ b/adm_local/cmake_files/UseQt4Ext.cmake @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(${QT_USE_FILE}) + INSTALL(CODE "MACRO(QT4_COMPILE_TS_ON_INSTALL MYLRELEASE MYTSFILE MYFULLDIR MYOUTQMFILE) FILE(MAKE_DIRECTORY \${MYFULLDIR}) MESSAGE(STATUS \"Compiling \${MYTSFILE}\") diff --git a/src/CAF/CAF_Study.cxx b/src/CAF/CAF_Study.cxx index 054e71d58..d60fd3516 100755 --- a/src/CAF/CAF_Study.cxx +++ b/src/CAF/CAF_Study.cxx @@ -168,8 +168,8 @@ bool CAF_Study::saveDocumentAs( const QString& fname ) bool save = false; if ( !stdDoc().IsNull() && stdDoc()->IsSaved() ) { - QString path = QDir::convertSeparators( CAF_Tools::toQString( stdDoc()->GetPath() ) ); - save = path == QDir::convertSeparators( fname ); + QString path = QDir::toNativeSeparators( CAF_Tools::toQString( stdDoc()->GetPath() ) ); + save = path == QDir::toNativeSeparators( fname ); } bool status = false; diff --git a/src/Event/CMakeLists.txt b/src/Event/CMakeLists.txt index 9da467339..8f753936e 100755 --- a/src/Event/CMakeLists.txt +++ b/src/Event/CMakeLists.txt @@ -19,6 +19,9 @@ # --- options --- +# additional include directories +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + # additional preprocessor / compiler flags ADD_DEFINITIONS(${QT_DEFINITIONS}) diff --git a/src/GLViewer/GLViewer_BaseObjects.cxx b/src/GLViewer/GLViewer_BaseObjects.cxx index 3773bb873..ae9caefd9 100644 --- a/src/GLViewer/GLViewer_BaseObjects.cxx +++ b/src/GLViewer/GLViewer_BaseObjects.cxx @@ -212,7 +212,7 @@ bool GLViewer_MarkerSet::translateToPS( QFile& hFile, GLViewer_CoordSystem* aVie } aBuffer+="closepath\nstroke\n"; - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); return true; } @@ -250,7 +250,7 @@ bool GLViewer_MarkerSet::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aV } aBuffer+="PU;\n"; - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); } return true; @@ -370,12 +370,12 @@ GLboolean GLViewer_MarkerSet::highlight( GLfloat x, GLfloat y, GLfloat tol, GLbo if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) || ( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) ) { - isFound = FALSE; + isFound = false; count++; for ( it = myCurSelNumbers.begin(); it != myCurSelNumbers.end(); ++it ) if( i == *it ) { - isFound = TRUE; + isFound = true; curHNumbers.append( i ); } @@ -462,13 +462,13 @@ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewe count++; if ( isShift ) { - bool isFound = FALSE; + bool isFound = false; for( it = mySelNumbers.begin(); it != mySelNumbers.end(); ++it ) if ( *it == i ) { myUSelNumbers.append( *it ); remIt = it; - isFound = TRUE; + isFound = true; break; } @@ -651,7 +651,7 @@ void GLViewer_MarkerSet::exportNumbers( QList& highlight, bool GLViewer_MarkerSet::addOrRemoveSelected( int index ) { if( index < 0 || index > myNumber ) - return FALSE; + return false; int n = mySelNumbers.indexOf( index ); if( n == -1 ) @@ -661,7 +661,7 @@ bool GLViewer_MarkerSet::addOrRemoveSelected( int index ) mySelNumbers.removeAt(n); myUSelNumbers.append( index ); } - return TRUE; + return true; } /*! @@ -869,7 +869,7 @@ bool GLViewer_Polyline::translateToPS( QFile& hFile, GLViewer_CoordSystem* aView aBuffer+="closepath\nstroke\n"; - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); return true; } @@ -895,7 +895,7 @@ bool GLViewer_Polyline::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* aVi aBuffer+="PU;\n"; - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); return true; } @@ -1394,7 +1394,7 @@ bool GLViewer_TextObject::translateToPS( QFile& hFile, GLViewer_CoordSystem* aVi AddCoordsToPS( aBuffer, "moveto", aViewerCS, aPSCS, double(xPos), double(yPos) ); aBuffer += "(" + aText + ") show\n"; - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); return true; } @@ -1416,7 +1416,7 @@ bool GLViewer_TextObject::translateToHPGL( QFile& hFile, GLViewer_CoordSystem* a aBuffer = "LB" + aText + "#;"; - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); return true; } @@ -1438,16 +1438,16 @@ bool GLViewer_TextObject::translateToEMF( HDC dc, GLViewer_CoordSystem* aViewerC y = double( yPos ); aViewerCS->transform( *aEMFCS, x, y ); - const char* str = aText.toAscii(); + const char* str = aText.toLatin1(); int nHeight = 35*14; // height of font int nWidth = 35*12; // average character width int nEscapement = 0; // angle of escapement int nOrientation = 0; // base-line orientation angle int fnWeight = FW_NORMAL; // font weight - DWORD fdwItalic = FALSE; // italic attribute option - DWORD fdwUnderline = FALSE; // underline attribute option - DWORD fdwStrikeOut = FALSE; // strikeout attribute option + DWORD fdwItalic = false; // italic attribute option + DWORD fdwUnderline = false; // underline attribute option + DWORD fdwStrikeOut = false; // strikeout attribute option DWORD fdwCharSet = ANSI_CHARSET; // character set identifier DWORD fdwOutputPrecision = OUT_DEFAULT_PRECIS; // output precision DWORD fdwClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision @@ -1573,9 +1573,9 @@ GLboolean GLViewer_TextObject::highlight( GLfloat theX, GLfloat theY, GLfloat th QRegion circle( (int)(theX - theTol), (int)(theY - theTol), (int)(2 * theTol), (int)(2 * theTol), QRegion::Ellipse ); if( isCircle ) - intersection = obj.intersect( circle ); + intersection = obj.intersected( circle ); else - intersection = obj.intersect( region ); + intersection = obj.intersected( region ); if( intersection.isEmpty() ) myIsHigh = false; @@ -1631,9 +1631,9 @@ GLboolean GLViewer_TextObject::select( GLfloat theX, GLfloat theY, GLfloat theTo QRegion circle( (int)(theX - theTol), (int)(theY - theTol), (int)(2 * theTol), (int)(2 * theTol), QRegion::Ellipse ); if( isCircle ) - intersection = obj.intersect( circle ); + intersection = obj.intersected( circle ); else - intersection = obj.intersect( region ); + intersection = obj.intersected( region ); if( intersection.isEmpty() ) myIsSel = false; diff --git a/src/GLViewer/GLViewer_Context.cxx b/src/GLViewer/GLViewer_Context.cxx index 319662239..60df04be0 100644 --- a/src/GLViewer/GLViewer_Context.cxx +++ b/src/GLViewer/GLViewer_Context.cxx @@ -182,7 +182,7 @@ int GLViewer_Context::MoveTo( int xi, int yi, bool byCircle ) if( myLastPickedChanged || myUpdateAll ) myGLViewer2d->updateAll(); else - myGLViewer2d->activateDrawers( anUpdatedObjects, TRUE, TRUE ); + myGLViewer2d->activateDrawers( anUpdatedObjects, true, true ); return 0; } @@ -220,7 +220,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) if( updateAll || myUpdateAll ) myGLViewer2d->updateAll(); else - myGLViewer2d->activateDrawers( aList, TRUE, TRUE ); + myGLViewer2d->activateDrawers( aList, true, true ); if( mySelectedObjects.count() != 0 && status == SS_Invalid ) status = SS_GlobalChanged; @@ -242,7 +242,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) && mySelectedObjects.indexOf( myLastPicked ) == -1 ) { mySelectedObjects.append( myLastPicked ); - myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE ); + myGLViewer2d->activateDrawer( myLastPicked, true, true ); if( status == SS_Invalid ) status = SS_GlobalChanged; @@ -267,7 +267,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) if( updateAll || myUpdateAll ) myGLViewer2d->updateAll(); else - myGLViewer2d->activateDrawers( aList, TRUE, TRUE ); + myGLViewer2d->activateDrawers( aList, true, true ); if( mySelectedObjects.count() != 0 ) status = SS_GlobalChanged; @@ -297,7 +297,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) if( updateAll || myUpdateAll ) myGLViewer2d->updateAll(); else - myGLViewer2d->activateDrawers( aList, TRUE, TRUE ); + myGLViewer2d->activateDrawers( aList, true, true ); if( mySelectedObjects.count() != 0 ) status = SS_GlobalChanged; @@ -319,7 +319,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle ) { myLastPicked = *oit; mySelectedObjects.append( myLastPicked ); - myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE ); + myGLViewer2d->activateDrawer( myLastPicked, true, true ); status = SS_GlobalChanged; return status; } @@ -387,7 +387,7 @@ int GLViewer_Context::SelectByRect( const QRect& theRect, bool Append ) if( updateAll || myUpdateAll ) myGLViewer2d->updateAll(); else - myGLViewer2d->activateDrawers( aList, TRUE, TRUE ); + myGLViewer2d->activateDrawers( aList, true, true ); return status; } @@ -470,10 +470,10 @@ bool GLViewer_Context::NextSelected() if ( mySelCurIndex >= 0 && mySelCurIndex < NbSelected() ) { mySelCurIndex++; - return TRUE; + return true; } - return FALSE; + return false; } /*! @@ -512,7 +512,7 @@ int GLViewer_Context::insertObject( GLViewer_Object* object, bool display, bool { //QRect* rect = object->getRect()->toQRect(); //myGLViewer2d->updateBorders( *rect ); - myGLViewer2d->activateDrawer( object, FALSE ); + myGLViewer2d->activateDrawer( object, false ); } } else @@ -600,7 +600,7 @@ void GLViewer_Context::clearSelected( bool updateViewer ) } if( updateViewer ) - myGLViewer2d->activateDrawers( aList, TRUE ); + myGLViewer2d->activateDrawers( aList, true ); mySelectedObjects.clear(); } @@ -615,12 +615,12 @@ void GLViewer_Context::setSelected( GLViewer_Object* object, bool updateViewer ) if( myActiveObjects.contains( object ) && !mySelectedObjects.contains( object ) ) { - object->setSelected( TRUE ); + object->setSelected( true ); mySelectedObjects.append( object ); } if( updateViewer ) - myGLViewer2d->activateDrawer( object, TRUE, TRUE ); + myGLViewer2d->activateDrawer( object, true, true ); } /*! @@ -636,7 +636,7 @@ void GLViewer_Context::remSelected( GLViewer_Object* object, bool updateViewer ) object->unselect(); if( updateViewer ) - myGLViewer2d->activateDrawer( object, TRUE, TRUE ); + myGLViewer2d->activateDrawer( object, true, true ); } /*! diff --git a/src/GLViewer/GLViewer_Context.h b/src/GLViewer/GLViewer_Context.h index e3af9817e..df27941f4 100644 --- a/src/GLViewer/GLViewer_Context.h +++ b/src/GLViewer/GLViewer_Context.h @@ -70,18 +70,18 @@ public: *\paran byCircle - true if needs round sensitive area around mouse cursor, else rectangle *function search object rectangle which intersect with sensitive area and call object highlight method */ - int MoveTo( int x, int y, bool byCircle = FALSE ); + int MoveTo( int x, int y, bool byCircle = false ); /*! A function selecting already highlighting object by calling object method select *\param Append - true if new selection will be append to existing selection, false - another *\param byCircle - true if needs round selection area in complex object */ - int Select( bool Append = FALSE, bool byCircle = FALSE ); + int Select( bool Append = false, bool byCircle = false ); /*! A function selecting objects on scene by rectangle *\param theRect - rectangle of selection *\param Append - true if new selection will be append to existing selection, false - another *function search object rectangle which intersect with theRect and call object select method */ - int SelectByRect( const QRect& theRect, bool Append = FALSE ); + int SelectByRect( const QRect& theRect, bool Append = false ); //! A function installing highlight color for all presentation (does not work) void SetHighlightColor( Quantity_NameOfColor aCol ); diff --git a/src/GLViewer/GLViewer_Grid.cxx b/src/GLViewer/GLViewer_Grid.cxx index a0745880b..49eb22ec1 100644 --- a/src/GLViewer/GLViewer_Grid.cxx +++ b/src/GLViewer/GLViewer_Grid.cxx @@ -297,7 +297,7 @@ label: { glDeleteLists( myGridList, 1 ); if ( glGetError() != GL_NO_ERROR ) - return FALSE; + return false; } float xLoc = (int)(myXPan / myXSize) * myXSize; @@ -348,5 +348,5 @@ label: glEndList(); } - return TRUE; + return true; } diff --git a/src/GLViewer/GLViewer_ToolTip.cxx b/src/GLViewer/GLViewer_ToolTip.cxx index 632062d00..3d5653cb2 100644 --- a/src/GLViewer/GLViewer_ToolTip.cxx +++ b/src/GLViewer/GLViewer_ToolTip.cxx @@ -52,7 +52,7 @@ GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent ) Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint ); mypLabel->setObjectName("ObjectTipText"); mypLabel->setMargin( 1 ); - //mypLabel->setAutoMask( FALSE ); + //mypLabel->setAutoMask( false ); mypLabel->setFrameStyle( QFrame::Plain | QFrame::Box ); mypLabel->setLineWidth( 1 ); mypLabel->setAlignment( Qt::AlignAbsolute | Qt::AlignTop ); diff --git a/src/GLViewer/GLViewer_ViewFrame.cxx b/src/GLViewer/GLViewer_ViewFrame.cxx index 8fb684394..fc19461e0 100644 --- a/src/GLViewer/GLViewer_ViewFrame.cxx +++ b/src/GLViewer/GLViewer_ViewFrame.cxx @@ -91,55 +91,55 @@ void GLViewer_ViewFrame::createActions() aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_DUMP" ) ), tr( "MNU_DUMP_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_DUMP_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onDumpView())); toolMgr()->registerAction( aAction, DumpId ); // FitAll aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITALL" ) ), tr( "MNU_FITALL" ), 0, this); aAction->setStatusTip(tr("DSC_FITALL")); - connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitAll())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onViewFitAll())); toolMgr()->registerAction( aAction, FitAllId ); // FitRect aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITAREA" ) ), tr( "MNU_FITRECT" ), 0, this); aAction->setStatusTip(tr("DSC_FITRECT")); - connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitArea())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onViewFitArea())); toolMgr()->registerAction( aAction, FitRectId ); // FitSelect aAction = new QtxAction(tr("MNU_FITSELECT"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_FITSELECT" ) ), tr( "MNU_FITSELECT" ), 0, this); aAction->setStatusTip(tr("DSC_FITSELECT")); - connect(aAction, SIGNAL(activated()), this, SLOT(onViewFitSelect())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onViewFitSelect())); toolMgr()->registerAction( aAction, FitSelectId ); // Zoom aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_ZOOM" ) ), tr( "MNU_ZOOM_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_ZOOM_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onViewZoom())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onViewZoom())); toolMgr()->registerAction( aAction, ZoomId ); // Panning aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_PAN" ) ), tr( "MNU_PAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_PAN_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onViewPan())); toolMgr()->registerAction( aAction, PanId ); // Global Panning aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_GLOBALPAN" ) ), tr( "MNU_GLOBALPAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onViewGlobalPan())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onViewGlobalPan())); toolMgr()->registerAction( aAction, GlobalPanId ); aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "GLViewer", tr( "ICON_GL_RESET" ) ), tr( "MNU_RESET_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_RESET_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onViewReset())); toolMgr()->registerAction( aAction, ResetId ); } diff --git a/src/GLViewer/GLViewer_ViewPort2d.cxx b/src/GLViewer/GLViewer_ViewPort2d.cxx index d9df43cc1..641760fa7 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.cxx +++ b/src/GLViewer/GLViewer_ViewPort2d.cxx @@ -95,7 +95,7 @@ GLViewer_ViewPort2d::GLViewer_ViewPort2d( QWidget* parent, GLViewer_ViewFrame* t myGLWidget = new GLViewer_Widget( this, 0 ) ; qbl->addWidget( myGLWidget ); myGLWidget->setFocusProxy( this ); - setMouseTracking( TRUE ); + setMouseTracking( true ); myIsDragProcess = noDrag; //myCurDragMousePos = QPoint(); @@ -530,7 +530,7 @@ void GLViewer_ViewPort2d::initResize( int x, int y ) GLfloat zoom, xzoom, yzoom; GLfloat w = x; GLfloat h = y; - bool max = FALSE; + bool max = false; xzoom = (GLfloat)x / myWidth; yzoom = (GLfloat)y / myHeight; @@ -541,7 +541,7 @@ void GLViewer_ViewPort2d::initResize( int x, int y ) zoom = yzoom; else { - max = TRUE; + max = true; zoom = xzoom > yzoom ? xzoom : yzoom; } diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index 2c9958520..46d52c040 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -137,7 +137,7 @@ void GLViewer_Viewer2d::updateColors( QColor colorH, QColor colorS ) */ - activateAllDrawers( TRUE ); + activateAllDrawers( true ); } /*! @@ -668,7 +668,7 @@ void GLViewer_Viewer2d::insertHeader( VectorFileType aType, QFile& hFile ) header += "%%Pages: 1\n"; header += "%%Page: 1\n\n"; - hFile.write( header.toAscii() ); + hFile.write( header.toLatin1() ); } else if( aType == HPGL ) { @@ -682,7 +682,7 @@ void GLViewer_Viewer2d::insertHeader( VectorFileType aType, QFile& hFile ) header += "LT;\n"; header += "VS36;\n"; - hFile.write( header.toAscii() ); + hFile.write( header.toLatin1() ); } } @@ -696,12 +696,12 @@ void GLViewer_Viewer2d::insertEnding( VectorFileType aType, QFile& hFile ) if( aType == POST_SCRIPT ) { QString ending = "showpage\n\n%%EOF"; - hFile.write( ending.toAscii() ); + hFile.write( ending.toLatin1() ); } else if( aType == HPGL ) { QString ending = "PU;PA0,0;SP;EC;PG1;EC1;OE\n"; - hFile.write( ending.toAscii() ); + hFile.write( ending.toLatin1() ); } } @@ -731,7 +731,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap if ( !getActiveView() ) return false; - QFile hFile( FileName.toAscii() ); + QFile hFile( FileName.toLatin1() ); #ifdef WIN32 HDC hMetaFileDC; @@ -793,7 +793,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap HDC screen_dc = GetDC( 0 ); //The screen device context HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen - hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toAscii(), &r, "" ); + hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toLatin1(), &r, "" ); SetMapMode( hMetaFileDC, MM_HIMETRIC ); SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL ); HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH ); @@ -819,7 +819,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap arg( AW-mmLeft-mmRight ).arg( AH-mmBottom-mmTop ); //It is set clipping path - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); aCurVP->getGLWidget()->translateBackgroundToPS( hFile, &aViewerCS, &aPaperCS ); } diff --git a/src/GLViewer/GLViewer_Widget.cxx b/src/GLViewer/GLViewer_Widget.cxx index ac60a1f8d..cec19f953 100644 --- a/src/GLViewer/GLViewer_Widget.cxx +++ b/src/GLViewer/GLViewer_Widget.cxx @@ -495,7 +495,7 @@ void AddImagePart( QFile& hFile, QImage& image, int w1, int w2, int h1, int h2, aBuffer += "> false 3 colorimage\n\n"; - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); } } diff --git a/src/GraphicsView/GraphicsView_Object.cxx b/src/GraphicsView/GraphicsView_Object.cxx index 5bdaa0a12..a3d1b87a3 100644 --- a/src/GraphicsView/GraphicsView_Object.cxx +++ b/src/GraphicsView/GraphicsView_Object.cxx @@ -43,7 +43,7 @@ GraphicsView_Object::GraphicsView_Object( QGraphicsItem* theParent ) //======================================================================= GraphicsView_Object::~GraphicsView_Object() { - QListIterator aChildIter( children() ); + QListIterator aChildIter( childItems() ); while( aChildIter.hasNext() ) { if( QGraphicsItem* aChild = aChildIter.next() ) diff --git a/src/GuiHelpers/CMakeLists.txt b/src/GuiHelpers/CMakeLists.txt index 65db77ba3..1d739b787 100755 --- a/src/GuiHelpers/CMakeLists.txt +++ b/src/GuiHelpers/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(UseQt4Ext) + # additional include directories INCLUDE_DIRECTORIES( ${CAS_INCLUDE_DIRS} diff --git a/src/HelpBrowser/CMakeLists.txt b/src/HelpBrowser/CMakeLists.txt index 6de2ec6c3..59e7d4c5b 100644 --- a/src/HelpBrowser/CMakeLists.txt +++ b/src/HelpBrowser/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(UseQt4Ext) + # --- options --- # additional include directories diff --git a/src/HelpBrowser/qtlocalpeer.cpp b/src/HelpBrowser/qtlocalpeer.cpp index 332b0643f..19914f458 100644 --- a/src/HelpBrowser/qtlocalpeer.cpp +++ b/src/HelpBrowser/qtlocalpeer.cpp @@ -42,6 +42,7 @@ #include "qtlocalpeer.h" #include #include +#include #if defined(Q_OS_WIN) #include diff --git a/src/HelpBrowser/qtlockedfile_win.cpp b/src/HelpBrowser/qtlockedfile_win.cpp index 049acaffe..a86bf3d51 100644 --- a/src/HelpBrowser/qtlockedfile_win.cpp +++ b/src/HelpBrowser/qtlockedfile_win.cpp @@ -63,16 +63,16 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate) Qt::HANDLE mutex; if (doCreate) { - QT_WA( { mutex = CreateMutexW(NULL, FALSE, (LPCWSTR)mname.utf16()); }, - { mutex = CreateMutexA(NULL, FALSE, mname.toLocal8Bit().constData()); } ); + QT_WA( { mutex = CreateMutexW(NULL, false, (LPCWSTR)mname.utf16()); }, + { mutex = CreateMutexA(NULL, false, mname.toLocal8Bit().constData()); } ); if (!mutex) { qErrnoWarning("QtLockedFile::lock(): CreateMutex failed"); return 0; } } else { - QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (LPCWSTR)mname.utf16()); }, - { mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, mname.toLocal8Bit().constData()); } ); + QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, false, (LPCWSTR)mname.utf16()); }, + { mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, false, mname.toLocal8Bit().constData()); } ); if (!mutex) { if (GetLastError() != ERROR_FILE_NOT_FOUND) qErrnoWarning("QtLockedFile::lock(): OpenMutex failed"); @@ -159,7 +159,7 @@ bool QtLockedFile::lock(LockMode mode, bool block) } if (rmutexes.size()) { DWORD res = WaitForMultipleObjects(rmutexes.size(), rmutexes.constData(), - TRUE, block ? INFINITE : 0); + true, block ? INFINITE : 0); if (res != WAIT_OBJECT_0 && res != WAIT_ABANDONED) { if (res != WAIT_TIMEOUT) qErrnoWarning("QtLockedFile::lock(): WaitForMultipleObjects failed"); diff --git a/src/ImageComposer/CMakeLists.txt b/src/ImageComposer/CMakeLists.txt index 587eef55f..534f6c250 100755 --- a/src/ImageComposer/CMakeLists.txt +++ b/src/ImageComposer/CMakeLists.txt @@ -17,8 +17,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(UseQt4Ext) - # additional include directories INCLUDE_DIRECTORIES( ${QT_INCLUDES} diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index dd1d585e0..c0b35e467 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -4013,7 +4013,7 @@ void LightApp_Application::loadDockWindowsState() } if(dwMap) { - QList dwList = qFindChildren( desktop() ); + QList dwList = desktop()->findChildren(); for ( QList::iterator dit = dwList.begin(); dit != dwList.end(); ++dit ) { QDockWidget* dw = *dit; @@ -4066,14 +4066,14 @@ void LightApp_Application::saveDockWindowsState() QMap tbMap, dwMap; dockWindowsState( visArr, tbMap, dwMap ); - QList tbList = qFindChildren( desktop() ); + QList tbList = desktop()->findChildren(); for ( QList::iterator it = tbList.begin(); it != tbList.end(); ++it ) { QToolBar* tb = *it; tbMap.insert( tb->objectName(), tb->toggleViewAction()->isChecked() ); } - QList dwList = qFindChildren( desktop() ); + QList dwList = desktop()->findChildren(); for ( QList::iterator it = dwList.begin(); it != dwList.end(); ++it ) { QDockWidget* wid = *it; @@ -4860,7 +4860,7 @@ void LightApp_Application::onDesktopMessage( const QString& message ) QList LightApp_Application::findToolBars( const QStringList& names ) { QList aResult; - QList tbList = qFindChildren( desktop() ); + QList tbList = desktop()->findChildren(); for ( QList::iterator tit = tbList.begin(); tit != tbList.end(); ++tit ) { QToolBar* tb = *tit; QObject* po = Qtx::findParent( tb, "QMainWindow" ); diff --git a/src/LightApp/LightApp_Dialog.cxx b/src/LightApp/LightApp_Dialog.cxx index 6e7e6f990..1cb736412 100644 --- a/src/LightApp/LightApp_Dialog.cxx +++ b/src/LightApp/LightApp_Dialog.cxx @@ -133,9 +133,9 @@ void LightApp_Dialog::setObjectShown( const int id, const bool shown ) if( myObjects.contains( id ) && isObjectShown( id )!=shown ) { Object& obj = myObjects[ id ]; - obj.myEdit->setShown( shown ); - obj.myBtn->setShown( shown ); - obj.myLabel->setShown( shown ); + obj.myEdit->setVisible( shown ); + obj.myBtn->setVisible( shown ); + obj.myLabel->setVisible( shown ); if( !shown ) ( ( QToolButton* )obj.myBtn )->setChecked( false ); } diff --git a/src/LightApp/LightApp_Driver.cxx b/src/LightApp/LightApp_Driver.cxx index 87e2bf429..59b1af283 100644 --- a/src/LightApp/LightApp_Driver.cxx +++ b/src/LightApp/LightApp_Driver.cxx @@ -83,7 +83,7 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile if(aFileBuffer == NULL) return false; - myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ; + myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ; int aCurrentPos = 0; @@ -142,7 +142,7 @@ bool LightApp_Driver::ReadDatasFromFile( const char* theFileName, bool isMultiFi ifstream aFile(theFileName); #endif - myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ; + myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ; aFile.seekg(0, ios::end); int aFileBufferSize = aFile.tellg(); diff --git a/src/LightApp/LightApp_ModuleAction.cxx b/src/LightApp/LightApp_ModuleAction.cxx index d0df209ec..346d271e9 100755 --- a/src/LightApp/LightApp_ModuleAction.cxx +++ b/src/LightApp/LightApp_ModuleAction.cxx @@ -146,7 +146,7 @@ QList LightApp_ModuleAction::ComboAction::widgets() const QList wlist = createdWidgets(); for ( QList::const_iterator wit = wlist.begin(); wit != wlist.end(); ++wit ) - lst += qFindChildren(*wit); + lst += (*wit)->findChildren(); return lst; } diff --git a/src/LightApp/LightApp_NameDlg.cxx b/src/LightApp/LightApp_NameDlg.cxx index ca50011cb..baec05353 100644 --- a/src/LightApp/LightApp_NameDlg.cxx +++ b/src/LightApp/LightApp_NameDlg.cxx @@ -44,7 +44,7 @@ Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) setModal( true ); setWindowTitle( tr("TLT_RENAME") ); - setSizeGripEnabled( TRUE ); + setSizeGripEnabled( true ); QVBoxLayout* topLayout = new QVBoxLayout( this ); topLayout->setMargin( 11 ); topLayout->setSpacing( 6 ); @@ -76,7 +76,7 @@ Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) myButtonOk = new QPushButton( GroupButtons ); myButtonOk->setObjectName( "buttonOk" ); myButtonOk->setText( tr( "BUT_OK" ) ); - myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE ); + myButtonOk->setAutoDefault( true ); myButtonOk->setDefault( true ); GroupButtonsLayout->addWidget( myButtonOk ); GroupButtonsLayout->addStretch(); @@ -84,7 +84,7 @@ Qt::WindowTitleHint | Qt::WindowSystemMenuHint ) myButtonCancel = new QPushButton( GroupButtons ); myButtonCancel->setObjectName( "buttonCancel" ); myButtonCancel->setText( tr( "BUT_CANCEL" ) ); - myButtonCancel->setAutoDefault( TRUE ); + myButtonCancel->setAutoDefault( true ); GroupButtonsLayout->addWidget( myButtonCancel ); /***************************************************************/ diff --git a/src/LightApp/LightApp_Operation.cxx b/src/LightApp/LightApp_Operation.cxx index 3bdd29f7c..697cb14b5 100755 --- a/src/LightApp/LightApp_Operation.cxx +++ b/src/LightApp/LightApp_Operation.cxx @@ -36,7 +36,7 @@ /*! * \brief Constructor * -* Constructor sets myModule in NULL and myIsAutoResumed in TRUE +* Constructor sets myModule in NULL and myIsAutoResumed in \c true */ LightApp_Operation::LightApp_Operation() : SUIT_Operation( 0 ), @@ -278,7 +278,7 @@ void LightApp_Operation::setDialogActive( const bool active ) * Autoresume property is used during automatic resuming operation. If operation is * suspended and cursor is moved above dialog of the operation then operation is resumed * automatically (if possible). It can be resumed only program call otherwise (see -* LightApp_SwitchOp for more description). This property is TRUE by default and may be +* LightApp_SwitchOp for more description). This property is \c true by default and may be * changed with setAutoResumed() method call. */ bool LightApp_Operation::isAutoResumed() const diff --git a/src/OBJECT/CMakeLists.txt b/src/OBJECT/CMakeLists.txt index e594ba3e1..b9ec2c5af 100755 --- a/src/OBJECT/CMakeLists.txt +++ b/src/OBJECT/CMakeLists.txt @@ -26,10 +26,10 @@ INCLUDE_DIRECTORIES( ) # additional preprocessor / compiler flags -ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS}) +ADD_DEFINITIONS(${CAS_DEFINITIONS}) # libraries to link to -SET(_link_LIBRARIES ${QT_LIBRARIES} ${CAS_LDPATH} ${CAS_KERNEL} ${CAS_TKV3d} ViewerData) +SET(_link_LIBRARIES ${CAS_LDPATH} ${CAS_KERNEL} ${CAS_TKV3d} ViewerData) # --- headers --- diff --git a/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx b/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx index b4ffbd215..c11065772 100644 --- a/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx +++ b/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx @@ -110,7 +110,7 @@ void OCCViewer_ClipPlaneInteractor::setEnabled( const bool theIsEnabled ) /*! \brief Checks whether the interactive operation is in progress. - \return TRUE if the interaction is performed on IO object meaning + \return \c true if the interaction is performed on IO object meaning that no other operations in viewer should be processed. */ bool OCCViewer_ClipPlaneInteractor::isPerforming() const @@ -120,7 +120,7 @@ bool OCCViewer_ClipPlaneInteractor::isPerforming() const /*! \brief Checks whether the interactive plane can be clicked. - \return TRUE if the click interaction is supported for the plane. + \return \c true if the click interaction is supported for the plane. */ bool OCCViewer_ClipPlaneInteractor::isClickable( const Handle(AIS_Plane)& thePlane ) { @@ -151,7 +151,7 @@ bool OCCViewer_ClipPlaneInteractor::isClickable( const Handle(AIS_Plane)& thePla /*! \brief Checks whether the interactive plane can be dragged. - \return TRUE if the dragging interaction is supported for the plane. + \return \c true if the dragging interaction is supported for the plane. */ bool OCCViewer_ClipPlaneInteractor::isDraggable( const Handle(AIS_Plane)& thePlane ) { diff --git a/src/OCCViewer/OCCViewer_ClippingDlg.cxx b/src/OCCViewer/OCCViewer_ClippingDlg.cxx index 37fc6c6d0..983b360c9 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.cxx +++ b/src/OCCViewer/OCCViewer_ClippingDlg.cxx @@ -570,15 +570,15 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg(OCCViewer_ViewWindow* parent , OCCV buttonOk = new QPushButton( GroupButtons ); buttonOk->setObjectName( "buttonOk" ); buttonOk->setText( tr( "BUT_APPLY_AND_CLOSE" ) ); - buttonOk->setAutoDefault( TRUE ); - buttonOk->setDefault( TRUE ); + buttonOk->setAutoDefault( true ); + buttonOk->setDefault( true ); GroupButtonsLayout->addWidget( buttonOk ); buttonApply = new QPushButton( GroupButtons ); buttonApply->setObjectName( "buttonApply" ); buttonApply->setText( tr( "BUT_APPLY" ) ); - buttonApply->setAutoDefault( TRUE ); - buttonApply->setDefault( TRUE ); + buttonApply->setAutoDefault( true ); + buttonApply->setDefault( true ); GroupButtonsLayout->addWidget( buttonApply ); GroupButtonsLayout->addStretch(); @@ -586,11 +586,11 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg(OCCViewer_ViewWindow* parent , OCCV buttonClose = new QPushButton( GroupButtons ); buttonClose->setObjectName( "buttonClose" ); buttonClose->setText( tr( "BUT_CLOSE" ) ); - buttonClose->setAutoDefault( TRUE ); + buttonClose->setAutoDefault( true ); GroupButtonsLayout->addWidget( buttonClose ); QPushButton* buttonHelp = new QPushButton( tr( "HELP" ), GroupButtons ); - buttonHelp->setAutoDefault( TRUE ); + buttonHelp->setAutoDefault( true ); GroupButtonsLayout->addWidget( buttonHelp ); /***************************************************************/ diff --git a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx index fd110bd38..4e7000696 100755 --- a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx +++ b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx @@ -144,11 +144,11 @@ void OCCViewer_CreateRestoreViewDlg::changeImage( QListWidgetItem* curItem ) highLevel = index; } for( int j = lowLevel; j <= highLevel; j++ ) - myListBox->item( j )->setSelected( TRUE ); + myListBox->item( j )->setSelected( true ); break; } if( myListBox->item( i )->isSelected() && i == index ) - myListBox->item( i )->setSelected( TRUE ); + myListBox->item( i )->setSelected( true ); } } diff --git a/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx b/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx index 591f5de82..f34af8b9e 100644 --- a/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx +++ b/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx @@ -52,7 +52,7 @@ OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWind setModal( modal ); setWindowTitle(tr("CAPTION")); - setSizeGripEnabled(TRUE); + setSizeGripEnabled(true); // Create layout for this dialog QGridLayout* layoutDlg = new QGridLayout (this); @@ -145,7 +145,7 @@ OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWind QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox ); m_bClose->setObjectName("m_bClose"); - m_bClose->setAutoDefault(TRUE); + m_bClose->setAutoDefault(true); m_bClose->setFixedSize(m_bClose->sizeHint()); connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose())); diff --git a/src/OCCViewer/OCCViewer_SetRotationPointDlg.h b/src/OCCViewer/OCCViewer_SetRotationPointDlg.h index 242e9c878..5b1490b48 100644 --- a/src/OCCViewer/OCCViewer_SetRotationPointDlg.h +++ b/src/OCCViewer/OCCViewer_SetRotationPointDlg.h @@ -46,7 +46,7 @@ class OCCVIEWER_EXPORT OCCViewer_SetRotationPointDlg : public QDialog public: OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* , - const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0); + const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); ~OCCViewer_SetRotationPointDlg(); void SetAction( QtxAction* theAction ) { myAction = theAction; } diff --git a/src/OCCViewer/OCCViewer_Utilities.cxx b/src/OCCViewer/OCCViewer_Utilities.cxx index 18e9096bc..baa9cbaa6 100755 --- a/src/OCCViewer/OCCViewer_Utilities.cxx +++ b/src/OCCViewer/OCCViewer_Utilities.cxx @@ -141,7 +141,7 @@ bool OCCViewer_Utilities::isDialogOpened( OCCViewer_ViewWindow* theView, const Q { bool isFound = false; OCCViewer_ViewFrame* aViewFrame = dynamic_cast( theView->parent()->parent() ); - QList allDialogs = qFindChildren( aViewFrame ); + QList allDialogs = aViewFrame->findChildren(); foreach ( QDialog* d, allDialogs ) if ( d->objectName() == theName ) isFound = true; diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index fe2546853..9e16a3923 100755 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -995,7 +995,7 @@ void OCCViewer_Viewer::contextMenuPopup(QMenu* thePopup) OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView()); //Support of several toolbars in the popup menu - QList lst = qFindChildren( aView ); + QList lst = aView->findChildren(); QList::const_iterator it = lst.begin(), last = lst.end(); for ( ; it!=last; it++ ) { if ( (*it)->parentWidget()->isVisible() ) diff --git a/src/OCCViewer/OCCViewer_ViewPort.cxx b/src/OCCViewer/OCCViewer_ViewPort.cxx index ceb5d22ee..36fd5e7d1 100755 --- a/src/OCCViewer/OCCViewer_ViewPort.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort.cxx @@ -459,36 +459,6 @@ QPaintEngine* OCCViewer_ViewPort::paintEngine() const return 0; } -/*! - Creates the popup. [ virtual protected ] -*/ -/*void OCCViewer_ViewPort::onCreatePopup( QPopupMenu* popup ) -{ - if ( popup ) - { - QtxAction* a = new QtxAction( "", tr( "MEN_VP_CHANGEBGR" ), 0, this ); - a->setStatusTip( tr( "PRP_VP_CHANGEBGR" ) ); - connect( a, SIGNAL( activated() ), SLOT( onChangeBgColor())); - myPopupActions.append( a ); - a->addTo( popup ); - } -}*/ - -/*! - Destroys the popup. [ virtual protected ] -*/ -/*void OCCViewer_ViewPort::onDestroyPopup( QPopupMenu* popup ) -{ - if ( popup ) - { - for ( QtxAction* a = myPopupActions.first(); a; a = myPopupActions.next() ) - a->removeFrom( popup ); - //while (!myPopupActions.isEmpty()) - // delete myPopupActions.takeFirst(); - myPopupActions.clear(); - } -}*/ - /*! Performs synchronization of view parameters with the specified view. Returns \c true if synchronization is done successfully or \c false otherwise. diff --git a/src/OCCViewer/OCCViewer_ViewPort.h b/src/OCCViewer/OCCViewer_ViewPort.h index f1e1412c3..ae7b9e650 100755 --- a/src/OCCViewer/OCCViewer_ViewPort.h +++ b/src/OCCViewer/OCCViewer_ViewPort.h @@ -91,10 +91,6 @@ protected: virtual void zoom( int, int, int, int ) = 0; virtual void fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0; -// POPUP -// void onCreatePopup( QPopupMenu* ); -// void onDestroyPopup( QPopupMenu* ); - public slots: virtual bool synchronize( OCCViewer_ViewPort* ); diff --git a/src/Plot2d/Plot2d_FitDataDlg.cxx b/src/Plot2d/Plot2d_FitDataDlg.cxx index 7d33637b0..bced039fc 100755 --- a/src/Plot2d/Plot2d_FitDataDlg.cxx +++ b/src/Plot2d/Plot2d_FitDataDlg.cxx @@ -48,7 +48,7 @@ Plot2d_FitDataDlg::Plot2d_FitDataDlg( QWidget* parent, bool secondAxisY ) setObjectName( "Plot2d_FitDataDlg" ); setModal( true ); setWindowTitle( tr( "FIT_DATA_TLT" ) ); - setSizeGripEnabled( TRUE ); + setSizeGripEnabled( true ); QGridLayout* topLayout = new QGridLayout( this ); topLayout->setSpacing( SPACING_SIZE ); topLayout->setMargin( MARGIN_SIZE ); @@ -154,11 +154,11 @@ Plot2d_FitDataDlg::Plot2d_FitDataDlg( QWidget* parent, bool secondAxisY ) // OK/Cancel buttons myOkBtn = new QPushButton( tr( "BUT_OK" ), this ); myOkBtn->setObjectName( "buttonOk" ); - myOkBtn->setAutoDefault( TRUE ); - myOkBtn->setDefault( TRUE ); + myOkBtn->setAutoDefault( true ); + myOkBtn->setDefault( true ); myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this ); myCancelBtn->setObjectName( "buttonCancel" ); - myCancelBtn->setAutoDefault( TRUE ); + myCancelBtn->setAutoDefault( true ); topLayout->addWidget( myRangeGrp, 0, 0, 1, 3 ); topLayout->addWidget( myOkBtn, 1, 0 ); diff --git a/src/Plot2d/Plot2d_PlotItems.cxx b/src/Plot2d/Plot2d_PlotItems.cxx index 2bd990364..2d585c08c 100644 --- a/src/Plot2d/Plot2d_PlotItems.cxx +++ b/src/Plot2d/Plot2d_PlotItems.cxx @@ -33,6 +33,8 @@ #include #include #include +#include + #include #include #include @@ -88,8 +90,8 @@ Plot2d_QwtLegendLabel::Plot2d_QwtLegendLabel( QWidget* parent ) : mySymbolType(0), myPen( QPen() ) { - myYAxisLeftIcon = yAxisLeft; - myYAxisRightIcon = yAxisRight; + myYAxisLeftIcon = QPixmap(yAxisLeft); + myYAxisRightIcon = QPixmap(yAxisRight); int anIconWidth = qMax( myYAxisLeftIcon.width(), myYAxisRightIcon.width() ); setSpacing( SPACING ); @@ -402,7 +404,7 @@ void Plot2d_QwtPlotCurve::drawSeries( QPainter *painter, if(hasDeviationData()) { painter->save(); int lineW = deviationMarkerLineWidth(); - int tickSz = deviationMarkerTickSize() + qRound(lineW/2); + int tickSz = deviationMarkerTickSize() + qRound(double(lineW)/2); double min, max, xi, yi; int xp, ytop, ybtm, tickl, tickr; QColor c = isSelected() ? Plot2d_Object::selectionColor() : deviationMarkerColor(); diff --git a/src/Plot2d/Plot2d_SetupViewDlg.cxx b/src/Plot2d/Plot2d_SetupViewDlg.cxx index a6bfb8708..4ef7b9364 100755 --- a/src/Plot2d/Plot2d_SetupViewDlg.cxx +++ b/src/Plot2d/Plot2d_SetupViewDlg.cxx @@ -68,7 +68,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, { setModal( true ); setWindowTitle( tr("TLT_SETUP_PLOT2D_VIEW") ); - setSizeGripEnabled( TRUE ); + setSizeGripEnabled( true ); QGridLayout* topLayout = new QGridLayout( this ); topLayout->setSpacing( SPACING_SIZE ); @@ -411,12 +411,12 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, /* OK/Cancel buttons */ myOkBtn = new QPushButton( tr( "BUT_OK" ), this ); - myOkBtn->setAutoDefault( TRUE ); - myOkBtn->setDefault( TRUE ); + myOkBtn->setAutoDefault( true ); + myOkBtn->setDefault( true ); myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this ); - myCancelBtn->setAutoDefault( TRUE ); + myCancelBtn->setAutoDefault( true ); myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this ); - myHelpBtn->setAutoDefault( TRUE ); + myHelpBtn->setAutoDefault( true ); QHBoxLayout* btnLayout = new QHBoxLayout; btnLayout->addWidget( myOkBtn ); btnLayout->addStretch(); diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index db3e2acc5..efa7311c7 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -75,13 +75,11 @@ #include #include #include +#include +#include #include #include -#include - -#include -#include #define DEFAULT_LINE_WIDTH 0 // (default) line width #define DEFAULT_MARKER_SIZE 9 // default marker size @@ -1642,10 +1640,10 @@ void Plot2d_ViewFrame::getFitRangeByMarkers(double& xMin, double& xMax, */ int Plot2d_ViewFrame::testOperation( const QMouseEvent& me ) { - int btn = me.button() | me.modifiers(); - const int zoomBtn = Qt::ControlModifier | Qt::LeftButton; - const int panBtn = Qt::ControlModifier | Qt::MidButton; - const int fitBtn = Qt::ControlModifier | Qt::RightButton; + int btn = (int)me.button() | (int)me.modifiers(); + const int zoomBtn = (int)Qt::ControlModifier | (int)Qt::LeftButton; + const int panBtn = (int)Qt::ControlModifier | (int)Qt::MidButton; + const int fitBtn = (int)Qt::ControlModifier | (int)Qt::RightButton; int op = NoOpId; if ( btn == zoomBtn ) { @@ -2683,7 +2681,7 @@ void Plot2d_ViewFrame::plotMousePressed( const QMouseEvent& me ) } } else { - int btn = me.button() | me.modifiers(); + int btn = (int)me.button() | (int)me.modifiers(); if (btn == Qt::RightButton) { QMouseEvent* aEvent = new QMouseEvent(QEvent::MouseButtonPress, me.pos(), me.button(), me.buttons(), me.modifiers() ); diff --git a/src/PyConsole/PyConsole_EnhEditor.cxx b/src/PyConsole/PyConsole_EnhEditor.cxx index 38cb69365..d4cf274a2 100644 --- a/src/PyConsole/PyConsole_EnhEditor.cxx +++ b/src/PyConsole/PyConsole_EnhEditor.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include "PyConsole_EnhEditor.h" #include "PyConsole_EnhInterp.h" @@ -417,7 +418,7 @@ QString PyConsole_EnhEditor::formatDocHTML(const QString & doc) const * If the pasted text doesn't contain a line return, no special treatment is done. * @param source */ -void PyConsole_EnhEditor::insertFromMimeData(const QMimeData * source) +void PyConsole_EnhEditor::insertFromMimeData(const QMimeData* source) { if (_multi_line_paste) return; diff --git a/src/PyConsole/PyConsole_EnhEditor.h b/src/PyConsole/PyConsole_EnhEditor.h index 8f8fc9cb9..f505066d3 100644 --- a/src/PyConsole/PyConsole_EnhEditor.h +++ b/src/PyConsole/PyConsole_EnhEditor.h @@ -75,7 +75,7 @@ protected: virtual void keyPressEvent ( QKeyEvent* event); virtual void customEvent( QEvent* event); virtual void mousePressEvent( QMouseEvent* event ); - virtual void insertFromMimeData(const QMimeData * source); + virtual void insertFromMimeData(const QMimeData* source); virtual PyInterp_Request* createTabRequest( const QString& input ); virtual void handleTab(); diff --git a/src/PyEditor/PyEditor_SettingsDlg.cxx b/src/PyEditor/PyEditor_SettingsDlg.cxx index 83f0e381e..247c02e7c 100644 --- a/src/PyEditor/PyEditor_SettingsDlg.cxx +++ b/src/PyEditor/PyEditor_SettingsDlg.cxx @@ -123,12 +123,12 @@ PyEditor_SettingsDlg::PyEditor_SettingsDlg( PyEditor_Editor* theEditor, QWidget* aMainLayout->addStretch( 1 ); myOkBtn = new QPushButton( tr( "BUT_OK" ), this ); - myOkBtn->setAutoDefault( TRUE ); - myOkBtn->setDefault( TRUE ); + myOkBtn->setAutoDefault( true ); + myOkBtn->setDefault( true ); myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this ); - myCancelBtn->setAutoDefault( TRUE ); + myCancelBtn->setAutoDefault( true ); myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this ); - myHelpBtn->setAutoDefault( TRUE ); + myHelpBtn->setAutoDefault( true ); QHBoxLayout* aButtonLayout = new QHBoxLayout; aButtonLayout->addWidget( myOkBtn ); aButtonLayout->addStretch(); diff --git a/src/PyViewer/PyViewer_ViewWindow.cxx b/src/PyViewer/PyViewer_ViewWindow.cxx index 3fcdb0f63..ea300e42c 100644 --- a/src/PyViewer/PyViewer_ViewWindow.cxx +++ b/src/PyViewer/PyViewer_ViewWindow.cxx @@ -33,8 +33,13 @@ #include #include -#include #include +#include +#include +#include +#include +#include +#include /*! \class PyViewer_ViewWindow diff --git a/src/QDS/QDS_Datum.cxx b/src/QDS/QDS_Datum.cxx index d8eadcad7..0b74d0d4b 100644 --- a/src/QDS/QDS_Datum.cxx +++ b/src/QDS/QDS_Datum.cxx @@ -902,7 +902,7 @@ void QDS_Datum::setShown( const bool visible, const int flags ) while ( flag ) { if ( flags & flag && widget( flag ) ) - widget( flag )->setShown( visible ); + widget( flag )->setVisible( visible ); flag = flag >> 1; } } diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index 1a85d9853..f43ec8504 100755 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -673,7 +673,7 @@ QString Qtx::findEnvVar( const QString& str, int& start, int& len ) if ( pos != -1 ) { int i = 1; - while ( i <= rx.numCaptures() && varName.isEmpty() ) + while ( i <= rx.captureCount() && varName.isEmpty() ) { QString capStr = rx.cap( i ); if ( !capStr.contains( "%" ) && !capStr.contains( "$" ) ) @@ -688,7 +688,7 @@ QString Qtx::findEnvVar( const QString& str, int& start, int& len ) int end = start + varName.length(); if ( capIdx > 1 && rx.cap( capIdx - 1 ).contains( QRegExp( "\\$|%" ) ) ) start = rx.pos( capIdx - 1 ) + rx.cap( capIdx - 1 ).indexOf( QRegExp( "\\$|%" ) ); - if ( capIdx < rx.numCaptures() && !rx.cap( capIdx - 1 ).isEmpty() ) + if ( capIdx < rx.captureCount() && !rx.cap( capIdx - 1 ).isEmpty() ) end++; len = end - start; } @@ -863,7 +863,7 @@ QImage Qtx::grayscale( const QImage& img ) { QImage res = img; - int colNum = res.numColors(); + int colNum = res.colorCount(); if ( colNum ) { for ( int i = 0; i < colNum; i++ ) diff --git a/src/Qtx/QtxActionToolMgr.cxx b/src/Qtx/QtxActionToolMgr.cxx index c47ba73f8..4c368f609 100644 --- a/src/Qtx/QtxActionToolMgr.cxx +++ b/src/Qtx/QtxActionToolMgr.cxx @@ -229,7 +229,7 @@ QToolBar* QtxActionToolMgr::find( const QString& title, QMainWindow* mw ) const QString pattern = title.toLower(); QToolBar* res = 0; - QList toolbars = qFindChildren( mw ); + QList toolbars = mw->findChildren(); for ( QList::iterator it = toolbars.begin(); it != toolbars.end() && !res; ++it ) { if ( (*it)->windowTitle().toLower() == pattern ) diff --git a/src/Qtx/QtxColorButton.cxx b/src/Qtx/QtxColorButton.cxx index 8bb4769ad..de2fe97da 100644 --- a/src/Qtx/QtxColorButton.cxx +++ b/src/Qtx/QtxColorButton.cxx @@ -325,7 +325,7 @@ void QtxColorButton::paintEvent( QPaintEvent* e ) */ void QtxColorButton::updateState() { - QList bList = qFindChildren( menu() ); + QList bList = menu()->findChildren(); for ( QList::iterator cit = bList.begin(); cit != bList.end(); ++cit ) updateButton( *cit ); } diff --git a/src/Qtx/QtxDialog.cxx b/src/Qtx/QtxDialog.cxx index 37574e2d7..a757120fc 100755 --- a/src/Qtx/QtxDialog.cxx +++ b/src/Qtx/QtxDialog.cxx @@ -1327,7 +1327,7 @@ void QtxDialog::keyPressEvent( QKeyEvent* e ) if ( e->key() == Qt::Key_Tab && e->modifiers() & Qt::ControlModifier ) { - QObject* tab = qFindChild( this ); + QObject* tab = this->findChild(); if ( tab && !property( "in_tab_event" ).toBool() ) { setProperty( "in_tab_event", true ); QApplication::sendEvent( tab, e ); diff --git a/src/Qtx/QtxDockAction.cxx b/src/Qtx/QtxDockAction.cxx index c4e827f3b..946279d9e 100755 --- a/src/Qtx/QtxDockAction.cxx +++ b/src/Qtx/QtxDockAction.cxx @@ -152,7 +152,7 @@ void QtxDockAction::toolBars( QList& lst ) const if ( !mw ) return; - QList toolbars = qFindChildren( mw ); + QList toolbars = mw->findChildren(); for ( QList::iterator it = toolbars.begin(); it != toolbars.end(); ++it ) { QToolBar* tb = *it; @@ -173,7 +173,7 @@ void QtxDockAction::dockWidgets( QList& lst ) const if ( !mw ) return; - QList dockwidgets = qFindChildren( mw ); + QList dockwidgets = mw->findChildren(); for ( QList::iterator it = dockwidgets.begin(); it != dockwidgets.end(); ++it ) { QDockWidget* dw = *it; diff --git a/src/Qtx/QtxFontEdit.cxx b/src/Qtx/QtxFontEdit.cxx index 2e23aec54..bc50f2994 100644 --- a/src/Qtx/QtxFontEdit.cxx +++ b/src/Qtx/QtxFontEdit.cxx @@ -376,8 +376,8 @@ void QtxFontEdit::setMode( const int mode ) myMode = mode; - myFamily->setShown( myMode == Native ); - myCustomFams->setShown( myMode == Custom ); + myFamily->setVisible( myMode == Native ); + myCustomFams->setVisible( myMode == Custom ); updateGeometry(); } diff --git a/src/Qtx/QtxMainWindow.cxx b/src/Qtx/QtxMainWindow.cxx index f7af18db8..1e1bf6641 100644 --- a/src/Qtx/QtxMainWindow.cxx +++ b/src/Qtx/QtxMainWindow.cxx @@ -215,7 +215,7 @@ void QtxMainWindow::Resizer::setFilters( bool on ) myMain->layout()->removeEventFilter( this ); } - QTimer* t = qFindChild( myMain->layout() ); + QTimer* t = myMain->layout()->findChild(); if ( t ) { if ( on ) t->installEventFilter( this ); diff --git a/src/Qtx/QtxPathDialog.cxx b/src/Qtx/QtxPathDialog.cxx index 0fefcd6bb..da7d3c29f 100755 --- a/src/Qtx/QtxPathDialog.cxx +++ b/src/Qtx/QtxPathDialog.cxx @@ -241,7 +241,7 @@ void QtxPathDialog::onBrowse() { QStringList fList = prepareFilters( entry.filter ); if ( !fList.isEmpty() ) - entry.dlg->setFilters( fList ); + entry.dlg->setNameFilters( fList ); } entry.dlg->selectFile( fileName( id ) ); @@ -255,10 +255,10 @@ void QtxPathDialog::onBrowse() return; if ( Qtx::extension( fName ).isEmpty() && !isDir ) - fName = autoExtension( fName, entry.dlg->selectedFilter() ); + fName = autoExtension( fName, entry.dlg->selectedNameFilter() ); - fName = QDir::convertSeparators( fName ); - QString prev = QDir::convertSeparators( fileName( id ) ); + fName = QDir::toNativeSeparators( fName ); + QString prev = QDir::toNativeSeparators( fileName( id ) ); if ( isDir ) { while ( prev.length() && prev.at( prev.length() - 1 ) == QDir::separator() ) @@ -701,7 +701,7 @@ QString QtxPathDialog::autoExtension( const QString& theFileName, const QString& ext = ext.mid( ext.indexOf( "." ) + 1 ); if ( !ext.isEmpty() && !ext.contains( "*" ) ) - fName = QDir::convertSeparators( fName ) + QString( "." ) + ext; + fName = QDir::toNativeSeparators( fName ) + QString( "." ) + ext; } return fName; diff --git a/src/Qtx/QtxPathEdit.cxx b/src/Qtx/QtxPathEdit.cxx index 67b5dfa45..acc0120b8 100644 --- a/src/Qtx/QtxPathEdit.cxx +++ b/src/Qtx/QtxPathEdit.cxx @@ -211,7 +211,7 @@ void QtxPathEdit::onBrowse( bool /*on*/ ) } if ( !path.isEmpty() ) - myPath->setText( QDir::convertSeparators( path ) ); + myPath->setText( QDir::toNativeSeparators( path ) ); myPath->setFocus(); diff --git a/src/Qtx/QtxPreferenceMgr.cxx b/src/Qtx/QtxPreferenceMgr.cxx index db5c0f9aa..bfdcc1d66 100644 --- a/src/Qtx/QtxPreferenceMgr.cxx +++ b/src/Qtx/QtxPreferenceMgr.cxx @@ -391,7 +391,7 @@ void QtxPreferenceItem::resource( QString& sec, QString& param ) const */ void QtxPreferenceItem::setIcon( const QIcon& ico ) { - if ( myIcon.serialNumber() == ico.serialNumber() ) + if ( myIcon.cacheKey() == ico.cacheKey() ) return; myIcon = ico; diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index 35f052e03..fbc7e44ab 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -377,7 +377,7 @@ QString QtxResourceMgr::Resources::fileName( const QString& sect, const QString& } if( !path.isEmpty() ) { - QString fname = QDir::convertSeparators( path ); + QString fname = QDir::toNativeSeparators( path ); QFileInfo inf( fname ); fname = inf.absoluteFilePath(); return fname; @@ -423,7 +423,7 @@ QPixmap QtxResourceMgr::Resources::loadPixmap( const QString& sect, const QStrin QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, const QString& prefix, const QString& name ) const { QTranslator* trans = new QtxTranslator( 0 ); - QString fname = QDir::convertSeparators( fileName( sect, prefix, name ) ); + QString fname = QDir::toNativeSeparators( fileName( sect, prefix, name ) ); if ( !trans->load( Qtx::file( fname, false ), Qtx::dir( fname ) ) ) { delete trans; @@ -610,7 +610,7 @@ bool QtxResourceMgr::IniFormat::load( const QString& fname, QMapsetMargin( 0 ); myClose = new QToolButton( myBtnWidget ); - myClose->setIcon( QIcon( close_xpm ) ); + myClose->setIcon( QPixmap( close_xpm ) ); myClose->setAutoRaise( true ); myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myClose ) ); connect( myClose, SIGNAL( clicked() ), this, SLOT( hide() ) ); @@ -899,28 +899,28 @@ void QtxSearchTool::init( Qt::Orientation orientation ) myData->installEventFilter( this ); myToFirst = new QToolButton( myBtnWidget ); - myToFirst->setIcon( QIcon( first_xpm ) ); + myToFirst->setIcon( QPixmap( first_xpm ) ); myToFirst->setAutoRaise( true ); myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myToFirst ), 0 ); connect( myToFirst, SIGNAL( clicked() ), this, SLOT( findFirst() ) ); myToFirst->installEventFilter( this ); myPrev = new QToolButton( myBtnWidget ); - myPrev->setIcon( QIcon( prev_xpm ) ); + myPrev->setIcon( QPixmap( prev_xpm ) ); myPrev->setAutoRaise( true ); myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myPrev ), 0 ); connect( myPrev, SIGNAL( clicked() ), this, SLOT( findPrevious() ) ); myPrev->installEventFilter( this ); myNext = new QToolButton( myBtnWidget ); - myNext->setIcon( QIcon( next_xpm ) ); + myNext->setIcon( QPixmap( next_xpm ) ); myNext->setAutoRaise( true ); myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myNext ), 0 ); connect( myNext, SIGNAL( clicked() ), this, SLOT( findNext() ) ); myNext->installEventFilter( this ); myToLast = new QToolButton( myBtnWidget ); - myToLast->setIcon( QIcon( last_xpm ) ); + myToLast->setIcon( QPixmap( last_xpm ) ); myToLast->setAutoRaise( true ); myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myToLast ), 0 ); connect( myToLast, SIGNAL( clicked() ), this, SLOT( findLast() ) ); diff --git a/src/Qtx/QtxTreeView.cxx b/src/Qtx/QtxTreeView.cxx index 291292357..a171f535f 100644 --- a/src/Qtx/QtxTreeView.cxx +++ b/src/Qtx/QtxTreeView.cxx @@ -107,10 +107,10 @@ void QtxTreeView::Header::contextMenuEvent( QContextMenuEvent* e ) QVariant appropriate = model()->headerData( i, orientation(), Qtx::AppropriateRole ); QIcon icon; if ( iconData.isValid() ) { - if ( qVariantCanConvert( iconData ) ) - icon = qVariantValue( iconData ); - else if ( qVariantCanConvert( iconData ) ) - icon = qVariantValue( iconData ); + if ( iconData.canConvert( QVariant::Icon ) ) + icon = iconData.value(); + else if ( iconData.canConvert( QVariant::Pixmap ) ) + icon = iconData.value(); } if( ( !lab.isEmpty() || !icon.isNull() ) && appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true ) diff --git a/src/Qtx/QtxWebBrowser.cxx b/src/Qtx/QtxWebBrowser.cxx index 146029464..304ce6145 100644 --- a/src/Qtx/QtxWebBrowser.cxx +++ b/src/Qtx/QtxWebBrowser.cxx @@ -394,10 +394,10 @@ QtxWebBrowser::QtxWebBrowser( ) : QMainWindow( 0 ) connect( myWebView, SIGNAL( linkClicked( QUrl ) ), SLOT( linkClicked( QUrl ) ) ); connect( myWebView->page(), SIGNAL( linkHovered( QString, QString, QString ) ), SLOT( linkHovered( QString, QString, QString ) ) ); - connect( myWebView->pageAction( QWebPage::DownloadLinkToDisk ), SIGNAL( activated() ), + connect( myWebView->pageAction( QWebPage::DownloadLinkToDisk ), SIGNAL( triggered() ), SLOT( linkAction() ) ); disconnect( myWebView->pageAction( QWebPage::OpenLink ), 0, 0, 0 ); - connect( myWebView->pageAction( QWebPage::OpenLink ), SIGNAL( activated() ), + connect( myWebView->pageAction( QWebPage::OpenLink ), SIGNAL( triggered() ), SLOT( linkAction() ) ); setCentralWidget( frame ); @@ -621,11 +621,15 @@ void QtxWebBrowser::openLink( const QString& fileName, bool force ) \brief Load URL \param url path to the file to be opened in the browser */ -void QtxWebBrowser::load( const QString& url ) +void QtxWebBrowser::load( const QString& link ) { - QString u = url; - if ( !u.isEmpty() ) - myWebView->load( QUrl( u.replace('\\', '/') ) ); + QString linkPath = link; + linkPath.replace('\\', '/'); + QUrl url = linkPath; + if ( !url.isEmpty() ) { + if ( url.scheme().isEmpty() ) url.setScheme( "file" ); + myWebView->load( url ); + } } /*! diff --git a/src/Qtx/QtxWorkspace.cxx b/src/Qtx/QtxWorkspace.cxx index c7af11e52..b8ad4fc05 100644 --- a/src/Qtx/QtxWorkspace.cxx +++ b/src/Qtx/QtxWorkspace.cxx @@ -22,7 +22,7 @@ // #include "QtxWorkspace.h" -#include +#include /*! \class QtxWorkspace @@ -38,7 +38,7 @@ \param parent parent widget */ QtxWorkspace::QtxWorkspace( QWidget* parent ) -: QWorkspace( parent ) +: QMdiArea( parent ) { } @@ -54,24 +54,24 @@ QtxWorkspace::~QtxWorkspace() */ void QtxWorkspace::tileVertical() { - QWidgetList winList = windowList(); + QList winList = subWindowList(); if ( winList.isEmpty() ) return; int count = 0; - for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr ) + for ( QList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr ) if ( !( (*itr)->windowState() & Qt::WindowMinimized ) ) count++; if ( !count ) return; - if ( activeWindow() && ( activeWindow()->windowState() & Qt::WindowMaximized ) ) - activeWindow()->showNormal(); + if ( activeSubWindow() && ( activeSubWindow()->windowState() & Qt::WindowMaximized ) ) + activeSubWindow()->showNormal(); int y = 0; int heightForEach = height() / count; - for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it ) + for ( QList::iterator it = winList.begin(); it != winList.end(); ++it ) { QWidget* win = *it; if ( win->windowState() & Qt::WindowMinimized ) @@ -98,24 +98,24 @@ void QtxWorkspace::tileVertical() */ void QtxWorkspace::tileHorizontal() { - QWidgetList winList = windowList(); + QList winList = subWindowList(); if ( winList.isEmpty() ) return; int count = 0; - for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr ) + for ( QList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr ) if ( !( (*itr)->windowState() & Qt::WindowMinimized ) ) count++; if ( !count ) return; - if ( activeWindow() && activeWindow()->windowState() & Qt::WindowMaximized ) - activeWindow()->showNormal(); + if ( activeSubWindow() && activeSubWindow()->windowState() & Qt::WindowMaximized ) + activeSubWindow()->showNormal(); int x = 0; int widthForEach = width() / count; - for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it ) + for ( QList::iterator it = winList.begin(); it != winList.end(); ++it ) { QWidget* win = *it; if ( win->windowState() & Qt::WindowMinimized ) @@ -136,3 +136,11 @@ void QtxWorkspace::tileHorizontal() x += actualW; } } + +void QtxWorkspace::onSubWindowActivated( QMdiSubWindow* subWindow ) +{ + QWidget* w = 0; + if ( subWindow ) + w = subWindow->widget(); + emit windowActivated( w ); +} diff --git a/src/Qtx/QtxWorkspace.h b/src/Qtx/QtxWorkspace.h index 87c3b8ed8..fe7559498 100644 --- a/src/Qtx/QtxWorkspace.h +++ b/src/Qtx/QtxWorkspace.h @@ -25,13 +25,13 @@ #include "Qtx.h" -#include +#include #ifdef WIN32 #pragma warning( disable:4251 ) #endif -class QTX_EXPORT QtxWorkspace : public QWorkspace +class QTX_EXPORT QtxWorkspace : public QMdiArea { Q_OBJECT @@ -39,9 +39,15 @@ public: QtxWorkspace( QWidget* = 0 ); virtual ~QtxWorkspace(); +signals: + void windowActivated( QWidget* ); + public slots: void tileVertical(); void tileHorizontal(); + +private slots: + void onSubWindowActivated( QMdiSubWindow* ); }; #ifdef WIN32 diff --git a/src/Qtx/QtxWorkspaceAction.cxx b/src/Qtx/QtxWorkspaceAction.cxx index 5bac837df..c5c939184 100644 --- a/src/Qtx/QtxWorkspaceAction.cxx +++ b/src/Qtx/QtxWorkspaceAction.cxx @@ -28,7 +28,7 @@ #include "QtxWorkspace.h" #include -#include +#include /*! \class QtxWorkspaceAction @@ -238,7 +238,7 @@ void QtxWorkspaceAction::tile() { QtxWorkspace* ws = workspace(); if ( ws ) - ws->tile(); + ws->tileSubWindows(); } /*! @@ -250,13 +250,13 @@ void QtxWorkspaceAction::cascade() if ( !ws ) return; - ws->cascade(); + ws->cascadeSubWindows(); int w = ws->width(); int h = ws->height(); - QWidgetList winList = ws->windowList(); - for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it ) + QList winList = ws->subWindowList(); + for ( QList::iterator it = winList.begin(); it != winList.end(); ++it ) (*it)->resize( int( w * 0.8 ), int( h * 0.8 ) ); } @@ -311,11 +311,11 @@ void QtxWorkspaceAction::removedFrom( QWidget* w ) */ void QtxWorkspaceAction::updateContent() { - bool count = workspace() ? workspace()->windowList().count() : 0; - action( Cascade )->setEnabled( count ); - action( Tile )->setEnabled( count ); - action( HTile )->setEnabled( count ); - action( VTile )->setEnabled( count ); + bool hasWindows = workspace() && workspace()->subWindowList().count() > 0; + action( Cascade )->setEnabled( hasWindows ); + action( Tile )->setEnabled( hasWindows ); + action( HTile )->setEnabled( hasWindows ); + action( VTile )->setEnabled( hasWindows ); updateWindows(); } @@ -345,12 +345,12 @@ void QtxWorkspaceAction::updateWindows() if ( menuActions() & Windows ) { int index = 1; - QWidgetList wList = ws->windowList(); - for ( QWidgetList::iterator it = wList.begin(); it != wList.end(); ++it, index++ ) + QList wList = ws->subWindowList(); + for ( QList::iterator it = wList.begin(); it != wList.end(); ++it, index++ ) { QWidget* wid = *it; QAction* a = new QtxAction( wid->windowTitle(), wid->windowTitle(), 0, this, true ); - a->setChecked( wid == ws->activeWindow() ); + a->setChecked( wid == ws->activeSubWindow() ); items.append( a ); map.insert( a, Windows + index ); } @@ -396,7 +396,7 @@ void QtxWorkspaceAction::activateItem( const int idx ) if ( !ws ) return; - QWidgetList wList = ws->windowList(); + QList wList = ws->subWindowList(); if ( idx >= 0 && idx < (int)wList.count() ) wList.at( idx )->setFocus(); } diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 6721d6d8a..684f1cb8e 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -2651,7 +2651,7 @@ void QtxWorkstack::insertWidget( QWidget* wid, QWidget* pWid, QWidget* after ) for ( QWidgetList::iterator itr = moveList.begin(); itr != moveList.end(); ++itr ) { (*itr)->setParent( pWid ); - (*itr)->setShown( map.contains( *itr ) ? map[*itr] : false ); + (*itr)->setVisible( map.contains( *itr ) ? map[*itr] : false ); } } @@ -3309,7 +3309,7 @@ QtxWorkstackArea* QtxWorkstack::wgArea( QWidget* wid ) const \param wid_to widget specified the destination area \param before specifies whether the first widget has to be moved before or after the second widget - \return TRUE if operation is completed successfully, FALSE otherwise + \return \c true if operation is completed successfully, \c false otherwise */ bool QtxWorkstack::move( QWidget* wid, QWidget* wid_to, const bool before ) { @@ -3345,7 +3345,7 @@ bool QtxWorkstack::move( QWidget* wid, QWidget* wid_to, const bool before ) /*! \brief Group all windows in one area - \return TRUE if operation is completed successfully, FALSE otherwise + \return \c true if operation is completed successfully, \c false otherwise */ void QtxWorkstack::stack() { diff --git a/src/Qtx/QtxWorkstackAction.cxx b/src/Qtx/QtxWorkstackAction.cxx index 09bf5eeb1..c8ada5382 100644 --- a/src/Qtx/QtxWorkstackAction.cxx +++ b/src/Qtx/QtxWorkstackAction.cxx @@ -524,12 +524,12 @@ QtxSplitDlg::QtxSplitDlg( QWidget* parent, QtxWorkstack* workstack, QtxSplitDlgM // Buttons for possibility of switching the variants of split myButtonPrevious = new QPushButton( this ); - myButtonPrevious->setIcon( QIcon( prev_xpm ) ); + myButtonPrevious->setIcon( QPixmap( prev_xpm ) ); myButtonPrevious->setAutoDefault(true); myButtonPrevious->setEnabled( false ); myButtonNext = new QPushButton( this ); - myButtonNext->setIcon( QIcon( next_xpm ) ); + myButtonNext->setIcon( QPixmap( next_xpm ) ); myButtonNext->setAutoDefault(true); myButtonNext->setEnabled( false ); diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt b/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt index ca6a50173..c7b630390 100755 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(UseQt4Ext) IF(SALOME_USE_VTKVIEWER) INCLUDE(${VTK_USE_FILE}) ENDIF() diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt b/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt index 705323f50..7bd2c7799 100755 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(UseQt4Ext) INCLUDE(UsePyQt4) IF(SALOME_USE_VTKVIEWER) INCLUDE(${VTK_USE_FILE}) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight.sip b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight.sip index 10de9c3ed..887c6ceab 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight.sip +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_GUILight.sip @@ -22,5 +22,6 @@ %Module SalomePyQtGUILight +%Import QtCore/QtCoremod.sip %Import QtGui/QtGuimod.sip %Import QtXml/QtXmlmod.sip diff --git a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt index e77ddf6ae..6fcaba594 100755 --- a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt +++ b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(UseQt4Ext) INCLUDE(UsePyQt4) IF(SALOME_USE_VTKVIEWER) INCLUDE(${VTK_USE_FILE}) diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index f130b4e32..389409921 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -120,7 +120,7 @@ namespace PyModuleHelper* getPythonHelper() { LightApp_Module* module = getActiveModule(); - PyModuleHelper* helper = module ? qFindChild( module, "python_module_helper" ) : 0; + PyModuleHelper* helper = module ? module->findChild( "python_module_helper" ) : 0; return helper; } @@ -1940,7 +1940,7 @@ public: myResult = (QAction*)module->createAction( myId, myTipText, icon, myMenuText, myStatusText, myKey, module, myToggle ); } // for Python module, automatically connect action to callback slot - PyModuleHelper* helper = qFindChild( module, "python_module_helper" ); + PyModuleHelper* helper = module->findChild( "python_module_helper" ); if ( helper ) helper->connectAction( myResult ); } } @@ -2561,7 +2561,7 @@ public: // specific processing for ParaView viewer: // hierarchy of ParaView viewer is much complex than for usual view; // we look for sub-widget named "Viewport" - QList lst = qFindChildren( wnd, "Viewport" ); + QList lst = wnd->findChildren( "Viewport" ); if ( !lst.isEmpty() ) { lst[0]->resize( myWndWidth, myWndHeight ); myResult = true; @@ -2714,7 +2714,7 @@ public: QWidget* wnd = viewMgr->getActiveView(); myResult = viewMgr->getActiveView()->getId(); if ( wnd ) { - wnd->setShown(myVisible); + wnd->setVisible(myVisible); if ( !myVisible && myWidth == 0 && myHeight == 0 ) { myWidth = 1024; myHeight = 768; diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip index aa1a95104..7db98bcf9 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip @@ -28,6 +28,7 @@ %Feature ENABLE_CORBA %Feature ENABLE_PLOT2D +%Import QtCore/QtCoremod.sip %Import QtGui/QtGuimod.sip %Import QtXml/QtXmlmod.sip @@ -39,6 +40,7 @@ #include #include #include +#include #include %End @@ -206,6 +208,32 @@ private: QtxActionGroup( const QtxActionGroup& ); }; +class QtxTreeView : public QTreeView +{ +%TypeHeaderCode +#include +%End + +%ConvertToSubClassCode + if ( qobject_cast( sipCpp ) ) + sipClass = sipClass_QtxTreeView; + else + sipClass = NULL; +%End + +public: + explicit QtxTreeView( QWidget* /TransferThis/ = 0 ); + QtxTreeView( const bool, QWidget* /TransferThis/ = 0 ); + virtual ~QtxTreeView(); + +signals: + void sortingEnabled( bool ); + void selectionChanged(); + +private: + QtxTreeView( const QtxTreeView& ); +}; + enum VisibilityState { ShownState, diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index 3ec5a29d6..f2815832e 100755 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -321,7 +321,7 @@ void STD_Application::onOpenDoc() onOpenDoc( aName ); } -/*! \retval true, if document was opened successful, else false.*/ +/*! \retval \c true, if document was opened successful, else \c false.*/ bool STD_Application::onOpenDoc( const QString& aName ) { if ( !abortAllOperations() ) @@ -457,7 +457,7 @@ bool STD_Application::closeActiveDoc( bool permanently ) } /*!Check the application on closing. - * \retval true if possible, else false + * \retval \c true if possible, else \c false */ bool STD_Application::isPossibleToClose( bool& closePermanently ) { @@ -598,7 +598,7 @@ void STD_Application::onSaveDoc() onSaveAsDoc(); } -/*! \retval TRUE, if doument saved successful, else FALSE.*/ +/*! \retval \c true, if document saved successfully, else \c false.*/ bool STD_Application::onSaveAsDoc() { SUIT_Study* study = activeStudy(); @@ -669,7 +669,7 @@ void STD_Application::setEditEnabled( bool theEnable ) } } -/*!\retval true, if document opened successful, else false.*/ +/*!\retval \c true, if document opened successfully, else \c false.*/ bool STD_Application::useFile(const QString& theFileName) { bool res = SUIT_Application::useFile( theFileName ); @@ -819,7 +819,7 @@ void STD_Application::clearViewManagers() } } -/*!\retval TRUE, if view manager \a vm, already in view manager list (\a myViewMgrs).*/ +/*!\retval \c true, if view manager \a vm, already in view manager list (\a myViewMgrs).*/ bool STD_Application::containsViewManager( SUIT_ViewManager* vm ) const { return myViewMgrs.contains( vm ); @@ -831,7 +831,7 @@ void STD_Application::onViewManagerActivated( SUIT_ViewManager* vm ) setActiveViewManager( vm ); } -/*!Sets status bar show, if \on = true, else status bar hide.*/ +/*!Shows status bar, if on is \c true, else hides status bar.*/ void STD_Application::onViewStatusBar( bool on ) { if ( on ) diff --git a/src/STD/STD_MDIDesktop.cxx b/src/STD/STD_MDIDesktop.cxx index 9ec6f70ca..3feae0641 100755 --- a/src/STD/STD_MDIDesktop.cxx +++ b/src/STD/STD_MDIDesktop.cxx @@ -32,6 +32,7 @@ #include #include +#include #include @@ -71,13 +72,7 @@ STD_MDIDesktop::~STD_MDIDesktop() */ SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const { - SUIT_ViewWindow* wnd = 0; - - QWidget* wid = myWorkspace->activeWindow(); - if ( wid && wid->inherits( "SUIT_ViewWindow" ) ) - wnd = (SUIT_ViewWindow*)wid; - - return wnd; + return qobject_cast( myWorkspace->activeSubWindow()->widget() ); } /*! @@ -87,10 +82,10 @@ QList STD_MDIDesktop::windows() const { QList winList; - QWidgetList children = myWorkspace->windowList(); - for ( QWidgetList::iterator it = children.begin(); it != children.end(); ++it ) + QList children = myWorkspace->subWindowList(); + for ( QList::iterator it = children.begin(); it != children.end(); ++it ) { - SUIT_ViewWindow* vw = ::qobject_cast( *it ); + SUIT_ViewWindow* vw = ::qobject_cast( (*it)->widget() ); if ( vw ) winList.append( vw ); } @@ -106,7 +101,7 @@ void STD_MDIDesktop::addWindow( QWidget* w ) if ( !w || !workspace() ) return; - workspace()->addWindow( w ); + workspace()->addSubWindow( w ); } /*!Call method perform for operation \a type.*/ diff --git a/src/SUIT/SUIT_ActionOperation.cxx b/src/SUIT/SUIT_ActionOperation.cxx index 62c565315..473b97554 100644 --- a/src/SUIT/SUIT_ActionOperation.cxx +++ b/src/SUIT/SUIT_ActionOperation.cxx @@ -84,7 +84,7 @@ void SUIT_ActionOperation::setAction( QtxAction* a ) } /*! Add action to widget \a wid. - *\retval TRUE - successful, FALSE - not successful. + *\retval true - successful, false - not successful. */ bool SUIT_ActionOperation::addTo( QWidget* wid ) { diff --git a/src/SUIT/SUIT_Application.cxx b/src/SUIT/SUIT_Application.cxx index 811be3e9a..cf33187fb 100755 --- a/src/SUIT/SUIT_Application.cxx +++ b/src/SUIT/SUIT_Application.cxx @@ -85,8 +85,8 @@ SUIT_Desktop* SUIT_Application::desktop() } /*! - \return FALSE if application can not be closed (because of non saved data for example). - This method called by SUIT_Session whin closing of application was requested. + \return \c false if application can not be closed (because of non saved data for example). + This method called by SUIT_Session when closing of application was requested. */ bool SUIT_Application::isPossibleToClose( bool& ) { @@ -506,7 +506,7 @@ int SUIT_Application::createMenu( const int id, const QString& menu, const int g /*! Show/hide menu item corresponding to action \param a - action - \param on - if it is true, the item will be shown, otherwise it will be hidden + \param on - if it is \c true, the item will be shown, otherwise it will be hidden */ void SUIT_Application::setMenuShown( QAction* a, const bool on ) { @@ -521,7 +521,7 @@ void SUIT_Application::setMenuShown( QAction* a, const bool on ) /*! Show/hide menu item corresponding to action \param id - identificator of action in menu manager - \param on - if it is true, the item will be shown, otherwise it will be hidden + \param on - if it is \c true, the item will be shown, otherwise it will be hidden */ void SUIT_Application::setMenuShown( const int id, const bool on ) { @@ -531,7 +531,7 @@ void SUIT_Application::setMenuShown( const int id, const bool on ) /*! Show/hide tool button corresponding to action \param a - action - \param on - if it is true, the button will be shown, otherwise it will be hidden + \param on - if it is \c true, the button will be shown, otherwise it will be hidden */ void SUIT_Application::setToolShown( QAction* a, const bool on ) { @@ -546,7 +546,7 @@ void SUIT_Application::setToolShown( QAction* a, const bool on ) /*! Show/hide menu item corresponding to action \param id - identificator of action in tool manager - \param on - if it is true, the button will be shown, otherwise it will be hidden + \param on - if it is \c true, the button will be shown, otherwise it will be hidden */ void SUIT_Application::setToolShown( const int id, const bool on ) { @@ -556,7 +556,7 @@ void SUIT_Application::setToolShown( const int id, const bool on ) /*! Show/hide both menu item and tool button corresponding to action \param a - action - \param on - if it is true, the item will be shown, otherwise it will be hidden + \param on - if it is \c true, the item will be shown, otherwise it will be hidden */ void SUIT_Application::setActionShown( QAction* a, const bool on ) { @@ -567,7 +567,7 @@ void SUIT_Application::setActionShown( QAction* a, const bool on ) /*! Show/hide both menu item and tool button corresponding to action \param id - identificator in both menu manager and tool manager - \param on - if it is true, the item will be shown, otherwise it will be hidden + \param on - if it is \c true, the item will be shown, otherwise it will be hidden */ void SUIT_Application::setActionShown( const int id, const bool on ) { @@ -622,7 +622,7 @@ QList SUIT_Application::actionIds() const \param tip - tool tip \param key - shortcut \param parent - parent object - \param toggle - if it is TRUE the action will be a toggle action, otherwise it will be a command action + \param toggle - if it is \c true the action will be a toggle action, otherwise it will be a command action \param reciever - object that contains slot \param member - slot to be called when action is activated */ diff --git a/src/SUIT/SUIT_Application.h b/src/SUIT/SUIT_Application.h index 542b160bb..ae64e8eb5 100755 --- a/src/SUIT/SUIT_Application.h +++ b/src/SUIT/SUIT_Application.h @@ -67,7 +67,7 @@ public: //! Returns main widget (Desktop) of the application (if it exists) virtual SUIT_Desktop* desktop(); - /*! Returns FALSE if application can not be closed (because of non saved data for example). + /*! Returns \c false if application can not be closed (because of non saved data for example). This method called by SUIT_Session whin closing of application was requested. */ virtual bool isPossibleToClose( bool& ); diff --git a/src/SUIT/SUIT_DataObjectKey.cxx b/src/SUIT/SUIT_DataObjectKey.cxx index cabf0085e..29c799efd 100755 --- a/src/SUIT/SUIT_DataObjectKey.cxx +++ b/src/SUIT/SUIT_DataObjectKey.cxx @@ -93,7 +93,7 @@ SUIT_DataObjectKeyHandle::~SUIT_DataObjectKeyHandle() /*! * Checks: Is key null? - *\retval TRUE - if null, esle false. + *\retval \c true - if null, esle \c false. */ bool SUIT_DataObjectKeyHandle::isNull() const { @@ -110,7 +110,7 @@ void SUIT_DataObjectKeyHandle::nullify() /*! * Operator less. - *\retval boolean. TRUE - If current key less than \a kw. + *\retval boolean. \c true - If current key less than \a kw. */ bool SUIT_DataObjectKeyHandle::operator<( const SUIT_DataObjectKeyHandle& kw ) const { @@ -134,7 +134,7 @@ bool SUIT_DataObjectKeyHandle::operator<( const SUIT_DataObjectKeyHandle& kw ) c /*! * Operator is equal. - *\retval boolean. TRUE - If current key equal \a kw. + *\retval boolean. \c true - If current key equal \a kw. */ bool SUIT_DataObjectKeyHandle::operator==( const SUIT_DataObjectKeyHandle& kw ) const { diff --git a/src/SUIT/SUIT_Desktop.cxx b/src/SUIT/SUIT_Desktop.cxx index 96bc10f3d..f3cf4039d 100755 --- a/src/SUIT/SUIT_Desktop.cxx +++ b/src/SUIT/SUIT_Desktop.cxx @@ -127,7 +127,7 @@ void SUIT_Desktop::customEvent( QEvent* e ) wid->testAttribute( Qt::WA_WState_Hidden ); addWindow( wid ); - wid->setShown( !invis ); + wid->setVisible( !invis ); } } diff --git a/src/SUIT/SUIT_FileDlg.cxx b/src/SUIT/SUIT_FileDlg.cxx index 20a4ac493..a390792c8 100755 --- a/src/SUIT/SUIT_FileDlg.cxx +++ b/src/SUIT/SUIT_FileDlg.cxx @@ -124,7 +124,7 @@ SUIT_FileDlg::SUIT_FileDlg( QWidget* parent, bool open, bool showQuickDir, bool myCheckPermissions( true ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - + setOption(QFileDialog::DontUseNativeDialog, true); setModal( modal ); setSizeGripEnabled( true ); if ( parent ) @@ -518,7 +518,7 @@ QString SUIT_FileDlg::addExtension( const QString& fileName ) const return fileName; QRegExp r( QString::fromLatin1("\\(?[a-zA-Z0-9.*? +;#|]*\\)?$") ); - int index = r.indexIn( selectedFilter().trimmed() ); + int index = r.indexIn( selectedNameFilter().trimmed() ); if ( QFileInfo( fileName ).exists() ) return fileName; // if file exists return as is @@ -529,7 +529,7 @@ QString SUIT_FileDlg::addExtension( const QString& fileName ) const // Due to transformations from the filter list (*.txt *.*xx *.c++ SUIT*.* ) we // will have the pattern (\.txt|\..*xx|\.c\+\+|\..*) (as we validate extension only, // we remove everything except extension mask from the pattern - QString wildcard = selectedFilter().mid( index, r.matchedLength() ).trimmed(); + QString wildcard = selectedNameFilter().mid( index, r.matchedLength() ).trimmed(); // replace '|' and ';' separators by space symbol and also brackets if there are some wildcard.replace( QRegExp( "[\\|;|(|)]" )," " ); @@ -599,12 +599,12 @@ bool SUIT_FileDlg::processPath( const QString& path ) */ void SUIT_FileDlg::addFilter( const QString& filter ) { - QStringList flist = filters(); + QStringList flist = nameFilters(); if ( !flist.contains( filter ) ) { flist << filter; - setFilters( flist ); + setNameFilters( flist ); } - selectFilter( filter ); + selectNameFilter( filter ); } /*! @@ -768,9 +768,9 @@ QString SUIT_FileDlg::getFileName( QWidget* parent, const QString& initial, tmpfilename = tmpfilename.replace(QRegExp("\\*"), "" ).replace(QRegExp("\\?"), "" ); if ( filters.isEmpty() ) - fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*) + fd.setNameFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*) else - fd.setFilters( filters ); + fd.setNameFilters( filters ); if ( !caption.isEmpty() ) fd.setWindowTitle( caption ); @@ -875,9 +875,9 @@ QStringList SUIT_FileDlg::getOpenFileNames( QWidget* parent, const QString& init fd.setFileMode( ExistingFiles ); if ( filters.isEmpty() ) - fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*) + fd.setNameFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*) else - fd.setFilters( filters ); + fd.setNameFilters( filters ); if ( !caption.isEmpty() ) fd.setWindowTitle( caption ); diff --git a/src/SUIT/SUIT_Operation.cxx b/src/SUIT/SUIT_Operation.cxx index 41749ff44..48f92b96a 100755 --- a/src/SUIT/SUIT_Operation.cxx +++ b/src/SUIT/SUIT_Operation.cxx @@ -142,7 +142,7 @@ void SUIT_Operation::clearFlags( const int f ) * \brief Test the flags of operation * \param f - flags of operation to be tested * -* Returns TRUE if the specified flags setted in the operation (see Flags enumeration) +* Returns \c true if the specified flags setted in the operation (see Flags enumeration) */ bool SUIT_Operation::testFlags( const int f ) const { @@ -262,9 +262,9 @@ void SUIT_Operation::suspend() /*! * \brief Verifies whether operator is ready to start. - * \return TRUE if operation is ready to start + * \return \c true if operation is ready to start * -* Default implementation returns TRUE. Redefine this method to add own verifications +* Default implementation returns \c true. Redefine this method to add own verifications */ bool SUIT_Operation::isReadyToStart() const { @@ -329,14 +329,14 @@ void SUIT_Operation::commitOperation() /*! * \brief Sets slot which is called when operation is started - * \param theReceiver - object containing slot - * \param theSlot - slot of theReceiver object - * \return TR if slot was connected successfully, FALSE otherwise -* -* Sets slot which is called when operation is started. There is no point in -* using this method. It would be better to inherit own operator from base -* one and redefine startOperation method -*/ + * \param theReceiver - object containing slot + * \param theSlot - slot of theReceiver object + * \return \c true if slot was connected successfully, \c false otherwise + * + * Sets slot which is called when operation is started. There is no point in + * using this method. It would be better to inherit own operator from base + * one and redefine startOperation method + */ bool SUIT_Operation::setSlot( const QObject* theReceiver, const char* theSlot ) { return connect( this, SIGNAL( callSlot() ), theReceiver, theSlot ); @@ -345,7 +345,7 @@ bool SUIT_Operation::setSlot( const QObject* theReceiver, const char* theSlot ) /*! * \brief Verifies whether given operator is valid for this one * \param theOtherOp - other operation - * \return Returns TRUE if the given operator is valid for this one + * \return Returns \c true if the given operator is valid for this one * * Verifies whether given operator is valid for this one (i.e. can be started "above" * this operator) @@ -357,10 +357,10 @@ bool SUIT_Operation::isValid( SUIT_Operation* ) const /*! * \brief Verifies whether this operator can be always started above any already runnig one - * \return Returns TRUE if current operation must not be checked for ActiveOperation->IsValid( this ) + * \return Returns \c true if current operation must not be checked for ActiveOperation->IsValid( this ) * * This method must be redefined in derived operation if operation of derived class -* must be always can start above any launched one. Default implementation returns FALSE, +* must be always can start above any launched one. Default implementation returns \c false, * so it is being checked for IsValid, but some operations may overload IsGranted() * In this case they will always start, no matter what operation is running. */ @@ -371,9 +371,9 @@ bool SUIT_Operation::isGranted() const /*! * \brief Verifies whether operation is an runned one (state()==Running) - * \return TRUE if operation is active, FALSE otherwise + * \return \c true if operation is active, \c false otherwise * -* Verifies whether operation is an running. Returns TRUE if state of operator +* Verifies whether operation is an running. Returns \c true if state of operator * is Running */ bool SUIT_Operation::isRunning() const @@ -383,9 +383,9 @@ bool SUIT_Operation::isRunning() const /*! * \brief Verifies whether operation is an active for study. - * \return TRUE if operation is active, FALSE otherwise + * \return \c true if operation is active, \c false otherwise * -* Verifies whether operation is an active on. Returns TRUE if this operator +* Verifies whether operation is an active on. Returns \c true if this operator * is active for study */ bool SUIT_Operation::isActive() const @@ -470,7 +470,7 @@ bool SUIT_Operation::commitTransaction( const QString& name ) } /*! - * \brief Returns TRUE if transaction is opened. + * \brief Returns \c true if transaction is opened. */ bool SUIT_Operation::hasTransaction() const { diff --git a/src/SUIT/SUIT_ResourceMgr.cxx b/src/SUIT/SUIT_ResourceMgr.cxx index 88942671e..86dbf2959 100755 --- a/src/SUIT/SUIT_ResourceMgr.cxx +++ b/src/SUIT/SUIT_ResourceMgr.cxx @@ -87,7 +87,7 @@ QString SUIT_ResourceMgr::userFileName( const QString& appName, const bool for_l // Try config file, given in arguments for (int i = 1; i < arguments.count(); i++) { QRegExp rx ("--resources=(.+)"); - if ( rx.indexIn( arguments[i] ) >= 0 && rx.numCaptures() > 0 ) { + if ( rx.indexIn( arguments[i] ) >= 0 && rx.captureCount() > 0 ) { QString file = rx.cap(1); QFileInfo fi (file); pathName = fi.absoluteFilePath(); diff --git a/src/SUIT/SUIT_Study.cxx b/src/SUIT/SUIT_Study.cxx index 2d5c95514..3fe6234cc 100755 --- a/src/SUIT/SUIT_Study.cxx +++ b/src/SUIT/SUIT_Study.cxx @@ -96,7 +96,7 @@ SUIT_Operation* SUIT_Study::activeOperation() const } /*! - *\retval TRUE - if study saved, else FALSE. + *\retval \c true - if study saved, else \c false. */ bool SUIT_Study::isSaved() const { @@ -104,7 +104,7 @@ bool SUIT_Study::isSaved() const } /*! - *\retval TRUE - if study modified, else FALSE. + *\retval \c true - if study modified, else \c false. */ bool SUIT_Study::isModified() const { @@ -128,7 +128,7 @@ bool SUIT_Study::createDocument( const QString& ) } /*! - * Open document. Sets file name. return true. + * Open document. Sets file name. return \c true. */ bool SUIT_Study::openDocument( const QString& fileName ) { @@ -152,7 +152,7 @@ bool SUIT_Study::saveDocumentAs( const QString& fileName ) } /*! - *\retval TRUE - if document saved successful, else FALSE. + *\retval \c true - if document saved successful, else \c false. */ bool SUIT_Study::saveDocument() { @@ -266,13 +266,13 @@ SUIT_Operation* SUIT_Study::blockingOperation( SUIT_Operation* theOp ) const /*! * \brief Starts operation * \param theOp - operation to be started - * \param toCheck - if parameters is equal TRUE then checking performed whether + * \param toCheck - if parameters is equal \c true then checking performed whether * all already started operations allow to start this operation above them (default - * value is TRUE - * \return TRUE if operation is started, FALSE otherwise + * value is \c true + * \return \c true if operation is started, \c false otherwise * * Verifies whether theOp operation can be started above already started ones (if toCheck -* parameter is equal TRUE) and starts it +* parameter is equal \c true) and starts it */ bool SUIT_Study::start( SUIT_Operation* theOp, const bool toCheck ) { @@ -320,7 +320,7 @@ bool SUIT_Study::start( SUIT_Operation* theOp, const bool toCheck ) /*! * \brief Aborts operation * \param theOp - operation to be aborted - * \return TRUE if operation is aborted successfully + * \return \c true if operation is aborted successfully * * Verifies whether operation already started and aborts it in this case (sets execution * status to Rejected and stops operation) @@ -344,7 +344,7 @@ bool SUIT_Study::abort( SUIT_Operation* theOp ) /*! * \brief Commits operation * \param theOp - operation to be committed - * \return TRUE if operation is committed successfully + * \return \c true if operation is committed successfully * * Verifies whether operation already started and commits it in this case (sets execution * status to Accepted and stops operation) @@ -370,7 +370,7 @@ bool SUIT_Study::commit( SUIT_Operation* theOp ) /*! * \brief Commits operation * \param theOp - operation to be committed - * \return TRUE if operation is suspended successfully + * \return \c true if operation is suspended successfully * * Verifies whether operation already started and suspends it in this case. Operations * ususlly are suspended to start other one above them. @@ -390,7 +390,7 @@ bool SUIT_Study::suspend( SUIT_Operation* theOp ) /*! * \brief Resumes operation * \param theOp - operation to be resumed - * \return TRUE if operation is aborted successfully + * \return \c true if operation is aborted successfully * * Verifies whether operation already started but suspended and resumesit in this case. */ @@ -523,7 +523,7 @@ bool SUIT_Study::commitTransaction( const QString& ) } /*! - * \brief Returns TRUE if transaction is opened. + * \brief Returns \c true if transaction is opened. */ bool SUIT_Study::hasTransaction() const { diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index fc2ebf2d9..0aaf64573 100755 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -327,7 +327,7 @@ bool SUIT_ViewManager::isVisible() const void SUIT_ViewManager::setShown( const bool on ) { for ( int i = 0; i < myViews.count(); i++ ) - myViews.at( i )->setShown( on ); + myViews.at( i )->setVisible( on ); } /*!Emit on \a theEvent mouse pressed in \a theView.*/ diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index 9edcf4c23..eed1244fd 100755 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -403,7 +403,7 @@ void SUIT_ViewWindow::updateSyncViews() SUIT_Application* app = SUIT_Session::session()->activeApplication(); if ( app ) { SUIT_Desktop* d = app->desktop(); - QList allViews = qFindChildren( d ); + QList allViews = d->findChildren(); foreach( SUIT_ViewWindow* vw, allViews ) { if ( !vw || vw == this ) continue; // skip invalid views and this one SUIT_CameraProperties otherProps = vw->cameraProperties(); @@ -473,7 +473,7 @@ void SUIT_ViewWindow::synchronizeView( SUIT_ViewWindow* viewWindow, int id ) SUIT_Desktop* d = app->desktop(); if ( !d ) return; - QList allViews = qFindChildren( d ); + QList allViews = d->findChildren(); foreach( SUIT_ViewWindow* vw, allViews ) { if ( !vw->cameraProperties().isValid() ) continue; // omit views not supporting camera properties diff --git a/src/SVTK/SVTK_ComboAction.cxx b/src/SVTK/SVTK_ComboAction.cxx index 1403de1da..865469493 100644 --- a/src/SVTK/SVTK_ComboAction.cxx +++ b/src/SVTK/SVTK_ComboAction.cxx @@ -99,7 +99,7 @@ void SVTK_ComboAction::update() { QList aList = createdWidgets(); for ( QList::const_iterator it = aList.begin(); it != aList.end(); ++it ) - updateCombo( qFindChild(*it) ); + updateCombo( (*it)->findChild() ); } void SVTK_ComboAction::updateCombo( QComboBox* combo ) diff --git a/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx b/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx index 196e55a4c..75e2a6ef4 100644 --- a/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx @@ -76,7 +76,7 @@ QVTK_GenericRenderWindowInteractor // Start a one-shot timer for ms. // static int DELAY = 1; - myTimer->setSingleShot(TRUE); + myTimer->setSingleShot(true); myTimer->start(DELAY); return 1; } diff --git a/src/SVTK/SVTK_NonIsometricDlg.cxx b/src/SVTK/SVTK_NonIsometricDlg.cxx index 009ba0c08..a07a76bc1 100644 --- a/src/SVTK/SVTK_NonIsometricDlg.cxx +++ b/src/SVTK/SVTK_NonIsometricDlg.cxx @@ -49,7 +49,7 @@ SVTK_NonIsometricDlg m_MainWindow(theParent) { setWindowTitle(tr("DLG_TITLE")); - setSizeGripEnabled(TRUE); + setSizeGripEnabled(true); // Create layout for this dialog QGridLayout* layoutDlg = new QGridLayout (this); @@ -109,16 +109,16 @@ SVTK_NonIsometricDlg // Create button QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2); m_bOk->setObjectName("m_bOk"); - m_bOk->setDefault(TRUE); - m_bOk->setAutoDefault(TRUE); + m_bOk->setDefault(true); + m_bOk->setAutoDefault(true); // Create button QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2); m_bApply->setObjectName("m_bApply"); - m_bApply->setAutoDefault(TRUE); + m_bApply->setAutoDefault(true); // Create button QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2); m_bCancel->setObjectName("m_bCancel"); - m_bCancel->setAutoDefault(TRUE); + m_bCancel->setAutoDefault(true); // Layout buttons aHBoxLayout2->addWidget(m_bOk); diff --git a/src/SVTK/SVTK_SetRotationPointDlg.cxx b/src/SVTK/SVTK_SetRotationPointDlg.cxx index d8705969b..f88de7fad 100755 --- a/src/SVTK/SVTK_SetRotationPointDlg.cxx +++ b/src/SVTK/SVTK_SetRotationPointDlg.cxx @@ -62,7 +62,7 @@ SVTK_SetRotationPointDlg myRWInteractor(theParent->GetInteractor()) { setWindowTitle(tr("DLG_TITLE")); - setSizeGripEnabled(TRUE); + setSizeGripEnabled(true); // Create layout for this dialog QGridLayout* layoutDlg = new QGridLayout (this); @@ -153,7 +153,7 @@ SVTK_SetRotationPointDlg QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox ); m_bClose->setObjectName("m_bClose"); - m_bClose->setAutoDefault(TRUE); + m_bClose->setAutoDefault(true); m_bClose->setFixedSize(m_bClose->sizeHint()); connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose())); diff --git a/src/SVTK/SVTK_UpdateRateDlg.cxx b/src/SVTK/SVTK_UpdateRateDlg.cxx index 15a8d0a24..80ad0e440 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.cxx +++ b/src/SVTK/SVTK_UpdateRateDlg.cxx @@ -232,7 +232,7 @@ SVTK_UpdateRateDlg aGridLayout->addWidget(aLabel, 0, 0); QLineEdit* aLineEdit = new QLineEdit( aGroupBox ); - aLineEdit->setReadOnly( TRUE ); + aLineEdit->setReadOnly( true ); aGridLayout->addWidget(aLineEdit, 0, 1); myCurrentUpdateRateLineEdit = aLineEdit; @@ -244,7 +244,7 @@ SVTK_UpdateRateDlg aGridLayout->addWidget(aLabel, 1, 0); QLineEdit* aLineEdit = new QLineEdit( aGroupBox ); - aLineEdit->setReadOnly( TRUE ); + aLineEdit->setReadOnly( true ); aGridLayout->addWidget(aLineEdit, 1, 1); myNumberOfCellsLineEdit = aLineEdit; @@ -259,23 +259,23 @@ SVTK_UpdateRateDlg aHBoxLayout->setSpacing(6); { QPushButton* aPushButton = new QPushButton(tr("OK"), aGroupBox); - aPushButton->setDefault(TRUE); - aPushButton->setAutoDefault(TRUE); + aPushButton->setDefault(true); + aPushButton->setAutoDefault(true); aHBoxLayout->addWidget(aPushButton); connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickOk())); } { QPushButton* aPushButton = new QPushButton(tr("Apply"), aGroupBox); - aPushButton->setDefault(TRUE); - aPushButton->setAutoDefault(TRUE); + aPushButton->setDefault(true); + aPushButton->setAutoDefault(true); aHBoxLayout->addWidget(aPushButton); connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickApply())); } aHBoxLayout->addStretch(); { QPushButton* aPushButton = new QPushButton(tr("Close"), aGroupBox); - aPushButton->setDefault(TRUE); - aPushButton->setAutoDefault(TRUE); + aPushButton->setDefault(true); + aPushButton->setAutoDefault(true); aHBoxLayout->addWidget(aPushButton); connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickClose())); } diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index eb3a754e9..7f1be4798 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -565,7 +565,7 @@ void SVTK_Viewer::contextMenuPopup( QMenu* thePopup ) if(TViewWindow* aView = dynamic_cast(myViewManager->getActiveView())){ //Support of several toolbars in the popup menu - QList lst = qFindChildren( aView ); + QList lst = aView->findChildren(); QList::const_iterator it = lst.begin(), last = lst.end(); for( ; it!=last; it++ ) thePopup->addAction( (*it)->toggleViewAction() ); diff --git a/src/SVTK/SVTK_ViewParameterDlg.cxx b/src/SVTK/SVTK_ViewParameterDlg.cxx index 6db03e854..eb1d0d6aa 100755 --- a/src/SVTK/SVTK_ViewParameterDlg.cxx +++ b/src/SVTK/SVTK_ViewParameterDlg.cxx @@ -59,7 +59,7 @@ SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction, myRWInteractor(theParent->GetInteractor()) { setWindowTitle(tr("DLG_TITLE")); - setSizeGripEnabled(TRUE); + setSizeGripEnabled(true); // Top layout QVBoxLayout* aTopLayout = new QVBoxLayout(this); @@ -349,7 +349,7 @@ SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction, QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox ); m_bClose->setObjectName("m_bClose"); - m_bClose->setAutoDefault(TRUE); + m_bClose->setAutoDefault(true); m_bClose->setFixedSize(m_bClose->sizeHint()); connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose())); diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 2d98877d6..03f144750 100755 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -2125,7 +2125,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ), tr( "MNU_DUMP_VIEW" ), 0, this); anAction->setStatusTip(tr("DSC_DUMP_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(onDumpView())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onDumpView())); mgr->registerAction( anAction, DumpId ); // FitAll @@ -2133,7 +2133,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ), tr( "MNU_FITALL" ), 0, this); anAction->setStatusTip(tr("DSC_FITALL")); - connect(anAction, SIGNAL(activated()), this, SLOT(onFitAll())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onFitAll())); mgr->registerAction( anAction, FitAllId ); // FitRect @@ -2141,7 +2141,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ), tr( "MNU_FITRECT" ), 0, this); anAction->setStatusTip(tr("DSC_FITRECT")); - connect(anAction, SIGNAL(activated()), this, SLOT(activateWindowFit())); + connect(anAction, SIGNAL(triggered()), this, SLOT(activateWindowFit())); mgr->registerAction( anAction, FitRectId ); // FitSelection @@ -2149,7 +2149,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITSELECTION" ) ), tr( "MNU_FITSELECTION" ), 0, this); anAction->setStatusTip(tr("DSC_FITSELECTION")); - connect(anAction, SIGNAL(activated()), this, SLOT(onFitSelection())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onFitSelection())); mgr->registerAction( anAction, FitSelectionId ); // Zoom @@ -2157,7 +2157,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ), tr( "MNU_ZOOM_VIEW" ), 0, this); anAction->setStatusTip(tr("DSC_ZOOM_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(activateZoom())); + connect(anAction, SIGNAL(triggered()), this, SLOT(activateZoom())); mgr->registerAction( anAction, ZoomId ); // Panning @@ -2165,7 +2165,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ), tr( "MNU_PAN_VIEW" ), 0, this); anAction->setStatusTip(tr("DSC_PAN_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(activatePanning())); + connect(anAction, SIGNAL(triggered()), this, SLOT(activatePanning())); mgr->registerAction( anAction, PanId ); // Global Panning @@ -2173,7 +2173,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ), tr( "MNU_GLOBALPAN_VIEW" ), 0, this); anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning())); + connect(anAction, SIGNAL(triggered()), this, SLOT(activateGlobalPanning())); mgr->registerAction( anAction, GlobalPanId ); // Change rotation point @@ -2190,7 +2190,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ), tr( "MNU_ROTATE_VIEW" ), 0, this); anAction->setStatusTip(tr("DSC_ROTATE_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(activateRotation())); + connect(anAction, SIGNAL(triggered()), this, SLOT(activateRotation())); mgr->registerAction( anAction, RotationId ); // Projections @@ -2198,7 +2198,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ), tr( "MNU_FRONT_VIEW" ), 0, this, false, "Viewers:Front view"); anAction->setStatusTip(tr("DSC_FRONT_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(onFrontView())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onFrontView())); this->addAction(anAction); mgr->registerAction( anAction, FrontId ); @@ -2206,7 +2206,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ), tr( "MNU_BACK_VIEW" ), 0, this, false, "Viewers:Back view"); anAction->setStatusTip(tr("DSC_BACK_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(onBackView())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onBackView())); this->addAction(anAction); mgr->registerAction( anAction, BackId ); @@ -2214,7 +2214,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ), tr( "MNU_TOP_VIEW" ), 0, this, false, "Viewers:Top view"); anAction->setStatusTip(tr("DSC_TOP_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(onTopView())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onTopView())); this->addAction(anAction); mgr->registerAction( anAction, TopId ); @@ -2222,7 +2222,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ), tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "Viewers:Bottom view"); anAction->setStatusTip(tr("DSC_BOTTOM_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(onBottomView())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onBottomView())); this->addAction(anAction); mgr->registerAction( anAction, BottomId ); @@ -2230,7 +2230,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ), tr( "MNU_LEFT_VIEW" ), 0, this, false, "Viewers:Left view"); anAction->setStatusTip(tr("DSC_LEFT_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(onLeftView())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onLeftView())); this->addAction(anAction); mgr->registerAction( anAction, LeftId ); @@ -2238,7 +2238,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ), tr( "MNU_RIGHT_VIEW" ), 0, this, false, "Viewers:Right view"); anAction->setStatusTip(tr("DSC_RIGHT_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(onRightView())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onRightView())); this->addAction(anAction); mgr->registerAction( anAction, RightId ); @@ -2265,7 +2265,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ), tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view"); anAction->setStatusTip(tr("DSC_RESET_VIEW")); - connect(anAction, SIGNAL(activated()), this, SLOT(onResetView())); + connect(anAction, SIGNAL(triggered()), this, SLOT(onResetView())); this->addAction(anAction); mgr->registerAction( anAction, ResetId ); @@ -2374,7 +2374,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) tr( "MNU_SVTK_PRESELECTION_STANDARD" ), 0, this); anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_STANDARD")); anAction->setCheckable(true); - connect(anAction, SIGNAL(activated()), aSignalMapper, SLOT(map())); + connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map())); aSignalMapper->setMapping( anAction, Standard_Preselection ); mgr->registerAction( anAction, StandardPreselectionId ); @@ -2383,7 +2383,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) tr( "MNU_SVTK_PRESELECTION_DYNAMIC" ), 0, this); anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_DYNAMIC")); anAction->setCheckable(true); - connect(anAction, SIGNAL(activated()), aSignalMapper, SLOT(map())); + connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map())); aSignalMapper->setMapping( anAction, Dynamic_Preselection ); mgr->registerAction( anAction, DynamicPreselectionId ); @@ -2392,7 +2392,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr) tr( "MNU_SVTK_PRESELECTION_DISABLED" ), 0, this); anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_DISABLED")); anAction->setCheckable(true); - connect(anAction, SIGNAL(activated()), aSignalMapper, SLOT(map())); + connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map())); aSignalMapper->setMapping( anAction, Preselection_Disabled ); mgr->registerAction( anAction, DisablePreselectionId ); diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 11d041cb7..8927c1630 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -84,6 +84,7 @@ #include #include +#include #include #include #include @@ -206,9 +207,9 @@ void SalomeApp_Application::start() QStringList pyfiles; QString loadStudy; - for (int i = 1; i < qApp->argc(); i++) { + for (int i = 1; i < qApp->arguments().size(); i++) { QRegExp rxs ("--study-hdf=(.+)"); - if ( rxs.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) { + if ( rxs.indexIn( qApp->arguments()[i] ) >= 0 && rxs.capturedTexts().count() > 1 ) { QString file = rxs.capturedTexts()[1]; QFileInfo fi ( file ); QString extension = fi.suffix().toLower(); @@ -217,7 +218,7 @@ void SalomeApp_Application::start() } else { QRegExp rxp ("--pyscript=\\[(.+)\\]"); - if ( rxp.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxp.capturedTexts().count() > 1 ) { + if ( rxp.indexIn( qApp->arguments()[i] ) >= 0 && rxp.capturedTexts().count() > 1 ) { // pyscript QStringList dictList = rxp.capturedTexts()[1].split("},", QString::SkipEmptyParts); for (int k = 0; k < dictList.count(); ++k) { @@ -895,7 +896,7 @@ void SalomeApp_Application::onDumpStudy( ) DumpStudyFileDlg fd( desktop() ); fd.setValidator( new DumpStudyFileValidator( &fd ) ); fd.setWindowTitle( tr( "TOT_DESK_FILE_DUMP_STUDY" ) ); - fd.setFilters( aFilters ); + fd.setNameFilters( aFilters ); fd.myPublishChk->setChecked( anIsPublish ); fd.myMultiFileChk->setChecked( anIsMultiFile ); fd.mySaveGUIChk->setChecked( anIsSaveGUI ); @@ -1314,8 +1315,24 @@ void SalomeApp_Application::moduleActionSelected( const int id ) /*!Gets CORBA::ORB_var*/ CORBA::ORB_var SalomeApp_Application::orb() { - ORB_INIT& init = *SINGLETON_::Instance(); - static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() ); + static CORBA::ORB_var _orb; + + if ( CORBA::is_nil( _orb ) ) { + QStringList args = QApplication::arguments(); + int argc = args.size(); + std::vector args1(argc); + char** argv = new char*[argc]; + for ( int i = 0; i < argc; ++i ) { + args1[i] = args[i].toStdString(); + argv[i] = const_cast( args1[i].c_str() ); + } + + ORB_INIT& init = *SINGLETON_::Instance(); + _orb = init( argc, argv ); + + delete [] argv; + } + return _orb; } diff --git a/src/SalomeApp/SalomeApp_Engine_i.cxx b/src/SalomeApp/SalomeApp_Engine_i.cxx index 40563d939..0d630cfeb 100644 --- a/src/SalomeApp/SalomeApp_Engine_i.cxx +++ b/src/SalomeApp/SalomeApp_Engine_i.cxx @@ -302,10 +302,24 @@ char* SalomeApp_Engine_i::getVersion() */ CORBA::ORB_var SalomeApp_Engine_i::orb() { - ORB_INIT& init = *SINGLETON_::Instance(); - // TODO: using QApplication here looks ugly, think how to - // obtain the ORB reference in a nicer way... - static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() ); + static CORBA::ORB_var _orb; + + if ( CORBA::is_nil( _orb ) ) { + QStringList args = QApplication::arguments(); + int argc = args.size(); + std::vector args1(argc); + char** argv = new char*[argc]; + for ( int i = 0; i < argc; ++i ) { + args1[i] = args[i].toStdString(); + argv[i] = const_cast( args1[i].c_str() ); + } + + ORB_INIT& init = *SINGLETON_::Instance(); + _orb = init( argc, argv ); + + delete [] argv; + } + return _orb; } diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index 1e2f82524..801faa612 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -62,7 +62,7 @@ SalomeApp_StudyPropertiesDlg::SalomeApp_StudyPropertiesDlg(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), myIsChanged(false) { - setModal( TRUE ); + setModal( true ); setWindowTitle(tr("TLT_STUDY_PROPERTIES")); setSizeGripEnabled( true ); diff --git a/src/SalomeApp/pluginsdemo/CMakeLists.txt b/src/SalomeApp/pluginsdemo/CMakeLists.txt index 463b60181..8ca931aa3 100755 --- a/src/SalomeApp/pluginsdemo/CMakeLists.txt +++ b/src/SalomeApp/pluginsdemo/CMakeLists.txt @@ -25,12 +25,24 @@ # variable *_ROOT_DIR). # +INCLUDE(UsePyQt4) + +# --- resources --- + +# uic files / to be processed by pyuic +SET(_pyuic_files + minmax.ui +) + +# scripts / pyuic wrappings +PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files}) + # --- scripts --- # scripts / static # TODO: process UIC files via PyQt4 pyuic tool, see UsePyQt4.cmake SET(_plugins_SCRIPTS - minmax_dialog.py + ${_pyuic_SCRIPTS} minmax_plugin.py trihedron.py tubedialog_ui.py diff --git a/src/SalomeApp/pluginsdemo/minmax_dialog.py b/src/SalomeApp/pluginsdemo/minmax_dialog.py deleted file mode 100644 index b5c5db667..000000000 --- a/src/SalomeApp/pluginsdemo/minmax_dialog.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# Form implementation generated from reading ui file 'minmax.ui' -# -# Created: Thu Mar 1 15:23:57 2012 -# by: PyQt4 UI code generator 4.8.1 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName(_fromUtf8("Dialog")) - Dialog.resize(178, 156) - Dialog.setSizeGripEnabled(True) - self.gridLayout = QtGui.QGridLayout(Dialog) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.label_2 = QtGui.QLabel(Dialog) - self.label_2.setObjectName(_fromUtf8("label_2")) - self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1) - self.mesh = QtGui.QLineEdit(Dialog) - self.mesh.setReadOnly(True) - self.mesh.setObjectName(_fromUtf8("mesh")) - self.gridLayout.addWidget(self.mesh, 0, 1, 1, 2) - self.label_3 = QtGui.QLabel(Dialog) - self.label_3.setObjectName(_fromUtf8("label_3")) - self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1) - self.control = QtGui.QComboBox(Dialog) - self.control.setObjectName(_fromUtf8("control")) - self.gridLayout.addWidget(self.control, 1, 1, 1, 2) - self.label = QtGui.QLabel(Dialog) - self.label.setObjectName(_fromUtf8("label")) - self.gridLayout.addWidget(self.label, 2, 0, 1, 1) - self.minvalue = QtGui.QLineEdit(Dialog) - self.minvalue.setReadOnly(True) - self.minvalue.setObjectName(_fromUtf8("minvalue")) - self.gridLayout.addWidget(self.minvalue, 2, 1, 1, 2) - self.label_4 = QtGui.QLabel(Dialog) - self.label_4.setObjectName(_fromUtf8("label_4")) - self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1) - self.maxvalue = QtGui.QLineEdit(Dialog) - self.maxvalue.setReadOnly(True) - self.maxvalue.setObjectName(_fromUtf8("maxvalue")) - self.gridLayout.addWidget(self.maxvalue, 3, 1, 1, 2) - self.buttonBox = QtGui.QDialogButtonBox(Dialog) - self.buttonBox.setOrientation(QtCore.Qt.Horizontal) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close|QtGui.QDialogButtonBox.Help) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 3) - - self.retranslateUi(Dialog) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.OnCancel) - QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("helpRequested()")), Dialog.helpMessage) - QtCore.QObject.connect(self.control, QtCore.SIGNAL(_fromUtf8("activated(QString)")), Dialog.compute_minmax) - QtCore.QMetaObject.connectSlotsByName(Dialog) - Dialog.setTabOrder(self.mesh, self.control) - Dialog.setTabOrder(self.control, self.minvalue) - Dialog.setTabOrder(self.minvalue, self.maxvalue) - Dialog.setTabOrder(self.maxvalue, self.buttonBox) - - def retranslateUi(self, Dialog): - Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Get min and max value of control", None, QtGui.QApplication.UnicodeUTF8)) - self.label_2.setText(QtGui.QApplication.translate("Dialog", "Mesh", None, QtGui.QApplication.UnicodeUTF8)) - self.label_3.setText(QtGui.QApplication.translate("Dialog", "Control", None, QtGui.QApplication.UnicodeUTF8)) - self.label.setText(QtGui.QApplication.translate("Dialog", "Min", None, QtGui.QApplication.UnicodeUTF8)) - self.label_4.setText(QtGui.QApplication.translate("Dialog", "Max", None, QtGui.QApplication.UnicodeUTF8)) - diff --git a/src/SalomeApp/pluginsdemo/minmax_plugin.py b/src/SalomeApp/pluginsdemo/minmax_plugin.py index adc759426..f08ce6312 100644 --- a/src/SalomeApp/pluginsdemo/minmax_plugin.py +++ b/src/SalomeApp/pluginsdemo/minmax_plugin.py @@ -30,7 +30,7 @@ def minmax(context): from PyQt4.QtCore import Qt from PyQt4.QtCore import SIGNAL - from minmax_dialog import Ui_Dialog + from minmax_ui import Ui_Dialog import salome import SMESH diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 7e1fbe5f4..5f514ae81 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -103,13 +103,15 @@ void MessageOutput( QtMsgType type, const char* msg ) switch ( type ) { case QtDebugMsg: - //MESSAGE( "Debug: " << msg ); +#ifdef QT_DEBUG_MESSAGE + MESSAGE( "Debug: " << qPrintable( QString(msg) ) ); +#endif break; case QtWarningMsg: - MESSAGE( "Warning: " << msg ); + MESSAGE( "Warning: " << qPrintable( QString(msg) ) ); break; case QtFatalMsg: - MESSAGE( "Fatal: " << msg ); + MESSAGE( "Fatal: " << qPrintable( QString(msg) ) ); break; } } @@ -377,7 +379,7 @@ int main( int argc, char **argv ) _qappl.setApplicationVersion( salomeVersion() ); // Add application library path (to search style plugin etc...) - QString path = QDir::convertSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) ); + QString path = QDir::toNativeSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) ); _qappl.addLibraryPath( path ); bool isGUI = isFound( "GUI", argc, argv ); diff --git a/src/Session/Session_ServerCheck.cxx b/src/Session/Session_ServerCheck.cxx index 2789e23a8..3cb7fa8a5 100644 --- a/src/Session/Session_ServerCheck.cxx +++ b/src/Session/Session_ServerCheck.cxx @@ -261,17 +261,27 @@ void Session_ServerCheck::run() // start check servers int current = 0; QString error; - int argc = QApplication::instance()->argc(); - char** argv = QApplication::instance()->argv(); + QStringList args = QApplication::arguments(); + int argc = args.size(); + std::vector args1(argc); + char** argv = new char*[argc]; + for ( int i = 0; i < argc; ++i ) { + args1[i] = args[i].toStdString(); + argv[i] = const_cast( args1[i].c_str() ); + } + + bool OK = true; + // 1. Check naming service - for ( int i = 0; i < myAttempts; i++ ) { + for ( int i = 0; (i < myAttempts) && OK; i++ ) { Locker locker( this ); setStep( current * myAttempts + i ); try { - CORBA::ORB_var orb = CORBA::ORB_init( argc, argv ); + ORB_INIT& init = *SINGLETON_::Instance(); + CORBA::ORB_var orb = init( argc, argv ); CORBA::Object_var obj = orb->resolve_initial_references( "NameService" ); CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow( obj ); if ( !CORBA::is_nil( _root_context ) ) { @@ -288,12 +298,13 @@ void Session_ServerCheck::run() if ( i == myAttempts-1 ) { setError( tr( "Unable to contact the naming service.\n" ) ); - return; + OK = false; + //return; } } // 2. Check registry server - for ( int i = 0; i < myAttempts ; i++ ) { + for ( int i = 0; (i < myAttempts) && OK ; i++ ) { Locker locker( this ); setStep( current * myAttempts + i ); @@ -336,12 +347,13 @@ void Session_ServerCheck::run() if ( i == myAttempts-1 ) { setError( tr( "Registry server is not found.\n%1" ).arg ( error ) ); - return; + OK = false; + //return; } } // 3. Check data server - for ( int i = 0; i < myAttempts ; i++ ) { + for ( int i = 0; (i < myAttempts) && OK ; i++ ) { Locker locker( this ); setStep( current * myAttempts + i ); @@ -384,12 +396,13 @@ void Session_ServerCheck::run() if ( i == myAttempts-1 ) { setError( tr( "Study server is not found.\n%1" ).arg ( error ) ); - return; + OK = false; + //return; } } // 4. Check module catalogue server - for ( int i = 0; i < myAttempts ; i++ ) { + for ( int i = 0; (i < myAttempts) && OK ; i++ ) { Locker locker( this ); setStep( current * myAttempts + i ); @@ -432,12 +445,13 @@ void Session_ServerCheck::run() if ( i == myAttempts-1 ) { setError( tr( "Module catalogue server is not found.\n%1" ).arg ( error ) ); - return; + OK = false; + //return; } } // 5. Check data server - for ( int i = 0; i < myAttempts ; i++ ) { + for ( int i = 0; (i < myAttempts) && OK ; i++ ) { Locker locker( this ); setStep( current * myAttempts + i ); @@ -480,13 +494,14 @@ void Session_ServerCheck::run() if ( i == myAttempts-1 ) { setError( tr( "Session server is not found.\n%1" ).arg ( error ) ); - return; + OK = false; + //return; } } // 6. Check C++ container if ( myCheckCppContainer ) { - for ( int i = 0; i < myAttempts ; i++ ) { + for ( int i = 0; (i < myAttempts) && OK ; i++ ) { Locker locker( this ); setStep( current * myAttempts + i ); @@ -530,14 +545,15 @@ void Session_ServerCheck::run() if ( i == myAttempts-1 ) { setError( tr( "C++ container is not found.\n%1" ).arg ( error ) ); - return; + OK = false; + //return; } } } // 7. Check Python container if ( myCheckPyContainer ) { - for ( int i = 0; i < myAttempts ; i++ ) { + for ( int i = 0; (i < myAttempts) && OK ; i++ ) { Locker locker( this ); setStep( current * myAttempts + i ); @@ -581,14 +597,15 @@ void Session_ServerCheck::run() if ( i == myAttempts-1 ) { setError( tr( "Python container is not found.\n%1" ).arg ( error ) ); - return; + OK = false; + //return; } } } // 8. Check supervision container if ( myCheckSVContainer ) { - for ( int i = 0; i < myAttempts ; i++ ) { + for ( int i = 0; (i < myAttempts) && OK ; i++ ) { Locker locker( this ); setStep( current * myAttempts + i ); @@ -632,8 +649,11 @@ void Session_ServerCheck::run() if ( i == myAttempts-1 ) { setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) ); - return; + OK = false; + //return; } } } + + delete [] argv; } diff --git a/src/Session/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index 663700542..005b5eea8 100755 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -64,7 +64,7 @@ SALOME_Session_i::SALOME_Session_i(int argc, { _argc = argc ; _argv = argv ; - _isGUI = FALSE ; + _isGUI = false ; _runningStudies= 0 ; _orb = CORBA::ORB::_duplicate(orb) ; _poa = PortableServer::POA::_duplicate(poa) ; diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index d49af67d2..989153b44 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -59,8 +59,7 @@ #include #include #include - -#include +#include #define SHADOW 1 #define LINE_GR_MARGIN 10 diff --git a/src/TreeData/Test/mainwindow.cxx b/src/TreeData/Test/mainwindow.cxx index 904d80b95..0e07e7b95 100644 --- a/src/TreeData/Test/mainwindow.cxx +++ b/src/TreeData/Test/mainwindow.cxx @@ -17,7 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include +#include +#include #include "mainwindow.hxx" #include "TreeModel.hxx" diff --git a/src/TreeData/TreeModel.cxx b/src/TreeData/TreeModel.cxx index 073aa8279..5bb540c91 100644 --- a/src/TreeData/TreeModel.cxx +++ b/src/TreeData/TreeModel.cxx @@ -20,8 +20,6 @@ // Author: Guillaume Boulant (EDF/R&D) -#include - #include "TreeItem.hxx" #include "TreeModel.hxx" diff --git a/src/VTKViewer/VTKViewer_Filter.cxx b/src/VTKViewer/VTKViewer_Filter.cxx index 73abaf948..3543de328 100755 --- a/src/VTKViewer/VTKViewer_Filter.cxx +++ b/src/VTKViewer/VTKViewer_Filter.cxx @@ -50,7 +50,7 @@ VTKViewer_Filter::~VTKViewer_Filter() * call virtual method IsValid( const int theId ). * \param theActor - actor * \param theCellId - cell id. - * \retval TRUE - if cell id is valid, else false. + * \retval \c true - if cell id is valid, else \c false. */ bool VTKViewer_Filter::IsValid( VTKViewer_Actor* theActor, const int theCellId ) { diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.cxx b/src/VTKViewer/VTKViewer_InteractorStyle.cxx index 93b1da183..61762c5f7 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.cxx +++ b/src/VTKViewer/VTKViewer_InteractorStyle.cxx @@ -674,7 +674,7 @@ void VTKViewer_InteractorStyle::startGlobalPan() } -/*!\retval TRUE if needs redrawing*/ +/*!\retval \c true if needs redrawing*/ bool VTKViewer_InteractorStyle::needsRedrawing() { return State == VTK_INTERACTOR_STYLE_CAMERA_ZOOM || @@ -1482,7 +1482,7 @@ void VTKViewer_InteractorStyle::RemoveFilter( const int theId ) /*!Checks: is valid cell(node) with id \a theId in actor \a theActor. *\param theActor - VTKViewer_Actor pointer. *\param theId - cell id. - *\param theIsNode - boolean flag, if true - node, else - cell. + *\param theIsNode - boolean flag, if \c true - node, else - cell. */ bool VTKViewer_InteractorStyle::IsValid( VTKViewer_Actor* theActor, const int theId, diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx index 8abd0fa01..6179c1679 100755 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx @@ -322,7 +322,7 @@ int VTKViewer_RenderWindowInteractor::CreateTimer(int vtkNotUsed(timertype)) /// /// Start a one-shot timer for 10ms. /// - mTimer->setSingleShot(TRUE) ; + mTimer->setSingleShot(true) ; mTimer->start(10) ; return 1 ; } diff --git a/src/VTKViewer/VTKViewer_ViewWindow.cxx b/src/VTKViewer/VTKViewer_ViewWindow.cxx index 084d961af..db3a50341 100755 --- a/src/VTKViewer/VTKViewer_ViewWindow.cxx +++ b/src/VTKViewer/VTKViewer_ViewWindow.cxx @@ -191,98 +191,98 @@ void VTKViewer_ViewWindow::createActions() aAction = new QtxAction(tr("MNU_DUMP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ), tr( "MNU_DUMP_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_DUMP_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onDumpView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onDumpView())); myActionsMap[ DumpId ] = aAction; //! \li FitAll aAction = new QtxAction(tr("MNU_FITALL"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ), tr( "MNU_FITALL" ), 0, this); aAction->setStatusTip(tr("DSC_FITALL")); - connect(aAction, SIGNAL(activated()), this, SLOT(onFitAll())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onFitAll())); myActionsMap[ FitAllId ] = aAction; //! \li FitRect aAction = new QtxAction(tr("MNU_FITRECT"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ), tr( "MNU_FITRECT" ), 0, this); aAction->setStatusTip(tr("DSC_FITRECT")); - connect(aAction, SIGNAL(activated()), this, SLOT(activateWindowFit())); + connect(aAction, SIGNAL(triggered()), this, SLOT(activateWindowFit())); myActionsMap[ FitRectId ] = aAction; //! \li FitSelection aAction = new QtxAction(tr("MNU_FITSELECTION"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITSELECTION" ) ), tr( "MNU_FITSELECTION" ), 0, this); aAction->setStatusTip(tr("DSC_FITSELECTION")); - connect(aAction, SIGNAL(activated()), this, SLOT(onFitSelection())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onFitSelection())); myActionsMap[ FitSelectionId ] = aAction; //! \li Zoom aAction = new QtxAction(tr("MNU_ZOOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ), tr( "MNU_ZOOM_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_ZOOM_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(activateZoom())); + connect(aAction, SIGNAL(triggered()), this, SLOT(activateZoom())); myActionsMap[ ZoomId ] = aAction; //! \li Panning aAction = new QtxAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ), tr( "MNU_PAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_PAN_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(activatePanning())); + connect(aAction, SIGNAL(triggered()), this, SLOT(activatePanning())); myActionsMap[ PanId ] = aAction; //! \li Global Panning aAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ), tr( "MNU_GLOBALPAN_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(activateGlobalPanning())); + connect(aAction, SIGNAL(triggered()), this, SLOT(activateGlobalPanning())); myActionsMap[ GlobalPanId ] = aAction; //! \li Rotation aAction = new QtxAction(tr("MNU_ROTATE_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ), tr( "MNU_ROTATE_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_ROTATE_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(activateRotation())); + connect(aAction, SIGNAL(triggered()), this, SLOT(activateRotation())); myActionsMap[ RotationId ] = aAction; //! \li Projections aAction = new QtxAction(tr("MNU_FRONT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ), tr( "MNU_FRONT_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_FRONT_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onFrontView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onFrontView())); myActionsMap[ FrontId ] = aAction; //! \li Back view aAction = new QtxAction(tr("MNU_BACK_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ), tr( "MNU_BACK_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_BACK_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onBackView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onBackView())); myActionsMap[ BackId ] = aAction; //! \li Top view aAction = new QtxAction(tr("MNU_TOP_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ), tr( "MNU_TOP_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_TOP_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onTopView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onTopView())); myActionsMap[ TopId ] = aAction; //! \li Bottom view aAction = new QtxAction(tr("MNU_BOTTOM_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ), tr( "MNU_BOTTOM_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_BOTTOM_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onBottomView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onBottomView())); myActionsMap[ BottomId ] = aAction; //! \li Left view aAction = new QtxAction(tr("MNU_LEFT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ), tr( "MNU_LEFT_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_LEFT_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onLeftView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onLeftView())); myActionsMap[ LeftId ] = aAction; //! \li Right view aAction = new QtxAction(tr("MNU_RIGHT_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ), tr( "MNU_RIGHT_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_RIGHT_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onRightView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onRightView())); myActionsMap[ RightId ] = aAction; // \li Rotate anticlockwise @@ -303,14 +303,14 @@ void VTKViewer_ViewWindow::createActions() aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ), tr( "MNU_RESET_VIEW" ), 0, this); aAction->setStatusTip(tr("DSC_RESET_VIEW")); - connect(aAction, SIGNAL(activated()), this, SLOT(onResetView())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onResetView())); myActionsMap[ ResetId ] = aAction; //! \li Trihedron shown aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ), tr( "MNU_SHOW_TRIHEDRON" ), 0, this); aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON")); - connect(aAction, SIGNAL(activated()), this, SLOT(onTrihedronShow())); + connect(aAction, SIGNAL(triggered()), this, SLOT(onTrihedronShow())); myActionsMap[ TrihedronShowId ] = aAction; } diff --git a/src/ViewerTools/ViewerTools_DialogBase.h b/src/ViewerTools/ViewerTools_DialogBase.h index 0aafe72d7..b36e4366b 100644 --- a/src/ViewerTools/ViewerTools_DialogBase.h +++ b/src/ViewerTools/ViewerTools_DialogBase.h @@ -37,7 +37,7 @@ public: ViewerTools_DialogBase(QtxAction* theAction, QWidget* theParent, const char* theName = "", - bool theModal = FALSE, + bool theModal = false, Qt::WindowFlags theWFalgs = 0); ~ViewerTools_DialogBase(); diff --git a/tools/dlgfactory/CMakeLists.txt b/tools/dlgfactory/CMakeLists.txt index 3c80f81a4..5866cd99a 100755 --- a/tools/dlgfactory/CMakeLists.txt +++ b/tools/dlgfactory/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(UseQt4Ext) + INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tools/dlgfactory/GenericDialog.cxx b/tools/dlgfactory/GenericDialog.cxx index d0e935b06..67b9e7cb0 100644 --- a/tools/dlgfactory/GenericDialog.cxx +++ b/tools/dlgfactory/GenericDialog.cxx @@ -18,8 +18,9 @@ // #include "GenericDialog.h" +#include -GenericDialog::GenericDialog(QDialog *parent) : QDialog(parent) +GenericDialog::GenericDialog(QDialog* parent) : QDialog(parent) { ui.setupUi(this); // A faire en premier @@ -32,16 +33,14 @@ GenericDialog::GenericDialog(QDialog *parent) : QDialog(parent) // buttonbox (inherited features) } -QFrame * GenericDialog::getPanel() { +QFrame* GenericDialog::getPanel() { return ui.centralPanel; } -QDialogButtonBox * GenericDialog::getButtonBox() { +QDialogButtonBox* GenericDialog::getButtonBox() { return ui.buttonBox; } - -#include void GenericDialog::accept() { qDebug() << "accept() is not implemented yet"; QDialog::accept(); diff --git a/tools/dlgfactory/GenericDialog.h b/tools/dlgfactory/GenericDialog.h index ab4f62242..3e99e142c 100644 --- a/tools/dlgfactory/GenericDialog.h +++ b/tools/dlgfactory/GenericDialog.h @@ -20,25 +20,28 @@ #ifndef _GenericDialog_HXX #define _GenericDialog_HXX -#include +#include + #include "ui_GenericDialog.h" +class QFrame; +class QDialogButtonBox; + class GenericDialog : public QDialog { Q_OBJECT - + public: - GenericDialog(QDialog *parent = 0); + GenericDialog(QDialog* parent = 0); - protected: - QFrame * getPanel(); +protected: + QFrame* getPanel(); QDialogButtonBox * getButtonBox(); - - protected slots: - void accept(); - //void reject(); - - private: + +protected slots: + void accept(); + +private: Ui_GenericDialog ui; // instance of the class defined in ui_GenericDialog.h }; diff --git a/tools/dlgfactory/__GDIALOG__.cxx b/tools/dlgfactory/__GDIALOG__.cxx index 14dc63ac0..9093dbb26 100644 --- a/tools/dlgfactory/__GDIALOG__.cxx +++ b/tools/dlgfactory/__GDIALOG__.cxx @@ -1,6 +1,6 @@ #include "__CLASSNAME__.h" -__CLASSNAME__::__CLASSNAME__(QDialog *parent) : GenericDialog(parent) +__CLASSNAME__::__CLASSNAME__(QDialog* parent) : GenericDialog(parent) { ui.setupUi(this->getPanel()); } diff --git a/tools/dlgfactory/__GDIALOG__.h b/tools/dlgfactory/__GDIALOG__.h index 03132d9ec..a37ddb4bc 100644 --- a/tools/dlgfactory/__GDIALOG__.h +++ b/tools/dlgfactory/__GDIALOG__.h @@ -1,18 +1,17 @@ #ifndef ___CLASSNAME___HXX #define ___CLASSNAME___HXX -#include #include "ui___CLASSNAME__.h" #include "GenericDialog.h" class __CLASSNAME__ : public GenericDialog { Q_OBJECT - - public: - __CLASSNAME__(QDialog *parent = 0); - - private: + +public: + __CLASSNAME__(QDialog* parent = 0); + +private: Ui___CLASSNAME__ ui; // instance of the class defined in ui___CLASSNAME__.hxx }; diff --git a/tools/dlgfactory/__QDIALOG__.cxx b/tools/dlgfactory/__QDIALOG__.cxx index 97f1fadd4..df9145685 100644 --- a/tools/dlgfactory/__QDIALOG__.cxx +++ b/tools/dlgfactory/__QDIALOG__.cxx @@ -1,6 +1,7 @@ #include "__CLASSNAME__.h" +#include -__CLASSNAME__::__CLASSNAME__(QDialog *parent) : QDialog(parent) +__CLASSNAME__::__CLASSNAME__(QDialog* parent) : QDialog(parent) { ui.setupUi(this); // A faire en premier @@ -13,7 +14,6 @@ __CLASSNAME__::__CLASSNAME__(QDialog *parent) : QDialog(parent) // buttonbox (inherited features) } -#include void __CLASSNAME__::accept() { qDebug() << "accept() is not implemented yet"; QDialog::accept(); diff --git a/tools/dlgfactory/__QDIALOG__.h b/tools/dlgfactory/__QDIALOG__.h index b2cfd4f7f..37ca44375 100644 --- a/tools/dlgfactory/__QDIALOG__.h +++ b/tools/dlgfactory/__QDIALOG__.h @@ -1,21 +1,21 @@ #ifndef ___CLASSNAME___HXX #define ___CLASSNAME___HXX -#include +#include + #include "ui___CLASSNAME__.h" class __CLASSNAME__ : public QDialog { Q_OBJECT - - public: - __CLASSNAME__(QDialog *parent = 0); - - protected slots: - void accept(); - //void reject(); - - private: + +public: + __CLASSNAME__(QDialog* parent = 0); + +protected slots: + void accept(); + +private: Ui___CLASSNAME__ ui; // instance of the class defined in ui___CLASSNAME__.hxx }; diff --git a/tools/dlgfactory/gtester.cxx b/tools/dlgfactory/gtester.cxx index fbc5baa5b..6c650a58b 100644 --- a/tools/dlgfactory/gtester.cxx +++ b/tools/dlgfactory/gtester.cxx @@ -23,15 +23,14 @@ // (gboulant - 12/10/2010) // #include -#include #include "GDialogTest.h" void TEST_show() { - GDialogTest * dialog = new GDialogTest(); + GDialogTest* dialog = new GDialogTest(); dialog->show(); } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { QApplication app(argc, argv); TEST_show(); diff --git a/tools/dlgfactory/qtester.cxx b/tools/dlgfactory/qtester.cxx index 67a875f1a..fd4df0a0f 100644 --- a/tools/dlgfactory/qtester.cxx +++ b/tools/dlgfactory/qtester.cxx @@ -23,15 +23,14 @@ // (gboulant - 12/10/2010) // #include -#include #include "QDialogTest.h" void TEST_show() { - QDialogTest * dialog = new QDialogTest(); + QDialogTest* dialog = new QDialogTest(); dialog->show(); } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { QApplication app(argc, argv); TEST_show(); -- 2.30.2