]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Porting to Qt 5
authorasl <asl@opencascade.com>
Wed, 27 Jan 2016 07:54:39 +0000 (10:54 +0300)
committervsr <vsr@opencascade.com>
Fri, 29 Jan 2016 13:01:41 +0000 (16:01 +0300)
29 files changed:
CMakeLists.txt
src/HYDROData/HYDROData_Entity.cxx
src/HYDROData/HYDROData_Entity.h
src/HYDROData/HYDROData_LandCoverMap.h
src/HYDROData/HYDROData_ShapeFile.cxx
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_DataBrowser.cxx
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_DataObject.cxx
src/HYDROGUI/HYDROGUI_GeomObjectDlg.cxx
src/HYDROGUI/HYDROGUI_ImportLandCoverMapDlg.cxx
src/HYDROGUI/HYDROGUI_ImportObstacleFromFileOp.cxx
src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx
src/HYDROGUI/HYDROGUI_ImportProfilesOp.cxx
src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx
src/HYDROGUI/HYDROGUI_ListModel.cxx
src/HYDROGUI/HYDROGUI_ListModel.h
src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx
src/HYDROGUI/HYDROGUI_PriorityWidget.cxx
src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx
src/HYDROGUI/HYDROGUI_Tool.cxx
src/HYDROGUI/HYDROGUI_Tool.h
src/HYDROGUI/HYDROGUI_Tool2.cxx
src/HYDROGUI/HYDROGUI_VTKPrs.cxx
src/HYDROPy/CMakeLists.txt
src/HYDROPy/HYDROData_Entity.sip
src/HYDRO_tests/CMakeLists.txt
src/HYDRO_tests/ExternalFiles.cmake
src/HYDRO_tests/test_HYDROData_Main.cxx

index 8951fca1b04c61f3affba63b1c402419e5d1d8b9..36692bf33d4872d438ad021b41f5d6258f5be55c 100644 (file)
@@ -3,8 +3,6 @@ INCLUDE(CMakeDependentOption)
 
 PROJECT(SalomeHYDRO C CXX)
 
-ADD_SUBDIRECTORY (src/HYDRO_tests)
-
 # Ensure a proper linker behavior:
 CMAKE_POLICY(SET CMP0003 NEW)
 
@@ -92,10 +90,15 @@ OPTION(SALOME_BUILD_TESTS "Build HYDRO tests" ON)
 ## From KERNEL:
 ##
 
-# Mandatory products
-FIND_PACKAGE(SalomePython    REQUIRED)
+# Mandatory products:
+
+FIND_PACKAGE(SalomePython  REQUIRED)
+FIND_PACKAGE(SalomeCAS     REQUIRED)
+FIND_PACKAGE(SalomeVTK     REQUIRED)
+FIND_PACKAGE(SalomeOmniORB REQUIRED)
 
 # Optional products:
+
 IF(SALOME_BUILD_TESTS)
   ENABLE_TESTING()
   FIND_PACKAGE(SalomeCppUnit)
@@ -113,25 +116,31 @@ IF(SALOME_BUILD_DOC)
   SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC)
 ENDIF()
 
-# Find optional GUI libraries
-IF(SALOME_BUILD_GUI)
-  # Qt4
-  FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
-ENDIF(SALOME_BUILD_GUI)
-
 ##
-## HYDRO specifics
+## From GUI:
 ##
 
-FIND_PACKAGE(SalomeCAS REQUIRED)
-
-FIND_PACKAGE(SalomeVTK REQUIRED)
-
 FIND_PACKAGE(SalomeSIP REQUIRED)  # should come after Python and before PyQt4
 
-FIND_PACKAGE(SalomePyQt4 REQUIRED)
+# Qt
+IF(NOT SALOME_GUI_BUILD_WITH_QT5)
+  FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork QtTest)
+  SET(QT_ROOT_DIR "${QT4_ROOT_DIR}")
+  SALOME_CONFIGURE_PREPARE(HYDROData HYDROGUI HYDROPy Qt4 PyQt4)
+ELSE()
+  FIND_PACKAGE(SalomeQt5 REQUIRED)
+  SET(QT_ROOT_DIR "${QT5_ROOT_DIR}")
+  SALOME_CONFIGURE_PREPARE(HYDROData HYDROGUI HYDROPy Qt5 PyQt5)
+ENDIF()
 
-FIND_PACKAGE(SalomeOmniORB REQUIRED)
+# PyQt
+IF(NOT SALOME_GUI_BUILD_WITH_QT5)
+  FIND_PACKAGE(SalomePyQt4 REQUIRED)
+  SET(PYQT_ROOT_DIR "${PYQT4_ROOT_DIR}")
+ELSE()
+  FIND_PACKAGE(SalomePyQt5 REQUIRED)
+  SET(PYQT_ROOT_DIR "${PYQT5_ROOT_DIR}")
+ENDIF()
 
 # Detection summary:
 SALOME_PACKAGE_REPORT_AND_CHECK()
@@ -175,6 +184,7 @@ MARK_AS_ADVANCED(
 # Sources 
 # ========
 ADD_SUBDIRECTORY (src/shapelib)
+ADD_SUBDIRECTORY (src/HYDRO_tests)
 ADD_SUBDIRECTORY (src/HYDROData)
 ADD_SUBDIRECTORY (src/HYDROGUI)
 ADD_SUBDIRECTORY (src/HYDROPy)
index 0cdc8f5bacc9a6cbae78510c95c70508611c7e81..9aaa587e017c5acf992af6d75141f1fe1902c392 100644 (file)
@@ -269,7 +269,7 @@ HYDROData_SequenceOfObjects HYDROData_Entity::GetAllReferenceObjects() const
   return HYDROData_SequenceOfObjects();
 }
 
-Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const
+bool HYDROData_Entity::GetZLevel( int& theLevel ) const
 {
   theLevel = -1;
 
@@ -280,14 +280,14 @@ Standard_Boolean HYDROData_Entity::GetZLevel( Standard_Integer& theLevel ) const
     if ( aLabel.FindAttribute( TDataStd_Integer::GetID(), anIntVal ) )
     {
       theLevel = anIntVal->Get();
-      return Standard_True;
+      return true;
     }
   }
 
-  return Standard_False;
+  return false;
 }
 
-void HYDROData_Entity::SetZLevel( const Standard_Integer& theLevel )
+void HYDROData_Entity::SetZLevel( int theLevel )
 {
   TDataStd_Integer::Set( myLab.FindChild( DataTag_ZLevel ), theLevel );
 }
index 1e41b044d14dbe337e2390fe0f470e41c7003282..91f74803e7a2c736a0c05c1792ebd848003ae609 100644 (file)
@@ -235,12 +235,12 @@ public:
   /**
    * Returns the z-level for object presentation, -1 if no z-level.
    */
-  HYDRODATA_EXPORT virtual Standard_Boolean GetZLevel( Standard_Integer& theLevel ) const;
+  HYDRODATA_EXPORT virtual bool GetZLevel( int& theLevel ) const;
 
   /**
    * Set the z-level for object presentation.
    */
