]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Porting to Qt4.
authormkr <mkr@opencascade.com>
Thu, 5 Jul 2007 12:15:04 +0000 (12:15 +0000)
committermkr <mkr@opencascade.com>
Thu, 5 Jul 2007 12:15:04 +0000 (12:15 +0000)
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI.h
src/GEOMToolsGUI/GEOMToolsGUI.pro [new file with mode: 0644]
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h
src/src.pro

index 4a3e34a712e293906ffdd6da76e943cf594fd476..6a14b957104b7f16759eed79f073690c01f8c102 100644 (file)
 #include "GEOMToolsGUI.h"
 
 #include "GeometryGUI.h"
-#include "GEOM_Actor.h"
 #include "GEOMBase.h"
 #include "GEOM_Operation.h"
 #include "GEOM_Displayer.h"
 
 #include <SUIT_Session.h>
-#include <SUIT_Application.h>
+//#include <SUIT_Application.h>
 #include <SUIT_OverrideCursor.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_Tools.h>
 #include <SUIT_FileDlg.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ViewModel.h>
+#include <SUIT_ViewManager.h>
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
 #include <LightApp_SelectionMgr.h>
 #include <GEOMImpl_Types.hxx>
 
+#include <SALOME_ListIO.hxx>
 #include <SALOME_ListIteratorOfListIO.hxx>
 #include <SALOME_Prs.h>
 
-#include "utilities.h"
-
 // QT Includes
-#include <qapplication.h>
-#include <qmap.h>
+#include <QApplication>
+#include <QMap>
 
 // OCCT Includes
 #include <TCollection_AsciiString.hxx>
