From: mkr Date: Tue, 10 Jul 2007 12:49:13 +0000 (+0000) Subject: Porting to Qt4. X-Git-Tag: snapshot_171207~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fbb735b93a0c703798cfe03b21a42dd5cf4e90cf;p=modules%2Fgeom.git Porting to Qt4. --- diff --git a/src/BooleanGUI/BooleanGUI.pro b/src/BooleanGUI/BooleanGUI.pro new file mode 100644 index 000000000..3d923475b --- /dev/null +++ b/src/BooleanGUI/BooleanGUI.pro @@ -0,0 +1,40 @@ +TEMPLATE = lib +TARGET = BuildGUI +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 -lGEOMBase + +CONFIG -= debug release debug_and_release +CONFIG += qt thread debug dll shared + +win32:DEFINES += WIN32 +DEFINES += BOOLEANGUI_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 = BooleanGUI.cxx +SOURCES += BooleanGUI_Dialog.cxx + +includes.files = $$HEADERS +includes.path = ../../include + +INSTALLS += includes diff --git a/src/BooleanGUI/BooleanGUI_Dialog.cxx b/src/BooleanGUI/BooleanGUI_Dialog.cxx index b777cddd4..df4cdde36 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.cxx +++ b/src/BooleanGUI/BooleanGUI_Dialog.cxx @@ -27,15 +27,15 @@ // $Header$ #include "BooleanGUI_Dialog.h" -#include "BooleanGUI.h" -#include "DlgRef_2Sel_QTD.h" +#include "GeometryGUI.h" +#include "GEOMBase.h" + +#include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" -#include - using namespace std; //================================================================================= @@ -46,7 +46,7 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BooleanGUI_Dialog::BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGeometryGUI, - QWidget* parent, const char* name, bool modal, WFlags fl) + QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl), myOperation( theOperation ) { @@ -60,36 +60,42 @@ BooleanGUI_Dialog::BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGe aCaption = tr("GEOM_COMMON_TITLE"); setHelpFileName("common.htm"); break; - case BooleanGUI::CUT: + case BooleanGUI::CUT: image0 = QPixmap( SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CUT"))); aTitle = tr("GEOM_CUT"); aCaption = tr("GEOM_CUT_TITLE"); setHelpFileName("cut.htm"); break; - case BooleanGUI::FUSE: + case BooleanGUI::FUSE: image0 = QPixmap( SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_FUSE"))); aTitle = tr("GEOM_FUSE"); aCaption = tr("GEOM_FUSE_TITLE"); setHelpFileName("fuse.htm"); break; - case BooleanGUI::SECTION: + case BooleanGUI::SECTION: image0 = QPixmap( SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SECTION"))); aTitle = tr("GEOM_SECTION"); aCaption = tr("GEOM_SECTION_TITLE"); setHelpFileName("section.htm"); break; - } + } QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption( aCaption ); + setWindowTitle( aCaption ); /***************************************************************/ GroupConstructors->setTitle( aTitle ); - RadioButton1->setPixmap( image0 ); - RadioButton2->close(TRUE); - RadioButton3->close(TRUE); + RadioButton1->setIcon( image0 ); + RadioButton2->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton2->close(); + RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton3->close(); + + myGroup = new Ui::DlgRef_2Sel_QTD(); + QWidget* aMyGroupWidget = new QWidget(this); + myGroup->setupUi(aMyGroupWidget); + aMyGroupWidget->setObjectName("GroupCommon"); - myGroup = new DlgRef_2Sel_QTD(this, "GroupCommon"); myGroup->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); if ( myOperation != BooleanGUI::CUT ) { @@ -102,12 +108,12 @@ BooleanGUI_Dialog::BooleanGUI_Dialog( const int theOperation, GeometryGUI* theGe myGroup->TextLabel2->setText(tr("GEOM_TOOL_OBJECT")); } - myGroup->PushButton1->setPixmap(image1); - myGroup->PushButton2->setPixmap(image1); + myGroup->PushButton1->setIcon(image1); + myGroup->PushButton2->setIcon(image1); myGroup->LineEdit1->setReadOnly( true ); myGroup->LineEdit2->setReadOnly( true ); - Layout1->addWidget(myGroup, 2, 0); + gridLayout1->addWidget(aMyGroupWidget, 2, 0); /***************************************************************/ /* Initialisation */ @@ -146,7 +152,7 @@ void BooleanGUI_Dialog::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - initName( GroupConstructors->title() ); + initName( GroupConstructors->title().toStdString().c_str() ); globalSelection( GEOM_ALLSHAPES ); } diff --git a/src/BooleanGUI/BooleanGUI_Dialog.h b/src/BooleanGUI/BooleanGUI_Dialog.h index e42fd2be2..71fa36528 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.h +++ b/src/BooleanGUI/BooleanGUI_Dialog.h @@ -31,8 +31,7 @@ #include "BooleanGUI.h" //for wnt defines #include "GEOMBase_Skeleton.h" - -class DlgRef_2Sel_QTD; +#include "DlgRef_2Sel_QTD.h" //================================================================================= // class : BooleanGUI_Dialog @@ -44,7 +43,7 @@ class GEOM_BOOLEANGUI_EXPORT BooleanGUI_Dialog : public GEOMBase_Skeleton public: BooleanGUI_Dialog( const int theOperation, 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); ~BooleanGUI_Dialog(); protected: @@ -62,7 +61,7 @@ private: GEOM::GEOM_Object_var myObject1; GEOM::GEOM_Object_var myObject2; - DlgRef_2Sel_QTD* myGroup; + Ui::DlgRef_2Sel_QTD* myGroup; private slots: void ClickOnOk(); diff --git a/src/src.pro b/src/src.pro index d78196d7d..cc4dd70d6 100644 --- a/src/src.pro +++ b/src/src.pro @@ -31,7 +31,7 @@ SUBDIRS += PrimitiveGUI SUBDIRS += GenerationGUI SUBDIRS += EntityGUI SUBDIRS += BuildGUI -#SUBDIRS += BooleanGUI +SUBDIRS += BooleanGUI #SUBDIRS += TransformationGUI #SUBDIRS += OperationGUI #SUBDIRS += RepairGUI