-  HYDRODATA_EXPORT virtual void SetZLevel( const Standard_Integer& theLevel );
+  HYDRODATA_EXPORT virtual void SetZLevel( int theLevel );
 
   /**
    * Remove the z-level of object presentation.
index 6827d52a0924f46d58d9a61e6e34a5cedc3f7579..ebaeb1e743c04da1b2a06112b0186758edcc7b13 100644 (file)
@@ -116,6 +116,7 @@ public:
 
   HYDRODATA_EXPORT bool Remove( const TopoDS_Face& );
   HYDRODATA_EXPORT bool Remove( const TopTools_ListOfShape& );
+  using HYDROData_Entity::Remove;
 
   HYDRODATA_EXPORT bool Split( const Handle( HYDROData_PolylineXY )& );
   HYDRODATA_EXPORT bool Split( const TopoDS_Shape& );
index 93a75c2a4c212add5c924eefde6668f961afcd02..30a39620a51f79ea15de6cd2675ed94b4f57bb03 100644 (file)
@@ -86,14 +86,14 @@ void HYDROData_ShapeFile::Export(const QString& aFileName,
   SHPHandle hSHPHandle;
   if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
   {
-    hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC );        
+    hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_ARC );        
     for (int i = 1; i <= aPolyXYSeq.Size(); i++)
       if (WriteObjectPolyXY(hSHPHandle, aPolyXYSeq(i)) != 1)
         aNonExpList.append(aPolyXYSeq(i)->GetName());
   }
   else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
   {
-    hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ );
+    hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_ARCZ );
     for (int i = 1; i <= aPoly3DSeq.Size(); i++)
       if (WriteObjectPoly3D(hSHPHandle, aPoly3DSeq(i)) != 1)
         aNonExpList.append(aPoly3DSeq(i)->GetName());
@@ -118,7 +118,7 @@ void HYDROData_ShapeFile::Export(const QString& aFileName, const Handle_HYDRODat
   SHPHandle hSHPHandle = NULL;
   if ( !aLCM.IsNull() && !aLCM->IsEmpty())
   {
-    hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_POLYGON );
+    hSHPHandle = SHPCreate( aFileName.toLatin1().data(), SHPT_POLYGON );
     HYDROData_LandCoverMap::Explorer It( aLCM );
     for( ; It.More(); It.Next())
     {
@@ -494,7 +494,7 @@ int HYDROData_ShapeFile::ImportPolygons(const QString theFileName, QStringList&
   int Stat = TryOpenShapeFile(theFileName);
   if (Stat != 0)
     return Stat;
-  myHSHP = SHPOpen( theFileName.toAscii().data(), "rb" );
+  myHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" );
   if (!Parse(myHSHP, HYDROData_ShapeFile::ShapeType_Polygon, theShapeTypeOfFile))
     return 0;
   for (size_t i = 0; i < mySHPObjects.size(); i++)
@@ -558,10 +558,10 @@ void HYDROData_ShapeFile::ReadSHPPolyXY(Handle(HYDROData_Document) theDocument,
         anObj->padfY[StartIndex] == anObj->padfY[EndIndex - 1] )
     {
       IsClosed = true;
-      aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true);
+      aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, true);
     }
     else
-      aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, false);
+      aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, false);
     
     if (IsClosed)
       EndIndex--;
@@ -611,10 +611,10 @@ void HYDROData_ShapeFile::ReadSHPPoly3D(Handle(HYDROData_Document) theDocument,
         anObj->padfZ[StartIndex] == anObj->padfZ[EndIndex - 1])
     {
       IsClosed = true;
-      aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, true );
+      aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, true );
     }
     else
-      aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toAscii()), aSectType, false  );
+      aPolylineXY->AddSection( TCollection_AsciiString( ("poly_section_" + QString::number(i)).data()->toLatin1()), aSectType, false  );
     
     if (IsClosed)
       EndIndex--;
@@ -670,7 +670,7 @@ int HYDROData_ShapeFile::ImportPolylines(Handle(HYDROData_Document) theDocument,
     anExistingNames.push_back(anIter.Current()->GetName());
 
   SHPHandle aHSHP;
-  aHSHP = SHPOpen( theFileName.toAscii().data(), "rb" );
+  aHSHP = SHPOpen( theFileName.toLatin1().data(), "rb" );
   
   QFileInfo aFileInfo(theFileName);
   QString aBaseFileName = aFileInfo.baseName();
@@ -776,9 +776,9 @@ int HYDROData_ShapeFile::TryOpenShapeFile(QString theFileName)
     return -3;
 
   FILE* pFileSHP = NULL;
-  pFileSHP = fopen (aSHPfile.toAscii().data(), "r");
+  pFileSHP = fopen (aSHPfile.toLatin1().data(), "r");
   FILE* pFileSHX = NULL;
-  pFileSHX = fopen (aSHXfile.toAscii().data(), "r");
+  pFileSHX = fopen (aSHXfile.toLatin1().data(), "r");
 
   if (pFileSHP == NULL || pFileSHX == NULL)
   {
@@ -799,7 +799,7 @@ bool HYDROData_ShapeFile::CheckDBFFileExisting(const QString& theSHPFilePath, QS
   QString aSHPfile = theSHPFilePath.simplified();
   QString aDBFfile = theSHPFilePath.simplified().replace( theSHPFilePath.simplified().size() - 4, 4, ".dbf");
   FILE* pFileDBF = NULL;
-  pFileDBF = fopen (aDBFfile.toAscii().data(), "r");
+  pFileDBF = fopen (aDBFfile.toLatin1().data(), "r");
 
   if (pFileDBF == NULL)
   {
@@ -814,7 +814,7 @@ bool HYDROData_ShapeFile::CheckDBFFileExisting(const QString& theSHPFilePath, QS
 
 bool HYDROData_ShapeFile::DBF_OpenDBF(const QString& thePathToDBFFile)
 {
-  myHDBF = DBFOpen( thePathToDBFFile.toAscii().data(), "r" );
+  myHDBF = DBFOpen( thePathToDBFFile.toLatin1().data(), "r" );
   if(myHDBF != NULL)
     return true;
   else
index bcb457a4c9c59e9e471844a8da893b4bb040a05c..5a04636ad64bf7d86f4362318520ceab12013117 100644 (file)
@@ -1,5 +1,10 @@
 include(../../CMake/Common.cmake)
-include(../../CMake/UseQT4EXT.cmake)
+
+IF (SalomeGUI_VERSION VERSION_LESS "8.0.0")
+  INCLUDE(UseQt4Ext)
+ELSE()
+  INCLUDE(UseQtExt)
+ENDIF()
  
 set(PROJECT_HEADERS 
     HYDROGUI.h
@@ -145,7 +150,11 @@ set(PROJECT_HEADERS
     HYDROGUI_TransparencyDlg.h
 )
 
-QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
+IF(NOT SALOME_GUI_BUILD_WITH_QT5)
+  QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
+ELSE()
+  QT_WRAP_MOC(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
+ENDIF()
 
 set(PROJECT_SOURCES 
     HYDROGUI_AbstractDisplayer.cxx
@@ -334,7 +343,11 @@ set(GUITS_SOURCES
 #include(../../CMake/CommonInstall.cmake)
 
 # resources
-QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_HYDRO_INSTALL_RES_DATA}")
+IF (SalomeGUI_VERSION VERSION_LESS "8.0.0")
+  QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_HYDRO_INSTALL_RES_DATA}")
+ELSE()
+  QT_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_HYDRO_INSTALL_RES_DATA}")
+ENDIF()
 
 FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
 FILE(GLOB GUIXML_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.xml")
index eb5f2539e9528b890fa1fa61dd49f6743b6bd33f..bfb178a459d326b24461dc808ecc7dc5b27ea456 100644 (file)
@@ -19,6 +19,7 @@
 #include "HYDROGUI_DataBrowser.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_DataObject.h"
+#include "HYDROGUI_Tool.h"
 
 #include <LightApp_Application.h>
 #include <LightApp_OBSelector.h>
@@ -277,7 +278,7 @@ HYDROGUI_DataBrowser::HYDROGUI_DataBrowser( HYDROGUI_Module* theModule,
   // Create OBSelector
   new HYDROGUI_OBSelector( this, theModule->getApp()->selectionMgr() );
 
-  treeView()->header()->setResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed);
+  HYDROGUI_Tool::setResizeMode( treeView()->header(), SUIT_DataObject::VisibilityId, QHeaderView::Fixed );
   treeView()->header()->moveSection(SUIT_DataObject::NameId,SUIT_DataObject::VisibilityId);
   treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH);
   treeView()->hideColumn( SUIT_DataObject::VisibilityId );
index 129384322c050ed4b7e82cbc83a746f381318dc8..d2acbf8816d74c3d4f6e0ed061b9124b43044319 100644 (file)
@@ -270,40 +270,40 @@ void HYDROGUI_DataModel::update( const int theStudyId )
   // Create root objects:
 
   // IMAGES
-  LightApp_DataObject* anImageRootObj = createObject( aNewRootObj, tr( partitionName( KIND_IMAGE ).toAscii() ) );
+  LightApp_DataObject* anImageRootObj = createObject( aNewRootObj, tr( partitionName( KIND_IMAGE ).toLatin1() ) );
 
   // BATHYMETRY
-  LightApp_DataObject* aBathymetryRootObj = createObject( aNewRootObj, tr( partitionName( KIND_BATHYMETRY ).toAscii() ) );
+  LightApp_DataObject* aBathymetryRootObj = createObject( aNewRootObj, tr( partitionName( KIND_BATHYMETRY ).toLatin1() ) );
 
   // ARTIFICIAL OBJECTS
-  LightApp_DataObject* anArtificialObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toAscii() ) );
+  LightApp_DataObject* anArtificialObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toLatin1() ) );
 
   // NATURAL OBJECTS
-  LightApp_DataObject* aNaturalObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_NATURAL_OBJECT ).toAscii() ) );
+  LightApp_DataObject* aNaturalObjectsRootObj = createObject( aNewRootObj, tr( partitionName( KIND_NATURAL_OBJECT ).toLatin1() ) );
 
   // OBSTACLES
-  LightApp_DataObject* anObstaclesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_OBSTACLE ).toAscii() ) );
+  LightApp_DataObject* anObstaclesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_OBSTACLE ).toLatin1() ) );
 
   // STRICKLER TABLES
-  LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toAscii() ) );
+  LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toLatin1() ) );
 
   // LAND COVER MAPS
-  LightApp_DataObject* aLandCoversRootObj = createObject( aNewRootObj, tr( partitionName( KIND_LAND_COVER_MAP ).toAscii() ) );
+  LightApp_DataObject* aLandCoversRootObj = createObject( aNewRootObj, tr( partitionName( KIND_LAND_COVER_MAP ).toLatin1() ) );
 
   // CALCULATION CASES
-  LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toAscii() ) );
+  LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toLatin1() ) );
 
   // POLYLINES
-  LightApp_DataObject* aPolylineRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINEXY ).toAscii() ) );
+  LightApp_DataObject* aPolylineRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINEXY ).toLatin1() ) );
 
   // POLYLINES
-  LightApp_DataObject* aPolyline3DRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINE ).toAscii() ) );
+  LightApp_DataObject* aPolyline3DRootObj = createObject( aNewRootObj, tr( partitionName( KIND_POLYLINE ).toLatin1() ) );
 
   // PROFILES
-  LightApp_DataObject* aProfileRootObj = createObject( aNewRootObj, tr( partitionName( KIND_PROFILE ).toAscii() ) );
+  LightApp_DataObject* aProfileRootObj = createObject( aNewRootObj, tr( partitionName( KIND_PROFILE ).toLatin1() ) );
 
   // VISUAL STATES
-  LightApp_DataObject* aVisualStateRootObj = createObject( aNewRootObj, tr( partitionName( KIND_VISUAL_STATE ).toAscii() ) );
+  LightApp_DataObject* aVisualStateRootObj = createObject( aNewRootObj, tr( partitionName( KIND_VISUAL_STATE ).toLatin1() ) );
 
   int aNoStricklerTableObj = 0;
   HYDROData_Iterator anIterator( aDocument, KIND_UNKNOWN );
@@ -964,10 +964,10 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent,
       createObject( aPolylineSect, aPolyline, aGuiObj->entry(), false );
 
     LightApp_DataObject* aCaseAOSect = 
-      createObject( aGuiObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toAscii() ),
+      createObject( aGuiObj, tr( partitionName( KIND_ARTIFICIAL_OBJECT ).toLatin1() ),
                     aGuiObj->entry() );
     LightApp_DataObject* aCaseNOSect = 
-      createObject( aGuiObj, tr( partitionName( KIND_NATURAL_OBJECT ).toAscii() ),
+      createObject( aGuiObj, tr( partitionName( KIND_NATURAL_OBJECT ).toLatin1() ),
                     aGuiObj->entry() );
 
     HYDROData_SequenceOfObjects aSeq = aCaseObj->GetGeometryObjects();
index 8ec9658dab3b3c3120276eaca84a192d9b5e15f6..890e29a9b62441aaf0e15f14a286ab519bf246d5 100644 (file)
@@ -161,7 +161,7 @@ QPixmap HYDROGUI_DataObject::icon( const int theId ) const
           anObjectKind = aFatherObj->GetKind();
       }
 
-      anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toAscii() );
+      anIcon = QObject::tr( QString("HYDRO_%1TYPE%2_ICO").arg( aNeedUpdate ).arg( anObjectKind ).toLatin1() );
     }
 
     return aResMgr->loadPixmap( "HYDRO", anIcon );
index 5180be14dbbc8096ae41ed94feb50661706017b3..1179745d227bc5a64faf0745a680b021673e7916 100644 (file)
@@ -179,14 +179,14 @@ void HYDROGUI_GeomObjectDlg::onBrowse()
 {
   SUIT_FileDlg* aFileDlg = new SUIT_FileDlg( this, true );
   aFileDlg->setWindowTitle( tr("IMPORT_OBSTACLE_FROM_FILE") );
-  aFileDlg->setFilter( tr("OBSTACLE_FILTER") );
+  aFileDlg->setNameFilter( tr("OBSTACLE_FILTER") );
   if ( !lastUsedFilter.isEmpty() ) {
-    aFileDlg->selectFilter( lastUsedFilter );
+    aFileDlg->selectNameFilter( lastUsedFilter );
   }
 
   if ( aFileDlg->exec() == QDialog::Accepted ) {
     QString aFileName = aFileDlg->selectedFile();
-    lastUsedFilter = aFileDlg->selectedFilter();
+    lastUsedFilter = aFileDlg->selectedNameFilter();
 
     if ( !aFileName.isEmpty() ) {
       myFileName->setText( aFileName );
@@ -261,4 +261,4 @@ void HYDROGUI_GeomObjectDlg::setDefaultName( const QString& theName )
 QString HYDROGUI_GeomObjectDlg::getDefaultName()
 {
   return myDefaultName;
-}
\ No newline at end of file
+}
index d99c13e4a83535de39e21cc95cb03a0a8078bb90..2d2e8bd626a4744ac560339e4c0beb6891e97898 100644 (file)
@@ -29,6 +29,7 @@
 #include <SUIT_Session.h>
 #include <SUIT_FileDlg.h>
 #include <HYDROGUI_Module.h>
+#include <HYDROGUI_Tool.h>
 #include <SUIT_MessageBox.h>
 #include <LightApp_Application.h>
 #include <QTableWidget>
@@ -269,7 +270,7 @@ void HYDROGUI_ImportLandCoverMapDlg::FillCorrespondenceTable(const QStringList&
   myCorrTableWidget->setHorizontalHeaderItem(0, aHeader_1);
   myCorrTableWidget->setHorizontalHeaderItem(1, aHeader_2);
   myCorrTableWidget->setHorizontalHeaderItem(2, aHeader_3);
-  myCorrTableWidget->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents );
+  HYDROGUI_Tool::setResizeMode( myCorrTableWidget->horizontalHeader(), QHeaderView::ResizeToContents );
   //
   for (int i = 0; i < aFCSize; i++)
   {
@@ -453,4 +454,4 @@ bool HYDROGUI_ImportLandCoverMapDlg::CheckFirstPageFilling() const
      return false;
   }
   return true;
-}
\ No newline at end of file
+}
index 5a639978d1e1eb1117568d4c8f829e6949ec5e3f..9c0743c0b3fcfd68c5f119daad92b4a5ca1bcdce 100644 (file)
@@ -72,9 +72,9 @@ void HYDROGUI_ImportObstacleFromFileOp::startOperation()
   } else {
     myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true );
     myFileDlg->setWindowTitle( getName() );
-    myFileDlg->setFilter( tr("OBSTACLE_FILTER") );
+    myFileDlg->setNameFilter( tr("OBSTACLE_FILTER") );
     if ( !lastUsedFilter.isEmpty() ) {
-      myFileDlg->selectFilter( lastUsedFilter );
+      myFileDlg->selectNameFilter( lastUsedFilter );
     }
 
     connect( myFileDlg, SIGNAL( accepted() ),      this, SLOT( onApply()  ) );
@@ -118,7 +118,7 @@ bool HYDROGUI_ImportObstacleFromFileOp::processApply( int& theUpdateFlags,
   } else if ( myFileDlg ) {
     // Get file name and file filter defined by the user
     aFileName = myFileDlg->selectedFile();
-    lastUsedFilter = myFileDlg->selectedFilter();
+    lastUsedFilter = myFileDlg->selectedNameFilter();
   }
 
   // Check the file name
@@ -195,4 +195,4 @@ HYDROGUI_InputPanel* HYDROGUI_ImportObstacleFromFileOp::createInputPanel() const
   }
 
   return aPanel;
-}
\ No newline at end of file
+}
index 7cdbd1ed7decc6f854da5299b6d5e828aec373b8..a82fecdb5795db57d6b50d0fd3116b11ee371d5c 100644 (file)
@@ -58,7 +58,7 @@ void HYDROGUI_ImportPolylineOp::startOperation()
   myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true );
   myFileDlg->setWindowTitle( getName() );
   myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles );
-  myFileDlg->setFilter( tr("POLYLINE_FILTER") );
+  myFileDlg->setNameFilter( tr("POLYLINE_FILTER") );
 
   connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) );
   connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
index deaab0c3de442f6a06a0e9e01244806828bb371b..9e12b9eebd004777213c2423e9d64751b93129c5 100644 (file)
@@ -52,7 +52,7 @@ void HYDROGUI_ImportProfilesOp::startOperation()
   myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true );
   myFileDlg->setWindowTitle( getName() );
   myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles );
-  myFileDlg->setFilter( tr("PROFILE_FILTER") );
+  myFileDlg->setNameFilter( tr("PROFILE_FILTER") );
 
   connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) );
   connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
index 4f30e80256c3ee52da222e821eadd0570ff4b6b4..6907a30fbbd9db0a3ad312d6abf7a802284117af 100644 (file)
@@ -59,7 +59,7 @@ void HYDROGUI_ImportSinusXOp::startOperation()
   myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true );
   myFileDlg->setWindowTitle( getName() );
   myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles );
-  myFileDlg->setFilter( tr("SINUSX_FILTER") );
+  myFileDlg->setNameFilter( tr("SINUSX_FILTER") );
 
   connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) );
   connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
index b112dd34a5c3d2261b47df452e377369f3654e54..9355bbd48fb97b286b4630642f8eaf5d7e22a07e 100644 (file)
@@ -51,9 +51,6 @@ HYDROGUI_ListModel::HYDROGUI_ListModel( QObject* theParent )
     myEye = QPixmap( 16, 16 );
     myEye.fill( Qt::black );
   }
-
-  // Set the supported drag actions for the items in the model
-  setSupportedDragActions( Qt::MoveAction | Qt::CopyAction );
 }
 
 /**
@@ -63,6 +60,11 @@ HYDROGUI_ListModel::~HYDROGUI_ListModel()
 {
 }
 
+Qt::DropActions HYDROGUI_ListModel::supportedDragActions() const
+{
+  return Qt::MoveAction | Qt::CopyAction;
+}
+
 /**
 */
 QVariant HYDROGUI_ListModel::data( const QModelIndex &theIndex, int theRole ) const