@@ -83,13 +82,13 @@ static QString getFileName( QWidget*           parent,
 
   SUIT_FileDlg* fd = new SUIT_FileDlg( parent, open, true, true );
   if ( !caption.isEmpty() )
-    fd->setCaption( caption );
+    fd->setWindowTitle( caption );
 
   if ( !initial.isEmpty() )
-    fd->setSelection( initial );
+    fd->selectFile( initial );
 
   if ( !lastUsedFilter.isEmpty() && filterMap.contains( lastUsedFilter ) )
-    fd->setSelectedFilter( lastUsedFilter );
+    fd->selectFilter( lastUsedFilter );
 
   fd->setFilters( filters );
 
@@ -280,10 +279,10 @@ void GEOMToolsGUI::OnEditDelete()
 
        bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
        if ( aLocked ) {
-         SUIT_MessageBox::warn1 ( app->desktop(),
-                                  QObject::tr("WRN_WARNING"),
-                                  QObject::tr("WRN_STUDY_LOCKED"),
-                                  QObject::tr("BUT_OK") );
+         SUIT_MessageBox::warning ( app->desktop(),
+                                    QObject::tr("WRN_WARNING"),
+                                    QObject::tr("WRN_STUDY_LOCKED"),
+                                    QObject::tr("BUT_OK") );
          return;
        }
 
@@ -294,31 +293,32 @@ void GEOMToolsGUI::OnEditDelete()
        QString geomComp = getParentComponent( aStudy->FindObjectIOR( geomIOR.in() ) );
 
        if ( parentComp != geomComp )  {
-         SUIT_MessageBox::warn1 ( app->desktop(),
-                                 QObject::tr("ERR_ERROR"),
-                                 QObject::tr("NON_GEOM_OBJECTS_SELECTED").arg( getGeometryGUI()->moduleName() ),
-                                 QObject::tr("BUT_OK") );
+         SUIT_MessageBox::warning ( app->desktop(),
+                                    QObject::tr("ERR_ERROR"),
+                                    QObject::tr("NON_GEOM_OBJECTS_SELECTED").arg( getGeometryGUI()->moduleName() ),
+                                    QObject::tr("BUT_OK") );
          return;
        }
        // VSR 17/11/04: check if all objects selected belong to GEOM component <-- finish
 
-       if ( SUIT_MessageBox::warn2( app->desktop(),
-                                    QObject::tr( "GEOM_WRN_WARNING" ),
-                                    QObject::tr( "GEOM_REALLY_DELETE" ),
-                                    QObject::tr( "GEOM_BUT_YES" ),
-                                    QObject::tr( "GEOM_BUT_NO" ), 1, 0, 0 ) != 1 )
+       if ( SUIT_MessageBox::warning( app->desktop(),
+                                      QObject::tr( "GEOM_WRN_WARNING" ),
+                                      QObject::tr( "GEOM_REALLY_DELETE" ),
+                                      QObject::tr( "GEOM_BUT_YES" ),
+                                      QObject::tr( "GEOM_BUT_NO" ), 1 ) != 0 )
          return;
 
        //      QAD_Operation* op = new SALOMEGUI_ImportOperation(.....);
        //      op->start();
 
        // prepare list of SALOME_Views
-       QPtrList<SALOME_View> views;
+       QList<SALOME_View*> views;
        SALOME_View* view;
        // fill the list
        ViewManagerList vmans = app->viewManagers();
        SUIT_ViewManager* vman;
-       for ( vman = vmans.first(); vman; vman = vmans.next() ) {
+       QListIterator<SUIT_ViewManager*> it( vmans );
+       while ( it.hasNext() && (vman = it.next()) ) {
          SUIT_ViewModel* vmod = vman->getViewModel();
          view = dynamic_cast<SALOME_View*> ( vmod ); // must work for OCC and VTK views
          if ( view )
@@ -439,19 +439,19 @@ bool GEOMToolsGUI::Import()
 
   bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
   if ( aLocked ) {
-    SUIT_MessageBox::warn1 ( app->desktop(),
-                           QObject::tr("WRN_WARNING"),
-                           QObject::tr("WRN_STUDY_LOCKED"),
-                           QObject::tr("BUT_OK") );
+    SUIT_MessageBox::warning ( app->desktop(),
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr("WRN_STUDY_LOCKED"),
+                              QObject::tr("BUT_OK") );
     return false;
   }
 
   GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
   if ( CORBA::is_nil( eng ) ) {
-    SUIT_MessageBox::error1( app->desktop(),
-                           QObject::tr("WRN_WARNING"),
-                           QObject::tr( "GEOM Engine is not started" ),
-                           QObject::tr("BUT_OK") );
+    SUIT_MessageBox::critical( app->desktop(),
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr( "GEOM Engine is not started" ),
+                              QObject::tr("BUT_OK") );
       return false;
     }
 
@@ -478,7 +478,7 @@ bool GEOMToolsGUI::Import()
     {
       // Trying to detect file type
       QFileInfo aFileInfo( fileName );
-      QString aPossibleType = (aFileInfo.extension(false)).upper() ;
+      QString aPossibleType = (aFileInfo.suffix()).toUpper() ;
 
       if ( (aMap.values()).contains(aPossibleType) )
        fileType = aPossibleType;
@@ -495,8 +495,8 @@ bool GEOMToolsGUI::Import()
 
     anOp->start();
 
-    CORBA::String_var fileN = fileName.latin1();
-    CORBA::String_var fileT = fileType.latin1();
+    CORBA::String_var fileN = fileName.toLatin1().data();
+    CORBA::String_var fileT = fileType.toLatin1().data();
     anObj = aInsOp->Import(fileN, fileT);
 
     if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
@@ -507,7 +507,7 @@ bool GEOMToolsGUI::Import()
       GeometryGUI::GetGeomGen()->PublishInStudy(aDSStudy,
                                                SALOMEDS::SObject::_nil(),
                                                anObj,
-                                               aPublishObjName);
+                                               aPublishObjName.toStdString().c_str());
 
       GEOM_Displayer( stud ).Display( anObj.in() );
 
@@ -519,10 +519,10 @@ bool GEOMToolsGUI::Import()
     else {
       anOp->abort();
       wc.suspend();
-      SUIT_MessageBox::error1( app->desktop(),
-                             QObject::tr( "GEOM_ERROR" ),
-                             QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
-                             QObject::tr("BUT_OK") );
+      SUIT_MessageBox::critical( app->desktop(),
+                                QObject::tr( "GEOM_ERROR" ),
+                                QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
+                                QObject::tr("BUT_OK") );
     }
   }
   catch( const SALOME::SALOME_Exception& S_ex ) {
@@ -555,10 +555,10 @@ bool GEOMToolsGUI::Export()
 
   GEOM::GEOM_Gen_var eng = GeometryGUI::GetGeomGen();
   if ( CORBA::is_nil( eng ) ) {
-    SUIT_MessageBox::error1( app->desktop(),
-                            QObject::tr("WRN_WARNING"),
-                            QObject::tr( "GEOM Engine is not started" ),
-                            QObject::tr("BUT_OK") );
+    SUIT_MessageBox::critical( app->desktop(),
+                              QObject::tr("WRN_WARNING"),
+                              QObject::tr( "GEOM Engine is not started" ),
+                              QObject::tr("BUT_OK") );
     return false;
   }
 
@@ -607,7 +607,7 @@ bool GEOMToolsGUI::Export()
       anOp->start();
 
 
-      aInsOp->Export( anObj, file, fileType.latin1() );
+      aInsOp->Export( anObj, file.toStdString().c_str(), fileType.toLatin1().constData() );
 
       if ( aInsOp->IsDone() )
        anOp->commit();
@@ -615,10 +615,10 @@ bool GEOMToolsGUI::Export()
        {
          anOp->abort();
          wc.suspend();
-         SUIT_MessageBox::error1( app->desktop(),
-                                  QObject::tr( "GEOM_ERROR" ),
-                                  QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
-                                  QObject::tr("BUT_OK") );
+         SUIT_MessageBox::critical( app->desktop(),
+                                    QObject::tr( "GEOM_ERROR" ),
+                                    QObject::tr("GEOM_PRP_ABORT") + "\n" + QString( aInsOp->GetErrorCode() ),
+                                    QObject::tr("BUT_OK") );
          return false;
        }
     }
@@ -677,7 +677,7 @@ QString GEOMToolsGUI::getParentComponent( _PTR( SObject ) obj )
 //=====================================================================================
 void GEOMToolsGUI::RemoveObjectWithChildren(_PTR(SObject) obj,
                                             _PTR(Study) aStudy,
-                                            QPtrList<SALOME_View> views,
+                                            QList<SALOME_View*> views,
                                             GEOM_Displayer* disp)
 {
   // iterate through all children of obj
@@ -699,11 +699,11 @@ void GEOMToolsGUI::RemoveObjectWithChildren(_PTR(SObject) obj,
     GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
     if (!CORBA::is_nil(geomObj)) {
       // Erase graphical object
-      SALOME_View* view = views.first();
-      for (; view; view = views.next()) {
-        disp->Erase(geomObj, true, view);
-      }
-
+      QListIterator<SALOME_View*> it( views );
+      while ( it.hasNext() )
+       if ( SALOME_View* view = it.next() )
+         disp->Erase(geomObj, true, view);
+      
       // Remove object from Engine
       GeometryGUI::GetGeomGen()->RemoveObject( geomObj );
     }
@@ -732,10 +732,10 @@ bool GEOMToolsGUI::CheckSubObjectInUse(_PTR(SObject) checkobj,
        SalomeApp_Application* app =
          dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
 
-       SUIT_MessageBox::warn1 ( app->desktop(),
-                                QObject::tr("WRN_WARNING"),
-                                QObject::tr("DEP_OBJECT"),
-                                QObject::tr("BUT_OK") );
+       SUIT_MessageBox::warning ( app->desktop(),
+                                  QObject::tr("WRN_WARNING"),
+                                  QObject::tr("DEP_OBJECT"),
+                                  QObject::tr("BUT_OK") );
        return true;
       }
     }
index 07dec456eff32f3a6e2d154a6cdc12623ccf8efd..d8f583a64a01480605869376e5dbec101c389017 100644 (file)
 #include "GEOM_ToolsGUI.hxx"
 
 #include "GEOMGUI.h"
-#include "GEOM_Displayer.h"
-
-#include <SALOME_Prs.h>
 
 #include <SALOMEDSClient.hxx>
-#include <SALOME_ListIO.hxx>
 
-#include <CORBA.h>
+class GEOM_Displayer;
+class SALOME_View;
+class SALOME_ListIO;
 
-#include <qptrlist.h>
+#include <QList>
 
 //=================================================================================
 // class    : GEOMToolsGUI
@@ -85,7 +83,7 @@ private:
   // Recursive deletion of object with children
   void RemoveObjectWithChildren(_PTR(SObject) obj,
                                _PTR(Study) aStudy,
-                               QPtrList<SALOME_View> views,
+                               QList<SALOME_View*> views,
                                GEOM_Displayer* disp);
 
   //checks if the object passed as the first argument depends on the second arguments
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.pro b/src/GEOMToolsGUI/GEOMToolsGUI.pro
new file mode 100644 (file)
index 0000000..f2728cb
--- /dev/null
@@ -0,0 +1,44 @@
+TEMPLATE = lib
+TARGET = GEOMToolsGUI
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+QT_INCLUDES = $$(QTDIR)/include $$(QTDIR)/include/QtCore $$(QTDIR)/include/QtGui $$(QTDIR)/include/QtOpenGL $$(QTDIR)/include/QtXml
+
+VTK_INCLUDES = $$(VTKHOME)/include/vtk
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+PYTHON_INCLUDES = $$(PYTHONHOME)/include/python2.4
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
+
+GUI_CXXFLAGS = $$(GUI_ROOT_DIR)/include/salome
+
+CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
+
+GUI_LDFLAGS = -L$$(GUI_ROOT_DIR)/lib/salome
+
+INCLUDEPATH += $${QT_INCLUDES} $${VTK_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${GUI_CXXFLAGS} $${CORBA_INCLUDES} ../OBJECT ../GEOMBase ../GEOMClient ../GEOMImpl ../GEOMGUI $$(GEOM_ROOT_DIR)/idl $$(GEOM_ROOT_DIR)/salome_adm/unix
+
+LIBS += -L$$(GEOM_ROOT_DIR)/lib -lGEOMBase -lGEOM $${GUI_LDFLAGS} -lVTKViewer -lOCCViewer -lsuit -lSalomeApp
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32 
+DEFINES += GEOMTOOLSGUI_EXPORTS OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS OMNIORB_VERSION=4 __x86__ __linux__ COMP_CORBA_DOUBLE COMP_CORBA_LONG
+
+SOURCES  = GEOMToolsGUI.cxx
+SOURCES += GEOMToolsGUI_1.cxx
+SOURCES += GEOMToolsGUI_TransparencyDlg.cxx
+SOURCES += GEOMToolsGUI_NbIsosDlg.cxx
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+INSTALLS += includes
index 2becab38d9ed9585410f143fd3cc0bfd58730bbb..466c3468253018585e014f1244c7fd9d82593c97 100644 (file)
 //  Module : GEOM
 //  $Header$
 
-#include <PythonConsole_PyConsole.h>
+#include <PyConsole_Console.h>
 
 #include "GEOMToolsGUI.h"
 
 #include "GeometryGUI.h"
+#include "GEOM_Displayer.h"
 #include "GEOMToolsGUI_TransparencyDlg.h"
 #include "GEOMToolsGUI_NbIsosDlg.h"        // Method ISOS adjustement
 
-#include "GEOM_Actor.h"
 #include "GEOMBase.h"
 
 #include "SALOME_ListIO.hxx"
 #include <SVTK_View.h>
 
 #include <OCCViewer_ViewModel.h>
-#include <OCCViewer_ViewWindow.h>
 
 #include <SUIT_ViewManager.h>
-#include <SUIT_Application.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_NameDlg.h>
 
-#include "SALOMEDSClient.hxx"
-
 #include "utilities.h"
 
 // OCCT Includes
 #include <AIS_Drawer.hxx>
-#include <AIS_ListOfInteractive.hxx>
-#include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_PointAspect.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
 
-// VTK Includes
-#include <vtkBMPReader.h>
-#include <vtkTexture.h>
-#include <vtkTextureMapToPlane.h>
-#include <vtkTransformTextureCoords.h>
-#include <vtkDataSetMapper.h>
-#include <vtkRenderer.h>
-
 // QT Includes
-#include <qfileinfo.h>
-#include <qcolordialog.h>
-#include <qspinbox.h>
-#include <qapplication.h>
+#include <QColorDialog>
 
 using namespace std;
 
@@ -157,7 +140,9 @@ void GEOMToolsGUI::OnSettingsStep()
   double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100. );
 
   Standard_Boolean res = false;
-  double dd = GEOMBase::Parameter( res, QString("%1").arg(step), tr("GEOM_MEN_STEP_LABEL"), tr("GEOM_STEP_TITLE"), 0.001, 10000.0, 3);
+  double dd = GEOMBase::Parameter( res, QString("%1").arg(step).toStdString().c_str(), 
+                                  tr("GEOM_MEN_STEP_LABEL").toStdString().c_str(), 
+                                  tr("GEOM_STEP_TITLE").toStdString().c_str(), 0.001, 10000.0, 3);
   if(res) {
     resMgr->setValue( "Geometry", "SettingsGeomStep", dd );
 
@@ -182,10 +167,10 @@ void GEOMToolsGUI::OnRename()
 
        bool aLocked = (_PTR(AttributeStudyProperties)(aStudy->GetProperties()))->IsLocked();
        if ( aLocked ) {
-         SUIT_MessageBox::warn1 ( app->desktop(),
-                                  QObject::tr("WRN_WARNING"),
-                                  QObject::tr("WRN_STUDY_LOCKED"),
-                                  QObject::tr("BUT_OK") );
+         SUIT_MessageBox::warning ( app->desktop(),
+                                    QObject::tr("WRN_WARNING"),
+                                    QObject::tr("WRN_STUDY_LOCKED"),
+                                    QObject::tr("BUT_OK") );
          return;
        }
 
@@ -200,12 +185,12 @@ void GEOMToolsGUI::OnRename()
 
              QString newName = LightApp_NameDlg::getName( app->desktop(), aName->Value().c_str() );
              if ( !newName.isEmpty() ) {
-               aName->SetValue( newName.latin1() ); // rename the SObject
-               IObject->setName( newName.latin1() );// rename the InteractiveObject
+               aName->SetValue( newName.toLatin1().constData() ); // rename the SObject
+               IObject->setName( newName.toLatin1() );// rename the InteractiveObject
                // Rename the corresponding GEOM_Object
                GEOM::GEOM_Object_var anObj =  GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj));
                if (!CORBA::is_nil( anObj ))
-                 anObj->SetName( newName.latin1() );
+                 anObj->SetName( newName.toLatin1() );
                (dynamic_cast<SalomeApp_Module*>(app->activeModule()))->updateObjBrowser( false );
              }
            } // if ( name attribute )
@@ -221,7 +206,7 @@ void GEOMToolsGUI::OnRename()
 void GEOMToolsGUI::OnCheckGeometry()
 {
   SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
-  PythonConsole* pyConsole = app->pythonConsole();
+  PyConsole_Console* pyConsole = app->pythonConsole();
 
   if(pyConsole)
     pyConsole->exec("from GEOM_usinggeom import *");
index 05c9d39ab13992d8f47758368c841cef06351df2..da30e07dc8e7d20ea523e3a46c2dd87ce3bb40d5 100644 (file)
 #include "GeometryGUI.h"
 #include <LightApp_Application.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SUIT_Tools.h>
 
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qspinbox.h>
+#include <QLabel>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QGridLayout>
+#include <QSpinBox>
+#include <QKeyEvent>
 //using namespace std;
 
 //=================================================================================
 //            TRUE to construct a modal dialog.
 //=================================================================================
 GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent )
-  :QDialog( parent, "GEOMToolsGUI_NbIsosDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+  :QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
 {
-  setCaption( tr( "GEOM_MEN_ISOS" ) );
+  setObjectName( "GEOMToolsGUI_NbIsosDlg" );
+  setModal( true );
+
+  setWindowTitle( tr( "GEOM_MEN_ISOS" ) );
   setSizeGripEnabled(TRUE);
   QGridLayout* MyDialogLayout = new QGridLayout(this); 
   MyDialogLayout->setSpacing(6);
   MyDialogLayout->setMargin(11);
   
   /***************************************************************/
-  QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" );
-  GroupC1->setColumnLayout(0, Qt::Vertical );
-  GroupC1->layout()->setSpacing( 0 );
-  GroupC1->layout()->setMargin( 0 );
-  QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() );
+  QGroupBox* GroupC1 = new QGroupBox( this );
+  GroupC1->setObjectName( "GroupC1" );
+  QGridLayout* GroupC1Layout = new QGridLayout( GroupC1 );
   GroupC1Layout->setAlignment( Qt::AlignTop );
   GroupC1Layout->setSpacing( 6 );
   GroupC1Layout->setMargin( 11 );
   
-  QLabel* TextLabel1 = new QLabel( GroupC1, "TextLabel1" );
+  QLabel* TextLabel1 = new QLabel( GroupC1 );
+  TextLabel1->setObjectName( "TextLabel1" );
   TextLabel1->setText( tr( "GEOM_MEN_ISOU") );
   GroupC1Layout->addWidget( TextLabel1, 0, 0 );
   
-  SpinBoxU = new QSpinBox( GroupC1, "SpinBoxU" );
+  SpinBoxU = new QSpinBox( GroupC1 );
+  SpinBoxU->setObjectName( "SpinBoxU" );
   SpinBoxU->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-  SpinBoxU->setMinValue( 0 );
+  SpinBoxU->setMinimum( 0 );
   SpinBoxU->setValue( 1 );
   GroupC1Layout->addWidget( SpinBoxU, 0, 1 );
 
-  QLabel* TextLabel2 = new QLabel( GroupC1, "TextLabel2" );
+  QLabel* TextLabel2 = new QLabel( GroupC1 );
+  TextLabel2->setObjectName( "TextLabel2" );
   TextLabel2->setText( tr( "GEOM_MEN_ISOV") ) ;
   GroupC1Layout->addWidget( TextLabel2, 0, 2 );
 
-  SpinBoxV = new QSpinBox( GroupC1, "SpinBoxV");
+  SpinBoxV = new QSpinBox( GroupC1 );
+  SpinBoxV->setObjectName( "SpinBoxV");
   SpinBoxV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   SpinBoxV->setValue( 1 );
-  SpinBoxV->setMinValue( 0 );
+  SpinBoxV->setMinimum( 0 );
   GroupC1Layout->addWidget( SpinBoxV, 0, 3 );
   
   /***************************************************************/
-  QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
-  GroupButtons->setColumnLayout(0, Qt::Vertical );
-  GroupButtons->layout()->setSpacing( 0 );
-  GroupButtons->layout()->setMargin( 0 );
-  QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
+  QGroupBox* GroupButtons = new QGroupBox( this );
+  GroupButtons->setObjectName( "GroupButtons" );
+  QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons );
   GroupButtonsLayout->setAlignment( Qt::AlignTop );
   GroupButtonsLayout->setSpacing( 6 );
   GroupButtonsLayout->setMargin( 11 );
   
-  QPushButton* buttonOk = new QPushButton( GroupButtons, "buttonOk" );
+  QPushButton* buttonOk = new QPushButton( GroupButtons );
+  buttonOk->setObjectName( "buttonOk" );
   buttonOk->setText( tr( "GEOM_BUT_OK" ) ) ;
   buttonOk->setAutoDefault( TRUE );
   buttonOk->setDefault( TRUE );
@@ -105,12 +111,14 @@ GEOMToolsGUI_NbIsosDlg::GEOMToolsGUI_NbIsosDlg(QWidget* parent )
   
   GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
   
-  QPushButton* buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
+  QPushButton* buttonCancel = new QPushButton( GroupButtons );
+  buttonCancel->setObjectName( "buttonCancel" );
   buttonCancel->setText( tr( "GEOM_BUT_CANCEL" ) ) ;
   buttonCancel->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonCancel, 0, 1 );
 
