From 5887eb5b1a2e00dba74dbfb1573e2445dccb098e Mon Sep 17 00:00:00 2001 From: mkr Date: Mon, 9 Jul 2007 10:12:14 +0000 Subject: [PATCH] Porting to Qt4. --- src/PrimitiveGUI/PrimitiveGUI.cxx | 1 - src/PrimitiveGUI/PrimitiveGUI.pro | 44 ++++++++++++++++++ src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx | 45 ++++++++++--------- src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h | 7 +-- src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx | 36 ++++++++------- src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h | 7 +-- src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx | 36 ++++++++------- src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h | 7 +-- src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx | 34 +++++++------- src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h | 7 +-- src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx | 36 ++++++++------- src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h | 7 +-- src/src.pro | 2 +- 13 files changed, 165 insertions(+), 104 deletions(-) create mode 100644 src/PrimitiveGUI/PrimitiveGUI.pro diff --git a/src/PrimitiveGUI/PrimitiveGUI.cxx b/src/PrimitiveGUI/PrimitiveGUI.cxx index 45ca54db0..34d7038a2 100644 --- a/src/PrimitiveGUI/PrimitiveGUI.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI.cxx @@ -30,7 +30,6 @@ #include "PrimitiveGUI.h" #include "GeometryGUI.h" -#include "SUIT_Session.h" #include "SUIT_Desktop.h" #include "SalomeApp_Application.h" diff --git a/src/PrimitiveGUI/PrimitiveGUI.pro b/src/PrimitiveGUI/PrimitiveGUI.pro new file mode 100644 index 000000000..d1ee88f51 --- /dev/null +++ b/src/PrimitiveGUI/PrimitiveGUI.pro @@ -0,0 +1,44 @@ +TEMPLATE = lib +TARGET = PrimitiveGUI +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 + +INCLUDEPATH += $${QT_INCLUDES} $${VTK_INCLUDES} $${CAS_CPPFLAGS} $${PYTHON_INCLUDES} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${GUI_CXXFLAGS} $${CORBA_INCLUDES} ../GEOMGUI ../DlgRef ../GEOMBase ../OBJECT ../GEOMClient ../GEOMImpl ../GEOMFiltersSelection $$(GEOM_ROOT_DIR)/idl $$(GEOM_ROOT_DIR)/salome_adm/unix + +LIBS += -L$$(GEOM_ROOT_DIR)/lib -lGEOMFiltersSelection -lGEOMBase + +CONFIG -= debug release debug_and_release +CONFIG += qt thread debug dll shared + +win32:DEFINES += WIN32 +DEFINES += 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 = PrimitiveGUI.cxx +SOURCES += PrimitiveGUI_BoxDlg.cxx +SOURCES += PrimitiveGUI_CylinderDlg.cxx +SOURCES += PrimitiveGUI_SphereDlg.cxx +SOURCES += PrimitiveGUI_TorusDlg.cxx +SOURCES += PrimitiveGUI_ConeDlg.cxx + +includes.files = $$HEADERS +includes.path = ../../include + +INSTALLS += includes diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 23e9ce46a..5923b9df3 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -27,18 +27,19 @@ // $Header$ #include "PrimitiveGUI_BoxDlg.h" +#include "DlgRef_3Spin.h" +#include "DlgRef_SpinBox.h" -#include "SUIT_Desktop.h" +#include "GeometryGUI.h" +#include "GEOMBase.h" + +#include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" -#include - #include "GEOMImpl_Types.hxx" -#include "utilities.h" - using namespace std; @@ -50,28 +51,32 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent, - const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) + const char* name, bool modal, Qt::WindowFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_DXYZ"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); - setCaption(tr("GEOM_BOX_TITLE")); + setWindowTitle(tr("GEOM_BOX_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_BOX")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image1); + RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton3->close(); + + GroupPoints = new Ui::DlgRef_2Sel_QTD(); + QWidget* aGroupPointsWidget = new QWidget(this); + GroupPoints->setupUi(aGroupPointsWidget); + aGroupPointsWidget->setObjectName("GroupPoints"); - GroupPoints = new DlgRef_2Sel_QTD(this, "GroupPoints"); GroupPoints->GroupBox1->setTitle(tr("GEOM_DIAGONAL_POINTS")); GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1")); GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2")); - GroupPoints->PushButton1->setPixmap(image2); - GroupPoints->PushButton2->setPixmap(image2); + GroupPoints->PushButton1->setIcon(image2); + GroupPoints->PushButton2->setIcon(image2); GroupDimensions = new DlgRef_3Spin(this, "GroupDimensions"); GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ")); @@ -79,8 +84,8 @@ PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* p GroupDimensions->TextLabel2->setText(tr("GEOM_DY")); GroupDimensions->TextLabel3->setText(tr("GEOM_DZ")); - Layout1->addWidget(GroupPoints, 2, 0); - Layout1->addWidget(GroupDimensions, 2, 0); + gridLayout1->addWidget(aGroupPointsWidget, 2, 0); + gridLayout1->addWidget(GroupDimensions, 2, 0); /***************************************************************/ setHelpFileName("box.htm"); @@ -149,7 +154,7 @@ void PrimitiveGUI_BoxDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - initName( tr( "GEOM_BOX" ) ); + initName( tr( "GEOM_BOX" ).toStdString().c_str() ); ConstructorsClicked(0); } @@ -170,7 +175,7 @@ void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId) GroupDimensions->hide(); resize(0, 0); - GroupPoints->show(); + ::qobject_cast( GroupPoints->gridLayout->parent() )->show(); myEditCurrentArgument = GroupPoints->LineEdit1; GroupPoints->LineEdit1->setText(""); @@ -183,7 +188,7 @@ void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId) } case 1: { - GroupPoints->hide(); + ::qobject_cast( GroupPoints->gridLayout->parent() )->hide(); resize(0, 0); GroupDimensions->show(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h index 9e7139889..e2dc27c49 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h @@ -30,10 +30,11 @@ #include "GEOMBase_Skeleton.h" #include "DlgRef_2Sel_QTD.h" -#include "DlgRef_3Spin.h" using namespace std; +class DlgRef_3Spin; + //================================================================================= // class : PrimitiveGUI_BoxDlg // purpose : @@ -44,7 +45,7 @@ class PrimitiveGUI_BoxDlg : public GEOMBase_Skeleton public: PrimitiveGUI_BoxDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, - const char* name = 0, bool modal = FALSE, WFlags fl = 0); + const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0); ~PrimitiveGUI_BoxDlg(); protected: @@ -61,7 +62,7 @@ private : GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the vector */ - DlgRef_2Sel_QTD* GroupPoints; + Ui::DlgRef_2Sel_QTD* GroupPoints; DlgRef_3Spin* GroupDimensions; private slots: diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index 7de92356e..858e4e102 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -27,18 +27,20 @@ // $Header$ #include "PrimitiveGUI_ConeDlg.h" +#include "DlgRef_2Sel3Spin.h" +#include "DlgRef_3Spin.h" +#include "DlgRef_SpinBox.h" -#include "SUIT_Desktop.h" +#include "GeometryGUI.h" +#include "GEOMBase.h" + +#include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" -#include - #include "GEOMImpl_Types.hxx" -#include "utilities.h" - using namespace std; //================================================================================= @@ -49,21 +51,21 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent, - const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) + const char* name, bool modal, Qt::WindowFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CONE_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CONE_DXYZ"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_CONE_TITLE")); + setWindowTitle(tr("GEOM_CONE_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_CONE")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image1); + RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton3->close(); GroupPoints = new DlgRef_2Sel3Spin(this, "GroupPoints"); GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); @@ -72,8 +74,8 @@ PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_I").arg("1")); GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_I").arg("2")); GroupPoints->TextLabel5->setText(tr("GEOM_HEIGHT")); - GroupPoints->PushButton1->setPixmap(image2); - GroupPoints->PushButton2->setPixmap(image2); + GroupPoints->PushButton1->setIcon(image2); + GroupPoints->PushButton2->setIcon(image2); GroupDimensions = new DlgRef_3Spin(this, "GroupDimensions"); GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ")); @@ -81,8 +83,8 @@ PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS_I").arg("2")); GroupDimensions->TextLabel3->setText(tr("GEOM_HEIGHT")); - Layout1->addWidget(GroupPoints, 2, 0); - Layout1->addWidget(GroupDimensions, 2, 0); + gridLayout1->addWidget(GroupPoints, 2, 0); + gridLayout1->addWidget(GroupDimensions, 2, 0); /***************************************************************/ setHelpFileName( "cone.htm" ); @@ -162,7 +164,7 @@ void PrimitiveGUI_ConeDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - initName( tr( "GEOM_CONE" ) ); + initName( tr( "GEOM_CONE" ).toStdString().c_str() ); ConstructorsClicked(0); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h index 6ac583460..3e8f7b650 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h @@ -29,8 +29,9 @@ #define DIALOGBOX_CONE_H #include "GEOMBase_Skeleton.h" -#include "DlgRef_2Sel3Spin.h" -#include "DlgRef_3Spin.h" + +class DlgRef_2Sel3Spin; +class DlgRef_3Spin; //================================================================================= // class : PrimitiveGUI_ConeDlg @@ -42,7 +43,7 @@ class PrimitiveGUI_ConeDlg : public GEOMBase_Skeleton public: PrimitiveGUI_ConeDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, - const char* name = 0, bool modal = FALSE, WFlags fl = 0); + const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0); ~PrimitiveGUI_ConeDlg(); protected: diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 503211cf2..da8009761 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -27,18 +27,20 @@ // $Header$ #include "PrimitiveGUI_CylinderDlg.h" +#include "DlgRef_2Sel2Spin.h" +#include "DlgRef_2Spin.h" +#include "DlgRef_SpinBox.h" -#include "SUIT_Desktop.h" +#include "GeometryGUI.h" +#include "GEOMBase.h" + +#include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" -#include - #include "GEOMImpl_Types.hxx" -#include "utilities.h" - using namespace std; //================================================================================= @@ -49,21 +51,21 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent, - const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) + const char* name, bool modal, Qt::WindowFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CYLINDER_DXYZ"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_CYLINDER_TITLE")); + setWindowTitle(tr("GEOM_CYLINDER_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_CYLINDER")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image1); + RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton3->close(); GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints"); GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); @@ -71,16 +73,16 @@ PrimitiveGUI_CylinderDlg::PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR")); GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS")); GroupPoints->TextLabel4->setText(tr("GEOM_HEIGHT")); - GroupPoints->PushButton1->setPixmap(image2); - GroupPoints->PushButton2->setPixmap(image2); + GroupPoints->PushButton1->setIcon(image2); + GroupPoints->PushButton2->setIcon(image2); GroupDimensions = new DlgRef_2Spin(this, "GroupDimensions"); GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ")); GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS")); GroupDimensions->TextLabel2->setText(tr("GEOM_HEIGHT")); - Layout1->addWidget(GroupPoints, 2, 0); - Layout1->addWidget(GroupDimensions, 2, 0); + gridLayout1->addWidget(GroupPoints, 2, 0); + gridLayout1->addWidget(GroupDimensions, 2, 0); /***************************************************************/ setHelpFileName("cylinder.htm"); @@ -155,7 +157,7 @@ void PrimitiveGUI_CylinderDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - initName( tr( "GEOM_CYLINDER" ) ); + initName( tr( "GEOM_CYLINDER" ).toStdString().c_str() ); ConstructorsClicked(0); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h index d6f8391be..ae55f1952 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h @@ -29,8 +29,9 @@ #define DIALOGBOX_CYLINDER_H #include "GEOMBase_Skeleton.h" -#include "DlgRef_2Sel2Spin.h" -#include "DlgRef_2Spin.h" + +class DlgRef_2Sel2Spin; +class DlgRef_2Spin; //================================================================================= @@ -43,7 +44,7 @@ class PrimitiveGUI_CylinderDlg : public GEOMBase_Skeleton public: PrimitiveGUI_CylinderDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, - const char* name = 0, bool modal = FALSE, WFlags fl = 0); + const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0); ~PrimitiveGUI_CylinderDlg(); protected: diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index f52f0822a..b6f246e62 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -27,18 +27,20 @@ // $Header$ #include "PrimitiveGUI_SphereDlg.h" +#include "DlgRef_1Sel1Spin.h" +#include "DlgRef_1Spin.h" +#include "DlgRef_SpinBox.h" -#include "SUIT_Desktop.h" +#include "GeometryGUI.h" +#include "GEOMBase.h" + +#include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" -#include - #include "GEOMImpl_Types.hxx" -#include "utilities.h" - using namespace std; //================================================================================= @@ -49,34 +51,34 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent, - const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) + const char* name, bool modal, Qt::WindowFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_P"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPHERE_DXYZ"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_SPHERE_TITLE")); + setWindowTitle(tr("GEOM_SPHERE_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_SPHERE")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image1); + RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton3->close(); GroupPoints = new DlgRef_1Sel1Spin(this, "GroupPoints"); GroupPoints->GroupBox1->setTitle(tr("GEOM_SPHERE_CR")); GroupPoints->TextLabel1->setText(tr("GEOM_CENTER")); GroupPoints->TextLabel2->setText(tr("GEOM_RADIUS")); - GroupPoints->PushButton1->setPixmap(image2); + GroupPoints->PushButton1->setIcon(image2); GroupDimensions = new DlgRef_1Spin(this, "GroupDimensions"); GroupDimensions->GroupBox1->setTitle(tr("GEOM_SPHERE_RO")); GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS")); - Layout1->addWidget(GroupPoints, 2, 0); - Layout1->addWidget(GroupDimensions, 2, 0); + gridLayout1->addWidget(GroupPoints, 2, 0); + gridLayout1->addWidget(GroupDimensions, 2, 0); /***************************************************************/ setHelpFileName("sphere.htm"); @@ -134,7 +136,7 @@ void PrimitiveGUI_SphereDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - initName(tr("GEOM_SPHERE")); + initName(tr("GEOM_SPHERE").toStdString().c_str()); ConstructorsClicked(0); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h index 7885126b2..a7801ff6d 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h @@ -29,8 +29,9 @@ #define DIALOGBOX_SPHERE_H #include "GEOMBase_Skeleton.h" -#include "DlgRef_1Sel1Spin.h" -#include "DlgRef_1Spin.h" + +class DlgRef_1Sel1Spin; +class DlgRef_1Spin; //================================================================================= @@ -43,7 +44,7 @@ class PrimitiveGUI_SphereDlg : public GEOMBase_Skeleton public: PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, - const char* name = 0, bool modal = FALSE, WFlags fl = 0); + const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0); ~PrimitiveGUI_SphereDlg(); protected: diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index 7ab9ca465..a63694a39 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -27,18 +27,20 @@ // $Header$ #include "PrimitiveGUI_TorusDlg.h" +#include "DlgRef_2Sel2Spin.h" +#include "DlgRef_2Spin.h" +#include "DlgRef_SpinBox.h" -#include "SUIT_Desktop.h" +#include "GeometryGUI.h" +#include "GEOMBase.h" + +#include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" -#include - #include "GEOMImpl_Types.hxx" -#include "utilities.h" - using namespace std; //================================================================================= @@ -49,21 +51,21 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent, - const char* name, bool modal, WFlags fl) - :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize | - WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) + const char* name, bool modal, Qt::WindowFlags fl) + :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_TORUS_DXYZ"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_TORUS_TITLE")); + setWindowTitle(tr("GEOM_TORUS_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_TORUS")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image1); + RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton3->close(); GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints"); GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); @@ -71,16 +73,16 @@ PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidge GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR")); GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_I").arg("1")); GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_I").arg("2")); - GroupPoints->PushButton1->setPixmap(image2); - GroupPoints->PushButton2->setPixmap(image2); + GroupPoints->PushButton1->setIcon(image2); + GroupPoints->PushButton2->setIcon(image2); GroupDimensions = new DlgRef_2Spin(this, "GroupDimensions"); GroupDimensions->GroupBox1->setTitle(tr("GEOM_BOX_OBJ")); GroupDimensions->TextLabel1->setText(tr("GEOM_RADIUS_I").arg("1")); GroupDimensions->TextLabel2->setText(tr("GEOM_RADIUS_I").arg("2")); - Layout1->addWidget(GroupPoints, 2, 0); - Layout1->addWidget(GroupDimensions, 2, 0); + gridLayout1->addWidget(GroupPoints, 2, 0); + gridLayout1->addWidget(GroupDimensions, 2, 0); /***************************************************************/ setHelpFileName("turus.htm"); @@ -151,7 +153,7 @@ void PrimitiveGUI_TorusDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - initName( tr( "GEOM_TORUS" ) ); + initName( tr( "GEOM_TORUS" ).toStdString().c_str() ); ConstructorsClicked(0); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h index 00d6a46b6..c386679b7 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h @@ -29,8 +29,9 @@ #define DIALOGBOX_TORUS_H #include "GEOMBase_Skeleton.h" -#include "DlgRef_2Sel2Spin.h" -#include "DlgRef_2Spin.h" + +class DlgRef_2Sel2Spin; +class DlgRef_2Spin; //================================================================================= @@ -43,7 +44,7 @@ class PrimitiveGUI_TorusDlg : public GEOMBase_Skeleton public: PrimitiveGUI_TorusDlg(GeometryGUI* theGeometryGUI, QWidget* parent = 0, - const char* name = 0, bool modal = FALSE, WFlags fl = 0); + const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0); ~PrimitiveGUI_TorusDlg(); protected: diff --git a/src/src.pro b/src/src.pro index fcc1d260e..c120af2ed 100644 --- a/src/src.pro +++ b/src/src.pro @@ -27,7 +27,7 @@ SUBDIRS += GEOMBase SUBDIRS += GEOMToolsGUI SUBDIRS += DisplayGUI SUBDIRS += BasicGUI -#SUBDIRS += PrimitiveGUI +SUBDIRS += PrimitiveGUI #SUBDIRS += GenerationGUI #SUBDIRS += EntityGUI #SUBDIRS += BuildGUI -- 2.39.2