@@ -128,9 +130,9 @@ int HYDROGUI_ListModel::rowCount( const QModelIndex &theParent ) const
 */
 void HYDROGUI_ListModel::setObjects( const Object2VisibleList& theObjects )
 {
+  beginResetModel();
   myObjects = theObjects;
-
-  reset();
+  endResetModel();
 }
 
 /**
@@ -154,9 +156,9 @@ HYDROGUI_ListModel::ObjectList HYDROGUI_ListModel::getObjects() const
 */
 void HYDROGUI_ListModel::addObject( const Object2Visible& theObject )
 {
+  beginResetModel();
   myObjects << theObject;
-
-  reset();
+  endResetModel();
 }
 
 /**
@@ -165,16 +167,15 @@ void HYDROGUI_ListModel::addObject( const Object2Visible& theObject )
 */
 void HYDROGUI_ListModel::removeObjectByName( const QString& theObjectName )
 {
+  beginResetModel();
   Object2Visible anItem;
   foreach( anItem, myObjects ) {
     if ( anItem.first->GetName() == theObjectName ) {
       break;
     }
   }
-
   myObjects.removeAll(anItem);
-
-  reset();
+  endResetModel();
 }
 
 
@@ -492,6 +493,7 @@ void HYDROGUI_ListModel::setDecorationEnabled( const bool theIsToEnable )
 
 void HYDROGUI_ListModel::undoLastMove()
 {
+  beginResetModel();
   myObjects = myPrevObjects;
-  reset();
+  endResetModel();
 }