-  QPushButton* buttonHelp = new QPushButton( GroupButtons, "buttonHelp" );
+  QPushButton* buttonHelp = new QPushButton( GroupButtons );
+  buttonHelp->setObjectName( "buttonHelp" );
   buttonHelp->setText( tr( "GEOM_BUT_HELP" ) ) ;
   buttonHelp->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonHelp, 0, 2 );
@@ -177,10 +185,10 @@ void GEOMToolsGUI_NbIsosDlg::ClickOnHelp()
 #else
                platform = "application";
 #endif
-    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
-                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                          arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
-                          QObject::tr("BUT_OK"));
+    SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
+                            QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                            arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
+                            QObject::tr("BUT_OK"));
   }
 }
 
@@ -194,7 +202,7 @@ void GEOMToolsGUI_NbIsosDlg::keyPressEvent( QKeyEvent* e )
   if ( e->isAccepted() )
     return;
 
-  if ( e->key() == Key_F1 )
+  if ( e->key() == Qt::Key_F1 )
     {
       e->accept();
       ClickOnHelp();
index e93b1ded30a0d93e28b52cf0f33b159bbfb6c761..68bf75a7bff68c1723533402e8755bf0e124b806 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "GEOM_ToolsGUI.hxx"
 
-#include <qdialog.h>
+#include <QDialog>
 
 class QSpinBox;
 
index 7e7151a6cdccc70ecc34e3e09a591095501662a7..b4eae74df0328263755e8b488340aea6e2d3eb90 100644 (file)
 #include <SVTK_View.h>
 
 #include <OCCViewer_ViewModel.h>
-#include <OCCViewer_ViewWindow.h>
 
 #include <SUIT_ViewManager.h>
-#include <SUIT_Application.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 
-#include <qframe.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qslider.h>
-#include <qlayout.h>
-#include <qvariant.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qapplication.h>
-#include <qgroupbox.h>
+#include <QLabel>
+#include <QPushButton>
+#include <QSlider>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QKeyEvent>
 
 #include <AIS_InteractiveContext.hxx>
 using namespace std;
@@ -76,31 +70,34 @@ using namespace std;
 //
 //=================================================================================
 GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent )
-  :QDialog( parent, "GEOMBase_TransparencyDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+  :QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
 {
+  setObjectName( "GEOMBase_TransparencyDlg" );
+  setModal( true );
+  
   resize(152, 107); 
-  setCaption(tr("GEOM_TRANSPARENCY_TITLE"));
+  setWindowTitle(tr("GEOM_TRANSPARENCY_TITLE"));
   setSizeGripEnabled(TRUE);
   QGridLayout* lay = new QGridLayout(this); 
   lay->setSpacing(6);
   lay->setMargin(11);
-
+  
   /*************************************************************************/
-  QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
-  GroupButtons->setColumnLayout(0, Qt::Vertical );
-  GroupButtons->layout()->setSpacing( 0 );
-  GroupButtons->layout()->setMargin( 0 );
-  QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
+  QGroupBox* GroupButtons = new QGroupBox( this );
+  GroupButtons->setObjectName( "GroupButtons" );
+  QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons );
   GroupButtonsLayout->setAlignment( Qt::AlignTop );
   GroupButtonsLayout->setSpacing( 6 );
   GroupButtonsLayout->setMargin( 11 );
   
-  QPushButton* buttonOk = new QPushButton( GroupButtons, "buttonOk" );
+  QPushButton* buttonOk = new QPushButton( GroupButtons );
+  buttonOk->setObjectName( "buttonOk" );
   buttonOk->setText( tr( "GEOM_BUT_OK" ) );
   buttonOk->setAutoDefault( TRUE );
   buttonOk->setDefault( TRUE );
-
-  QPushButton* buttonHelp = new QPushButton( GroupButtons, "buttonHelp" );
+  
+  QPushButton* buttonHelp = new QPushButton( GroupButtons );
+  buttonHelp->setObjectName( "buttonHelp" );
   buttonHelp->setText( tr( "GEOM_BUT_HELP" ) );
   buttonHelp->setAutoDefault( TRUE );
   buttonHelp->setDefault( TRUE );
@@ -108,32 +105,37 @@ GEOMToolsGUI_TransparencyDlg::GEOMToolsGUI_TransparencyDlg( QWidget* parent )
   GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
   GroupButtonsLayout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1 );
   GroupButtonsLayout->addWidget( buttonHelp, 0, 2 );