index adc0e42c1e55996eb0fc00674b9becedf024e66d..920222e9b215f8dd96ce4a7aa056c17a57e5033c 100644 (file)
@@ -56,6 +56,7 @@ public:
   virtual QStringList mimeTypes() const;
   virtual bool dropMimeData( const QMimeData* theData, Qt::DropAction theAction,
                              int theRow, int theColumn, const QModelIndex& theParent );
+  virtual Qt::DropActions supportedDragActions() const;
   virtual Qt::DropActions supportedDropActions() const;
 
   QList<int> getIds( const QModelIndexList& theIndexes, bool theIsToSort = true ) const;
@@ -88,4 +89,4 @@ private:
   bool myIsDecorationEnabled;
 };
 
-#endif
\ No newline at end of file
+#endif
index 0d7061cb0a91ebeaacb9c2198c90c28918151449..0b008616eb8ae6a49aee0c150043d076ce3f742e 100644 (file)
@@ -530,7 +530,6 @@ void HYDROGUI_PriorityTableModel::undoLastChange()
   beginResetModel();
   myRules = myPrevRules;
   endResetModel();
-  reset();
 }
 
 /**
index e6e15e01ab30be5cacd3357085e3af3866c8493f..59ef21ae9dbf5303df845c6bf8351e8a175ff003 100644 (file)
@@ -17,9 +17,8 @@
 //
 
 #include "HYDROGUI_PriorityWidget.h"
-
 #include "HYDROGUI_PriorityTableModel.h"
-
+#include "HYDROGUI_Tool.h"
 #include "HYDROData_PriorityQueue.h"
 
 #include <SUIT_MessageBox.h>
@@ -154,12 +153,12 @@ HYDROGUI_PriorityWidget::HYDROGUI_PriorityWidget( QWidget* theParent )
 
   // Set resize mode
   myTable->horizontalHeader()->setStretchLastSection( false);
-  myTable->horizontalHeader()->setResizeMode( 0, QHeaderView::Stretch );
-  myTable->horizontalHeader()->setResizeMode( 1, QHeaderView::ResizeToContents );
-  myTable->horizontalHeader()->setResizeMode( 2, QHeaderView::Stretch );
-  myTable->horizontalHeader()->setResizeMode( 3, QHeaderView::ResizeToContents );
+  HYDROGUI_Tool::setResizeMode( myTable->horizontalHeader(), 0, QHeaderView::Stretch );
+  HYDROGUI_Tool::setResizeMode( myTable->horizontalHeader(), 1, QHeaderView::ResizeToContents );
+  HYDROGUI_Tool::setResizeMode( myTable->horizontalHeader(), 2, QHeaderView::Stretch );
+  HYDROGUI_Tool::setResizeMode( myTable->horizontalHeader(), 3, QHeaderView::ResizeToContents );
 
-  myTable->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
+  HYDROGUI_Tool::setResizeMode( myTable->verticalHeader(), QHeaderView::ResizeToContents );
  
   // Layout
   // buttons
index 6c14e957b622ccf0a18bf9efc689452617cb6606..16b607042577f4a329a1524c8d7d87f80a3549c6 100644 (file)
@@ -46,7 +46,7 @@ HYDROGUI_ColorDelegate::~HYDROGUI_ColorDelegate()
 void HYDROGUI_ColorDelegate::paint( QPainter* thePainter, const QStyleOptionViewItem& theOption,
                                     const QModelIndex& theIndex ) const
 {
-  QColor aColor = qVariantValue<QColor>( theIndex.data( Qt::BackgroundColorRole ) );
+  QColor aColor = qvariant_cast<QColor>( theIndex.data( Qt::BackgroundColorRole ) );
   thePainter->fillRect( theOption.rect, aColor );
 }
 
@@ -54,7 +54,7 @@ QWidget* HYDROGUI_ColorDelegate::createEditor( QWidget* theParent,
                                                const QStyleOptionViewItem& theOption,
                                                const QModelIndex& theIndex ) const
 {
-  QColor aColor = qVariantValue<QColor>( theIndex.data( Qt::BackgroundColorRole ) );
+  QColor aColor = qvariant_cast<QColor>( theIndex.data( Qt::BackgroundColorRole ) );
   QColor aNewColor = QColorDialog::getColor( aColor );
   if( aNewColor.isValid() )
   {
@@ -166,13 +166,14 @@ HYDROGUI_StricklerTableDlg::HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModu
     myTable->setHorizontalHeaderLabels( aColumnNames );
 
     myTable->horizontalHeader()->setStretchLastSection( false );
-    myTable->horizontalHeader()->setResizeMode( 0, QHeaderView::ResizeToContents );
-    myTable->horizontalHeader()->setResizeMode( 1, QHeaderView::ResizeToContents );
-    myTable->horizontalHeader()->setResizeMode( 2, QHeaderView::ResizeToContents );
-    myTable->horizontalHeader()->setResizeMode( 3, QHeaderView::Stretch );
+    
+    HYDROGUI_Tool::setResizeMode( myTable->horizontalHeader(), 0, QHeaderView::ResizeToContents );
+    HYDROGUI_Tool::setResizeMode( myTable->horizontalHeader(), 1, QHeaderView::ResizeToContents );
+    HYDROGUI_Tool::setResizeMode( myTable->horizontalHeader(), 2, QHeaderView::ResizeToContents );
+    HYDROGUI_Tool::setResizeMode( myTable->horizontalHeader(), 3, QHeaderView::Stretch );
     myTable->horizontalHeader()->setMinimumSectionSize( 50 );
 
-    myTable->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
+    HYDROGUI_Tool::setResizeMode( myTable->verticalHeader(), QHeaderView::ResizeToContents );
 
     // Layout
     // buttons
index f86499f2b94171631fa6e7e5688ecdeb05ebc8ee..5b3fdd0dd7b686a99dc23560336d4bdde96811a4 100644 (file)
@@ -32,6 +32,7 @@
 #include <QStringList>
 #include <QTextCodec>
 #include <QWidget>
+#include <QHeaderView>
 
 // Definition of this id allows to use 'latin1' (Qt alias for 'ISO-8859-1')
 // encoding instead of default 'System'
@@ -339,3 +340,20 @@ Handle(Image_PixMap) HYDROGUI_Tool::Pixmap( const QImage& theImage )
     return pix;
 }
 
+void HYDROGUI_Tool::setResizeMode( QHeaderView* theHeader, int theSection, int theMode )
+{
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+  theHeader->setResizeMode( theSection, (QHeaderView::ResizeMode)theMode );
+#else
+  theHeader->setSectionResizeMode( theSection, (QHeaderView::ResizeMode)theMode );
+#endif
+}
+
+void HYDROGUI_Tool::setResizeMode( QHeaderView* theHeader, int theMode )
+{
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+  theHeader->setResizeMode( (QHeaderView::ResizeMode)theMode );
+#else
+  theHeader->setSectionResizeMode( (QHeaderView::ResizeMode)theMode );
+#endif
+}
index 99aa175ced8d12252890a750a76b02fa0c649292..1c6587944d3db876b92575d15710d19f33ec2587 100644 (file)
@@ -30,6 +30,7 @@ class Handle_TCollection_HExtendedString;
 class QDockWidget;
 class QImage;
 class QWidget;
+class QHeaderView;
 
 namespace HYDROGUI_Tool
 {
@@ -59,6 +60,9 @@ namespace HYDROGUI_Tool
   HYDROData_SequenceOfObjects GetObjectBackReferences( const Handle(HYDROData_Entity)& theObj );
   QMap<QString,HYDROData_SequenceOfObjects> GetObjectsBackReferences
     ( const Handle_HYDROData_Document& theDocument, const QStringList& theObjectNames );
+    
+  void setResizeMode( QHeaderView* theHeader, int theSection, int theMode );
+  void setResizeMode( QHeaderView* theHeader, int theMode );
 };
 
 #endif
index c87743e04fb7e78f46a76669b74a744d364c7aad..ef1962e806843c903ee22a05a0b1f0821fc2bd86 100644 (file)
@@ -244,7 +244,7 @@ ObjectKind HYDROGUI_Tool::GetSelectedPartition( HYDROGUI_Module* theModule )
     {
       anEntry.remove( aPrefix );
       for( ObjectKind anObjectKind = KIND_UNKNOWN + 1; anObjectKind <= KIND_LAST; anObjectKind++ )
-        if( HYDROGUI_DataModel::tr( HYDROGUI_DataModel::partitionName( anObjectKind ).toAscii() ) == anEntry )
+        if( HYDROGUI_DataModel::tr( HYDROGUI_DataModel::partitionName( anObjectKind ).toLatin1() ) == anEntry )
           return anObjectKind;
     }
   }
index c16dbb01f8309fcaf873fe1eedb65cb939a10234..925f013ccea1c83b7dc41df479c7f746bcf8602b 100644 (file)
@@ -34,7 +34,7 @@ HYDROGUI_VTKPrs::HYDROGUI_VTKPrs( const Handle(HYDROData_Entity)& theObject )
   // Define IO for actors to be added:
   QString anEntry = HYDROGUI_DataObject::dataObjectEntry( theObject );
   myIO = new SALOME_InteractiveObject(
-    anEntry.toAscii(), QString::number( theObject->GetKind() ).toAscii(), theObject->GetName().toAscii() );
+    anEntry.toLatin1(), QString::number( theObject->GetKind() ).toLatin1(), theObject->GetName().toLatin1() );
   myZRange[0] = HYDROData_IAltitudeObject::GetInvalidAltitude();
   myZRange[1] = HYDROData_IAltitudeObject::GetInvalidAltitude();
 }
index c15ed61c1ec8d59534416235a69205981f2be9ad..aace69f24f63a4cb46f12b62774ae6bed8516afe 100644 (file)
@@ -1,5 +1,10 @@
 include(../../CMake/Common.cmake)
-include(UsePyQt4)
+IF (SalomeGUI_VERSION VERSION_LESS "8.0.0")
+  include(UsePyQt4)
+ELSE()
+  include(UsePyQt)
+ENDIF()
 
 # --- options ---
 
@@ -87,7 +92,11 @@ SET(_add_SOURCES
 # --- sources ---
 
 # sources / sip wrappings
-PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files} SOURCES ${_add_SOURCES})
+IF (SalomeGUI_VERSION VERSION_LESS "8.0.0")
+  PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files} SOURCES ${_add_SOURCES})
+ELSE()
+  PYQT_WRAP_SIP(_sip_SOURCES ${_sip_files} SOURCES ${_add_SOURCES})
+ENDIF()
 
 # sources / to compile
 SET(HYDROPy_SOURCES ${_sip_SOURCES})
index fda3ec35f600f2b261d308cce52eb00da927b7ba..1986b5c182075987449fd7eb99b033a2b5471b08 100644 (file)
@@ -244,12 +244,12 @@ public:
   /**
    * Returns the z-level for object presentation, -1 if no z-level.
    */