-
+  
   /*************************************************************************/
-  QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" );
-  GroupC1->setColumnLayout(0, Qt::Vertical );
-  GroupC1->layout()->setSpacing( 0 );
-  GroupC1->layout()->setMargin( 0 );
-  QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() );
+  QGroupBox* GroupC1 = new QGroupBox( this );
+  GroupC1->setObjectName( "GroupC1" );
+  QGridLayout* GroupC1Layout = new QGridLayout( GroupC1 );
   GroupC1Layout->setAlignment( Qt::AlignTop );
   GroupC1Layout->setSpacing( 6 );
   GroupC1Layout->setMargin( 11 );
   
-  QLabel* TextLabelOpaque = new QLabel( GroupC1, "TextLabelOpaque" );
+  QLabel* TextLabelOpaque = new QLabel( GroupC1 );
+  TextLabelOpaque->setObjectName( "TextLabelOpaque" );
   TextLabelOpaque->setText( tr( "GEOM_TRANSPARENCY_OPAQUE"  ) );
-  TextLabelOpaque->setAlignment( int( QLabel::AlignLeft ) );
+  TextLabelOpaque->setAlignment( Qt::AlignLeft );
   GroupC1Layout->addWidget( TextLabelOpaque, 0, 0 );
   GroupC1Layout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
   
-  QLabel* TextLabelTransparent = new QLabel( GroupC1, "TextLabelTransparent" );
+  QLabel* TextLabelTransparent = new QLabel( GroupC1 );
+  TextLabelTransparent->setObjectName( "TextLabelTransparent" );
   TextLabelTransparent->setText( tr( "GEOM_TRANSPARENCY_TRANSPARENT"  ) );
-  TextLabelTransparent->setAlignment( int( QLabel::AlignRight ) );
+  TextLabelTransparent->setAlignment( Qt::AlignRight );
   GroupC1Layout->addWidget( TextLabelTransparent, 0, 2 );
   
-  mySlider = new QSlider( 0, 10, 1, 5, Horizontal, GroupC1, "mySlider" );
+  mySlider = new QSlider( Qt::Horizontal, GroupC1 );
+  mySlider->setObjectName( "mySlider" );
+  mySlider->setMinimum( 0 );
+  mySlider->setMaximum( 10 );
+  mySlider->setPageStep( 1 );
+  mySlider->setValue( 5 );
   mySlider->setMinimumSize( 300, 0 );
-  mySlider->setTickmarks( QSlider::Left );
-  GroupC1Layout->addMultiCellWidget( mySlider, 1, 1, 0, 2 );
+  mySlider->setTickPosition( QSlider::TicksLeft );
+  GroupC1Layout->addWidget( mySlider, 1, 0, 1, 3 );
   /*************************************************************************/
   
   lay->addWidget(GroupC1, 0,  0);