-  virtual bool GetZLevel( int& theLevel ) const [Standard_Boolean ( Standard_Integer& )];
+  virtual bool GetZLevel( int& theLevel ) const;
 
   /**
    * Set the z-level for object presentation.
    */
-  virtual void SetZLevel( const int& theLevel ) [void ( const Standard_Integer& )];
+  virtual void SetZLevel( int theLevel );
 
   /**
    * Remove the z-level of object presentation.
index 07c05917aede7b15df4f99c2ada18b0ffb534611..61cc4e7fee05c853efd7efb15167a249c53f2985 100644 (file)
@@ -61,7 +61,7 @@ ENDIF()
 
 SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT_DIR}/include )
 SET( CAS_INCLUDES $ENV{CAS_ROOT_DIR}/inc )
-SET( QT_INCLUDES $ENV{QT4_ROOT_DIR}/include $ENV{QT4_ROOT_DIR}/include/QtCore $ENV{QT4_ROOT_DIR}/include/QtGui $ENV{QT4_ROOT_DIR}/include/QtTest )
+#SET( QT_INCLUDES $ENV{QT_ROOT_DIR}/include $ENV{QT_ROOT_DIR}/include/QtCore $ENV{QT_ROOT_DIR}/include/QtGui $ENV{QT_ROOT_DIR}/include/QtTest )
 SET( KERNEL_INCLUDES $ENV{KERNEL_ROOT_DIR}/include/salome )
 SET( GUI_INCLUDES $ENV{GUI_ROOT_DIR}/include/salome )
 SET( GEOM_INCLUDES $ENV{GEOM_ROOT_DIR}/include/salome )
@@ -73,12 +73,12 @@ ELSE()
 ENDIF()
 SET( CAS_LIBRARIES TKernel TKLCAF TKCAF TKCDF TKMath TKG2d TKG3d TKBRep TKGeomBase TKTopAlgo TKGeomAlgo TKBool TKShHealing TKXSBase TKOffset TKHLR TKBO TKV3d TKService TKMesh )
 
-link_directories( $ENV{QT4_ROOT_DIR}/lib )
-IF( ${WIN32} )
-  SET( QT_LIBRARIES QtCored4 QtGuid4 QtTestd4 )
-ELSE()
-  SET( QT_LIBRARIES QtCore QtGui QtTest )
-ENDIF()
+#link_directories( $ENV{QT4_ROOT_DIR}/lib )
+#IF( ${WIN32} )
+#  SET( QT_LIBRARIES QtCored4 QtGuid4 QtTestd4 )
+#ELSE()
+#  SET( QT_LIBRARIES QtCore QtGui QtTest )
+#ENDIF()
 
 link_directories( $ENV{CPPUNIT_ROOT_DIR}/lib )
 IF( ${WIN32} )
index df610ea5e60fc1914e2ae4dcc3ea981073e5981a..97d01b8e6d9e5fc1711bbf3e25d032d9491ea9a5 100644 (file)
@@ -1,5 +1,8 @@
-
-find_package(Qt4 4.8.4 REQUIRED QtCore QtGui )
+IF (SalomeGUI_VERSION VERSION_LESS "8.0.0")
+  INCLUDE(UseQt4Ext)
+ELSE()
+  INCLUDE(UseQtExt)
+ENDIF()
 
 set( EXTERNAL_FILES
   ../HYDROData/HYDROData_AltitudeObject.cxx
@@ -73,4 +76,8 @@ set( MOC_HEADERS
   ../HYDROGUI/HYDROGUI_StricklerTableDlg.h
 )
 
-QT4_WRAP_CPP( PROJECT_MOC_HEADERS ${MOC_HEADERS} )
+IF (SalomeGUI_VERSION VERSION_LESS "8.0.0")
+  QT4_WRAP_CPP( PROJECT_MOC_HEADERS ${MOC_HEADERS} )
+ELSE()
+  QT_WRAP_MOC( PROJECT_MOC_HEADERS ${MOC_HEADERS} )
+ENDIF()
index 74bb9315a863e903d4f1108102d06f6913aa95a9..90a5559e02701917a02d36dee560a84d8a7e8562 100644 (file)
@@ -40,7 +40,11 @@ int main( int argc, char* argv[] )
   int W = 800, H = 600;
   aWindow->setGeometry( 200, 200, W, H );
   aWindow->show();
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   QTest::qWaitForWindowShown( aWindow );
+#else
+  QTest::qWaitForWindowExposed( aWindow );
+#endif
 
   int dy = 34;
   //std::cout << dx << "," << dy << std::endl;