@@ -204,10 +206,10 @@ void GEOMToolsGUI_TransparencyDlg::ClickOnHelp()
 #else
                platform = "application";
 #endif
-    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
-                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                          arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
-                          QObject::tr("BUT_OK"));
+    SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
+                            QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                            arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
+                            QObject::tr("BUT_OK"));
   }
 }
 
@@ -296,7 +298,7 @@ void GEOMToolsGUI_TransparencyDlg::keyPressEvent( QKeyEvent* e )
   if ( e->isAccepted() )
     return;
 
-  if ( e->key() == Key_F1 )
+  if ( e->key() == Qt::Key_F1 )
     {
       e->accept();
       ClickOnHelp();
index 0b7aa869cad534dd62afd45cbc9d19c3e717ea68..03e18308810eb39f37991d99dd6068721a7afc67 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "GEOM_ToolsGUI.hxx"
 
-#include <qdialog.h>
+#include <QDialog>
 
 class QSlider;
 
index 56f213c1668e306c89f52f79cf395e62abcf761b..547f7e3bc7fccb29cde1e09002af5f0559d0a628 100644 (file)
@@ -24,7 +24,7 @@ SUBDIRS += DlgRef
 SUBDIRS += GEOMFiltersSelection
 SUBDIRS += GEOMGUI
 SUBDIRS += GEOMBase
-#SUBDIRS += GEOMToolsGUI
+SUBDIRS += GEOMToolsGUI
 #SUBDIRS += DisplayGUI
 #SUBDIRS += BasicGUI
 #SUBDIRS += PrimitiveGUI