From 162d5c03bd54dc72d9e98318a867372f088e1bcb Mon Sep 17 00:00:00 2001 From: mkr Date: Mon, 9 Jul 2007 07:39:05 +0000 Subject: [PATCH] Porting to Qt4. --- src/BasicGUI/BasicGUI.cxx | 10 +- src/BasicGUI/BasicGUI.h | 1 - src/BasicGUI/BasicGUI.pro | 54 ++++++++++ src/BasicGUI/BasicGUI_ArcDlg.cxx | 66 +++++++------ src/BasicGUI/BasicGUI_ArcDlg.h | 6 +- src/BasicGUI/BasicGUI_CircleDlg.cxx | 53 +++++----- src/BasicGUI/BasicGUI_CircleDlg.h | 9 +- src/BasicGUI/BasicGUI_CurveDlg.cxx | 34 ++++--- src/BasicGUI/BasicGUI_CurveDlg.h | 6 +- src/BasicGUI/BasicGUI_EllipseDlg.cxx | 34 ++++--- src/BasicGUI/BasicGUI_EllipseDlg.h | 5 +- src/BasicGUI/BasicGUI_LineDlg.cxx | 38 +++---- src/BasicGUI/BasicGUI_LineDlg.h | 4 +- src/BasicGUI/BasicGUI_MarkerDlg.cxx | 115 ++++++++++++++-------- src/BasicGUI/BasicGUI_MarkerDlg.h | 8 +- src/BasicGUI/BasicGUI_PlaneDlg.cxx | 44 +++++---- src/BasicGUI/BasicGUI_PlaneDlg.h | 9 +- src/BasicGUI/BasicGUI_PointDlg.cxx | 58 ++++++----- src/BasicGUI/BasicGUI_PointDlg.h | 11 ++- src/BasicGUI/BasicGUI_VectorDlg.cxx | 42 ++++---- src/BasicGUI/BasicGUI_VectorDlg.h | 9 +- src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx | 88 ++++++++++------- src/BasicGUI/BasicGUI_WorkingPlaneDlg.h | 10 +- src/src.pro | 2 +- 24 files changed, 426 insertions(+), 290 deletions(-) create mode 100644 src/BasicGUI/BasicGUI.pro diff --git a/src/BasicGUI/BasicGUI.cxx b/src/BasicGUI/BasicGUI.cxx index 41b484848..74a894916 100644 --- a/src/BasicGUI/BasicGUI.cxx +++ b/src/BasicGUI/BasicGUI.cxx @@ -36,9 +36,7 @@ #include "OCCViewer_ViewModel.h" #include "OCCViewer_ViewManager.h" #include "OCCViewer_ViewPort3d.h" -#include "utilities.h" -#include #include #include #include @@ -55,6 +53,8 @@ #include "BasicGUI_WorkingPlaneDlg.h" // Method WORKING PLANE #include "BasicGUI_MarkerDlg.h" // Method REPAIR +#include + using namespace std; //======================================================================= @@ -137,9 +137,9 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox(); // Create Point dialog, OCC viewer - if ( aDlg && aDlg->isA( "BasicGUI_PointDlg" ) && + if ( aDlg && ( QString(aDlg->metaObject()->className()).compare("BasicGUI_PointDlg") == 0) && theViewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() && - pe->state() != Qt::ControlButton ) + pe->modifiers() != Qt::ControlModifier ) { BasicGUI_PointDlg* aPntDlg = (BasicGUI_PointDlg*) aDlg; if ( aPntDlg->acceptMouseEvent() ) @@ -151,7 +151,7 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin gp_Pnt aPnt; ic->InitSelected(); - if ( pe->state() == Qt::ShiftButton ) + if ( pe->modifiers() == Qt::ShiftModifier ) ic->ShiftSelect(); // Append selection else ic->Select(); // New selection diff --git a/src/BasicGUI/BasicGUI.h b/src/BasicGUI/BasicGUI.h index 73a16e6bd..867ede745 100644 --- a/src/BasicGUI/BasicGUI.h +++ b/src/BasicGUI/BasicGUI.h @@ -31,7 +31,6 @@ #include "GEOM_BasicGUI.hxx" #include "GEOMGUI.h" -#include "GEOMBase.h" #include //================================================================================= diff --git a/src/BasicGUI/BasicGUI.pro b/src/BasicGUI/BasicGUI.pro new file mode 100644 index 000000000..77eb2d3b9 --- /dev/null +++ b/src/BasicGUI/BasicGUI.pro @@ -0,0 +1,54 @@ +TEMPLATE = lib +TARGET = BasicGUI +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 ../DlgRef ../GEOMGUI ../GEOMFiltersSelection ../GEOMBase ../GEOMImpl ../GEOMClient $$(GEOM_ROOT_DIR)/idl $$(GEOM_ROOT_DIR)/salome_adm/unix + +LIBS += -L$$(GEOM_ROOT_DIR)/lib -lGEOMFiltersSelection -lGEOMBase -lGEOM $${GUI_LDFLAGS} -lsuit + +CONFIG -= debug release debug_and_release +CONFIG += qt thread debug dll shared + +win32:DEFINES += WIN32 +DEFINES += BASICGUI_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 + +HEADERS = BasicGUI_PointDlg.h +HEADERS += GEOM_BasicGUI.hxx + +SOURCES = BasicGUI.cxx +SOURCES += BasicGUI_PointDlg.cxx +SOURCES += BasicGUI_LineDlg.cxx +SOURCES += BasicGUI_CircleDlg.cxx +SOURCES += BasicGUI_EllipseDlg.cxx +SOURCES += BasicGUI_ArcDlg.cxx +SOURCES += BasicGUI_VectorDlg.cxx +SOURCES += BasicGUI_PlaneDlg.cxx +SOURCES += BasicGUI_WorkingPlaneDlg.cxx +SOURCES += BasicGUI_CurveDlg.cxx +SOURCES += BasicGUI_MarkerDlg.cxx + +includes.files = $$HEADERS +includes.path = ../../include + +INSTALLS += includes diff --git a/src/BasicGUI/BasicGUI_ArcDlg.cxx b/src/BasicGUI/BasicGUI_ArcDlg.cxx index fec43e01e..c9278dcc2 100644 --- a/src/BasicGUI/BasicGUI_ArcDlg.cxx +++ b/src/BasicGUI/BasicGUI_ArcDlg.cxx @@ -28,22 +28,16 @@ #include "BasicGUI_ArcDlg.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 -#include -#include -#include - #include "GEOMImpl_Types.hxx" -#include "utilities.h" - using namespace std; //================================================================================= @@ -54,23 +48,27 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BasicGUI_ArcDlg::BasicGUI_ArcDlg(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_ARC"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_ARC_CENTER"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_ARC_TITLE")); + setWindowTitle(tr("GEOM_ARC_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_ARC")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->close(TRUE); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image1); + RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton3->close(); + + Group3Pnts = new Ui::DlgRef_3Sel_QTD(); + QWidget* aGroup3PntsWidget = new QWidget(this); + Group3Pnts->setupUi(aGroup3PntsWidget); + aGroup3PntsWidget->setObjectName("Group3Pnts"); - Group3Pnts = new DlgRef_3Sel_QTD(this, "Group3Pnts"); Group3Pnts->GroupBox1->setTitle(tr("GEOM_POINTS")); Group3Pnts->TextLabel1->setText(tr("GEOM_POINT_I").arg("1")); Group3Pnts->TextLabel2->setText(tr("GEOM_POINT_I").arg("2")); @@ -80,12 +78,16 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent, Group3Pnts->LineEdit2->setReadOnly( true ); Group3Pnts->LineEdit3->setReadOnly( true ); - Group3Pnts->PushButton1->setPixmap(image2); - Group3Pnts->PushButton2->setPixmap(image2); - Group3Pnts->PushButton3->setPixmap(image2); + Group3Pnts->PushButton1->setIcon(image2); + Group3Pnts->PushButton2->setIcon(image2); + Group3Pnts->PushButton3->setIcon(image2); - Group3Pnts2 = new DlgRef_3Sel1Check_QTD(this, "Group3Pnts2"); + Group3Pnts2 = new Ui::DlgRef_3Sel1Check_QTD(); + QWidget* aGroup3Pnts2Widget = new QWidget(this); + Group3Pnts2->setupUi(aGroup3Pnts2Widget); + aGroup3Pnts2Widget->setObjectName("Group3Pnts2"); + Group3Pnts2->GroupBox1->setTitle(tr("GEOM_POINTS")); Group3Pnts2->TextLabel1->setText(tr("GEOM_CENTER_POINT")); Group3Pnts2->TextLabel2->setText(tr("GEOM_POINT_I").arg("Start")); @@ -95,14 +97,14 @@ BasicGUI_ArcDlg::BasicGUI_ArcDlg(GeometryGUI* theGeometryGUI, QWidget* parent, Group3Pnts2->LineEdit2->setReadOnly( true ); Group3Pnts2->LineEdit3->setReadOnly( true ); - Group3Pnts2->PushButton1->setPixmap(image2); - Group3Pnts2->PushButton2->setPixmap(image2); - Group3Pnts2->PushButton3->setPixmap(image2); + Group3Pnts2->PushButton1->setIcon(image2); + Group3Pnts2->PushButton2->setIcon(image2); + Group3Pnts2->PushButton3->setIcon(image2); Group3Pnts2->radioButton4->setText(tr("GEOM_REVERSE")); - Layout1->addWidget( Group3Pnts, 2, 0 ); - Layout1->addWidget( Group3Pnts2, 2, 0 ); + gridLayout1->addWidget( aGroup3PntsWidget, 2, 0 ); + gridLayout1->addWidget( aGroup3Pnts2Widget, 2, 0 ); setHelpFileName("arc.htm"); @@ -167,7 +169,7 @@ void BasicGUI_ArcDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - initName( tr( "GEOM_ARC" )); + initName( tr( "GEOM_ARC" ).toStdString().c_str() ); ConstructorsClicked( 0 ); @@ -457,18 +459,18 @@ void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId ) { case 0: { - Group3Pnts->show(); + ::qobject_cast( Group3Pnts->gridLayout->parent() )->show(); resize(0, 0); - Group3Pnts2->hide(); + ::qobject_cast( Group3Pnts2->gridLayout->parent() )->hide(); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); break; } case 1: { - Group3Pnts->hide(); + ::qobject_cast( Group3Pnts->gridLayout->parent() )->hide(); resize(0, 0); - Group3Pnts2->show(); + ::qobject_cast( Group3Pnts2->gridLayout->parent() )->show(); connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); break; diff --git a/src/BasicGUI/BasicGUI_ArcDlg.h b/src/BasicGUI/BasicGUI_ArcDlg.h index 6a5e73217..c530ad1e9 100644 --- a/src/BasicGUI/BasicGUI_ArcDlg.h +++ b/src/BasicGUI/BasicGUI_ArcDlg.h @@ -44,7 +44,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_ArcDlg : public GEOMBase_Skeleton public: BasicGUI_ArcDlg( 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 ); ~BasicGUI_ArcDlg(); protected: @@ -61,8 +61,8 @@ private : int myConstructorId; GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3; - DlgRef_3Sel_QTD* Group3Pnts; - DlgRef_3Sel1Check_QTD* Group3Pnts2; + Ui::DlgRef_3Sel_QTD* Group3Pnts; + Ui::DlgRef_3Sel1Check_QTD* Group3Pnts2; private slots: void ClickOnOk(); diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index ce76529d0..f42e8cce1 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -27,18 +27,19 @@ // $Header$ #include "BasicGUI_CircleDlg.h" +#include "DlgRef_2Sel1Spin.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" - //================================================================================= // class : BasicGUI_CircleDlg() // purpose : Constructs a BasicGUI_CircleDlg which is a child of 'parent', with the @@ -47,21 +48,21 @@ // TRUE to construct a modal dialog. //================================================================================= BasicGUI_CircleDlg::BasicGUI_CircleDlg(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_CIRCLE_PV"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_CIRCLE_PNTS"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_CIRCLE_TITLE")); + setWindowTitle(tr("GEOM_CIRCLE_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_CIRCLE")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image2); - RadioButton3->close(TRUE); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image2); + RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + RadioButton3->close(); GroupPntVecR = new DlgRef_2Sel1Spin(this, "GroupPntVecR"); GroupPntVecR->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); @@ -69,27 +70,31 @@ BasicGUI_CircleDlg::BasicGUI_CircleDlg(GeometryGUI* theGeometryGUI, QWidget* par GroupPntVecR->TextLabel1->setText(tr("GEOM_CENTER_POINT")); GroupPntVecR->TextLabel2->setText(tr("GEOM_VECTOR")); GroupPntVecR->TextLabel3->setText(tr("GEOM_RADIUS")); - GroupPntVecR->PushButton1->setPixmap(image1); - GroupPntVecR->PushButton2->setPixmap(image1); + GroupPntVecR->PushButton1->setIcon(image1); + GroupPntVecR->PushButton2->setIcon(image1); GroupPntVecR->LineEdit1->setReadOnly( true ); GroupPntVecR->LineEdit2->setReadOnly( true ); - Group3Pnts = new DlgRef_3Sel_QTD(this, "Group3Pnts"); + Group3Pnts = new Ui::DlgRef_3Sel_QTD(); + QWidget* aGroup3PntsWidget = new QWidget(this); + Group3Pnts->setupUi(aGroup3PntsWidget); + aGroup3PntsWidget->setObjectName("Group3Pnts"); + Group3Pnts->GroupBox1->setTitle(tr("GEOM_3_POINTS")); Group3Pnts->TextLabel1->setText(tr("GEOM_POINT1")); Group3Pnts->TextLabel2->setText(tr("GEOM_POINT2")); Group3Pnts->TextLabel3->setText(tr("GEOM_POINT3")); - Group3Pnts->PushButton1->setPixmap(image1); - Group3Pnts->PushButton2->setPixmap(image1); - Group3Pnts->PushButton3->setPixmap(image1); + Group3Pnts->PushButton1->setIcon(image1); + Group3Pnts->PushButton2->setIcon(image1); + Group3Pnts->PushButton3->setIcon(image1); Group3Pnts->LineEdit1->setReadOnly( true ); Group3Pnts->LineEdit2->setReadOnly( true ); Group3Pnts->LineEdit3->setReadOnly( true ); - Layout1->addWidget( GroupPntVecR, 2, 0 ); - Layout1->addWidget( Group3Pnts, 2, 0 ); + gridLayout1->addWidget( GroupPntVecR, 2, 0 ); + gridLayout1->addWidget( aGroup3PntsWidget, 2, 0 ); /***************************************************************/ setHelpFileName("circle.htm"); @@ -152,9 +157,9 @@ void BasicGUI_CircleDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - initName( tr( "GEOM_CIRCLE" ) ); + initName( tr( "GEOM_CIRCLE" ).toStdString().c_str() ); - Group3Pnts->hide(); + ::qobject_cast( Group3Pnts->gridLayout->parent() )->hide(); ConstructorsClicked( 0 ); } @@ -171,7 +176,7 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId ) { case 0: { - Group3Pnts->hide(); + ::qobject_cast( Group3Pnts->gridLayout->parent() )->hide(); resize(0, 0); GroupPntVecR->show(); @@ -184,7 +189,7 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId ) { GroupPntVecR->hide(); resize( 0, 0 ); - Group3Pnts->show(); + ::qobject_cast( Group3Pnts->gridLayout->parent() )->show(); myEditCurrentArgument = Group3Pnts->LineEdit1; Group3Pnts->LineEdit1->setText(""); diff --git a/src/BasicGUI/BasicGUI_CircleDlg.h b/src/BasicGUI/BasicGUI_CircleDlg.h index fb0f51315..6d5823fe8 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.h +++ b/src/BasicGUI/BasicGUI_CircleDlg.h @@ -31,10 +31,9 @@ #include "GEOM_BasicGUI.hxx" #include "GEOMBase_Skeleton.h" -#include "DlgRef_2Sel1Spin.h" #include "DlgRef_3Sel_QTD.h" -#include "BasicGUI.h" +class DlgRef_2Sel1Spin; //================================================================================= // class : BasicGUI_CircleDlg @@ -46,7 +45,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_CircleDlg : public GEOMBase_Skeleton public: BasicGUI_CircleDlg(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); ~BasicGUI_CircleDlg(); protected: @@ -64,8 +63,8 @@ private: GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3; - DlgRef_2Sel1Spin* GroupPntVecR; - DlgRef_3Sel_QTD* Group3Pnts; + DlgRef_2Sel1Spin* GroupPntVecR; + Ui::DlgRef_3Sel_QTD* Group3Pnts; private slots: void ClickOnOk(); diff --git a/src/BasicGUI/BasicGUI_CurveDlg.cxx b/src/BasicGUI/BasicGUI_CurveDlg.cxx index 69a25e857..5ca054c9e 100644 --- a/src/BasicGUI/BasicGUI_CurveDlg.cxx +++ b/src/BasicGUI/BasicGUI_CurveDlg.cxx @@ -27,15 +27,14 @@ #include "BasicGUI_CurveDlg.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 "utilities.h" - #include "SALOME_ListIteratorOfListIO.hxx" #include "SALOME_ListIO.hxx" @@ -52,9 +51,8 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BasicGUI_CurveDlg::BasicGUI_CurveDlg(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_POLYLINE"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_SPLINE"))); @@ -62,21 +60,25 @@ BasicGUI_CurveDlg::BasicGUI_CurveDlg(GeometryGUI* theGeometryGUI, QWidget* paren QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_CURVE_TITLE")); + setWindowTitle(tr("GEOM_CURVE_TITLE")); /***************************************************************/ - RadioButton1->setPixmap( image0 ); - RadioButton2->setPixmap( image3 ); - RadioButton3->setPixmap( image2 ); + RadioButton1->setIcon( image0 ); + RadioButton2->setIcon( image3 ); + RadioButton3->setIcon( image2 ); + + GroupPoints = new Ui::DlgRef_1Sel_QTD(); + QWidget* aGroupPointsWidget = new QWidget(this); + GroupPoints->setupUi(aGroupPointsWidget); + aGroupPointsWidget->setObjectName("GroupPoints"); - GroupPoints = new DlgRef_1Sel_QTD( this, "GroupPoints" ); GroupPoints->GroupBox1->setTitle( tr( "GEOM_NODES" ) ); GroupPoints->TextLabel1->setText( tr("GEOM_POINTS") ); - GroupPoints->PushButton1->setPixmap(image1); + GroupPoints->PushButton1->setIcon(image1); GroupPoints->LineEdit1->setReadOnly( true ); - Layout1->addWidget(GroupPoints, 2, 0); + gridLayout1->addWidget(aGroupPointsWidget, 2, 0); /***************************************************************/ setHelpFileName("curve.htm"); @@ -123,7 +125,7 @@ void BasicGUI_CurveDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - initName( tr( "GEOM_CURVE" ) ); + initName( tr( "GEOM_CURVE" ).toStdString().c_str() ); ConstructorsClicked( 0 ); } diff --git a/src/BasicGUI/BasicGUI_CurveDlg.h b/src/BasicGUI/BasicGUI_CurveDlg.h index 6a1b6fa9b..cd7f76575 100644 --- a/src/BasicGUI/BasicGUI_CurveDlg.h +++ b/src/BasicGUI/BasicGUI_CurveDlg.h @@ -32,8 +32,6 @@ #include "GEOMBase_Skeleton.h" #include "DlgRef_1Sel_QTD.h" -#include "BasicGUI.h" - #include //================================================================================= @@ -46,7 +44,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_CurveDlg : public GEOMBase_Skeleton public: BasicGUI_CurveDlg(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); ~BasicGUI_CurveDlg(); protected: @@ -61,7 +59,7 @@ private : void Init(); void enterEvent(QEvent* e); - DlgRef_1Sel_QTD* GroupPoints; + Ui::DlgRef_1Sel_QTD* GroupPoints; GEOM::ListOfGO_var myPoints; list myOrderedSel;//!< This list used for managing orderes selection diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index ba6db7d30..7e85536e0 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -26,18 +26,19 @@ // $Header$ #include "BasicGUI_EllipseDlg.h" +#include "DlgRef_2Sel2Spin.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; //================================================================================= @@ -48,20 +49,21 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(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_ELLIPSE_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_ELLIPSE_TITLE")); + setWindowTitle(tr("GEOM_ELLIPSE_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_ELLIPSE")); - 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(); GroupPoints = new DlgRef_2Sel2Spin(this, "GroupPoints"); GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); @@ -69,13 +71,13 @@ BasicGUI_EllipseDlg::BasicGUI_EllipseDlg(GeometryGUI* theGeometryGUI, QWidget* p GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR")); GroupPoints->TextLabel3->setText(tr("GEOM_RADIUS_MAJOR")); GroupPoints->TextLabel4->setText(tr("GEOM_RADIUS_MINOR")); - GroupPoints->PushButton1->setPixmap(image1); - GroupPoints->PushButton2->setPixmap(image1); + GroupPoints->PushButton1->setIcon(image1); + GroupPoints->PushButton2->setIcon(image1); GroupPoints->LineEdit1->setReadOnly( true ); GroupPoints->LineEdit2->setReadOnly( true ); - Layout1->addWidget(GroupPoints, 2, 0); + gridLayout1->addWidget(GroupPoints, 2, 0); /***************************************************************/ setHelpFileName("ellipse.htm"); @@ -142,7 +144,7 @@ void BasicGUI_EllipseDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; - initName( tr( "GEOM_ELLIPSE" ) ); + initName( tr( "GEOM_ELLIPSE" ).toStdString().c_str() ); } diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.h b/src/BasicGUI/BasicGUI_EllipseDlg.h index 038700f53..6369a7469 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.h +++ b/src/BasicGUI/BasicGUI_EllipseDlg.h @@ -30,9 +30,8 @@ #include "GEOM_BasicGUI.hxx" #include "GEOMBase_Skeleton.h" -#include "DlgRef_2Sel2Spin.h" -#include "BasicGUI.h" +class DlgRef_2Sel2Spin; //================================================================================= // class : BasicGUI_EllipseDlg @@ -44,7 +43,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_EllipseDlg : public GEOMBase_Skeleton public: BasicGUI_EllipseDlg(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); ~BasicGUI_EllipseDlg(); protected: diff --git a/src/BasicGUI/BasicGUI_LineDlg.cxx b/src/BasicGUI/BasicGUI_LineDlg.cxx index f71fc7a18..099bfbeed 100644 --- a/src/BasicGUI/BasicGUI_LineDlg.cxx +++ b/src/BasicGUI/BasicGUI_LineDlg.cxx @@ -28,17 +28,16 @@ #include "BasicGUI_LineDlg.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,32 +48,37 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BasicGUI_LineDlg::BasicGUI_LineDlg(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_LINE_2P"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_LINE_TITLE")); + setWindowTitle(tr("GEOM_LINE_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_LINE")); - 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(); + + 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_POINTS")); GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg("1")); GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg("2")); - GroupPoints->PushButton1->setPixmap(image1); - GroupPoints->PushButton2->setPixmap(image1); + GroupPoints->PushButton1->setIcon(image1); + GroupPoints->PushButton2->setIcon(image1); GroupPoints->LineEdit1->setReadOnly( true ); GroupPoints->LineEdit2->setReadOnly( true ); - Layout1->addWidget(GroupPoints, 2, 0); + gridLayout1->addWidget(aGroupPointsWidget, 2, 0); /***************************************************************/ setHelpFileName("line.htm"); @@ -123,7 +127,7 @@ void BasicGUI_LineDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - initName( tr("GEOM_LINE") ); + initName( tr("GEOM_LINE").toStdString().c_str() ); } diff --git a/src/BasicGUI/BasicGUI_LineDlg.h b/src/BasicGUI/BasicGUI_LineDlg.h index 65eba2b98..dfa709d7e 100644 --- a/src/BasicGUI/BasicGUI_LineDlg.h +++ b/src/BasicGUI/BasicGUI_LineDlg.h @@ -43,7 +43,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_LineDlg : public GEOMBase_Skeleton public: BasicGUI_LineDlg(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); ~BasicGUI_LineDlg(); protected: @@ -61,7 +61,7 @@ private : GEOM::GEOM_Object_var myPoint1; GEOM::GEOM_Object_var myPoint2; - DlgRef_2Sel_QTD* GroupPoints; + Ui::DlgRef_2Sel_QTD* GroupPoints; private slots: void ClickOnOk(); diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index 99e7ff9a5..d77a68a95 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -29,17 +29,18 @@ #include "BasicGUI_MarkerDlg.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 #include "GEOMImpl_Types.hxx" -#include "utilities.h" - // OCCT Includes #include #include @@ -59,65 +60,95 @@ //================================================================================= BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* theParent ) : GEOMBase_Skeleton(theGeometryGUI, theParent, "BasicGUI_MarkerDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) + Qt::WindowTitleHint | Qt::WindowSystemMenuHint) { QPixmap iconCS1 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER" ) ) ); QPixmap iconCS2 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER2" ) ) ); QPixmap iconCS3 ( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_MARKER3" ) ) ); QPixmap iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) ); - setCaption( tr( "CAPTION" ) ); + setWindowTitle( tr( "CAPTION" ) ); GroupConstructors->setTitle( tr( "LOCALCS" ) ); - RadioButton1->setPixmap( iconCS1 ); - RadioButton2->setPixmap( iconCS2 ); - RadioButton3->setPixmap( iconCS3 ); + RadioButton1->setIcon( iconCS1 ); + RadioButton2->setIcon( iconCS2 ); + RadioButton3->setIcon( iconCS3 ); + + Group1 = new Ui::DlgRef_1Sel_QTD(); + QWidget* aGroup1Widget = new QWidget(this); + Group1->setupUi(aGroup1Widget); + aGroup1Widget->setObjectName("Group1"); - Group1 = new DlgRef_1Sel_QTD(this, "Group1"); Group1->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); Group1->TextLabel1->setText(tr("GEOM_OBJECT")); - Group1->PushButton1->setPixmap(iconSelect); + Group1->PushButton1->setIcon(iconSelect); + + Group2 = new Ui::DlgRef_3Sel_QTD(); + QWidget* aGroup2Widget = new QWidget(this); + Group2->setupUi(aGroup2Widget); + aGroup2Widget->setObjectName("Group2"); - Group2 = new DlgRef_3Sel_QTD(this, "Group2"); Group2->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); Group2->TextLabel1->setText(tr("GEOM_POINT")); Group2->TextLabel2->setText(tr("XDIR")); Group2->TextLabel3->setText(tr("YDIR")); - Group2->PushButton1->setPixmap(iconSelect); - Group2->PushButton2->setPixmap(iconSelect); - Group2->PushButton3->setPixmap(iconSelect); + Group2->PushButton1->setIcon(iconSelect); + Group2->PushButton2->setIcon(iconSelect); + Group2->PushButton3->setIcon(iconSelect); - aMainGrp = new QGroupBox( 1, Qt::Horizontal, this ); + aMainGrp = new QFrame( this ); aMainGrp->setFrameStyle( QFrame::NoFrame ); - aMainGrp->setInsideMargin( 0 ); + aMainGrp->setContentsMargins( 0, 0, 0, 0 ); + QHBoxLayout* aMainGrpLayout = new QHBoxLayout( aMainGrp ); + + QGroupBox* anOriGrp = new QGroupBox( tr( "ORIGIN" ), aMainGrp ); + QVBoxLayout* anOriGrpLayout = new QVBoxLayout( anOriGrp ); - QGroupBox* anOriGrp = new QGroupBox( 1, Qt::Vertical, tr( "ORIGIN" ), aMainGrp ); - new QLabel( tr( "GEOM_X" ), anOriGrp ); + anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), anOriGrp ) ); myData[ X ] = new DlgRef_SpinBox( anOriGrp ); - new QLabel( tr( "GEOM_Y" ), anOriGrp ); + anOriGrpLayout->addWidget( myData[ X ] ); + anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), anOriGrp ) ); myData[ Y ] = new DlgRef_SpinBox( anOriGrp ); - new QLabel( tr( "GEOM_Z" ), anOriGrp ); + anOriGrpLayout->addWidget( myData[ Y ] ); + anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), anOriGrp ) ); myData[ Z ] = new DlgRef_SpinBox( anOriGrp ); + anOriGrpLayout->addWidget( myData[ Z ] ); - QGroupBox* aXAxisGrp = new QGroupBox( 1, Qt::Vertical, tr( "XDIR" ), aMainGrp ); - new QLabel( tr( "DX" ), aXAxisGrp ); + aMainGrpLayout->addWidget( anOriGrp ); + + QGroupBox* aXAxisGrp = new QGroupBox( tr( "XDIR" ), aMainGrp ); + QVBoxLayout* aXAxisGrpLayout = new QVBoxLayout( aXAxisGrp ); + + aXAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), aXAxisGrp ) ); myData[ DX1 ] = new DlgRef_SpinBox( aXAxisGrp ); - new QLabel( tr( "DY" ), aXAxisGrp ); + aXAxisGrpLayout->addWidget( myData[ DX1 ] ); + aXAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), aXAxisGrp ) ); myData[ DY1 ] = new DlgRef_SpinBox( aXAxisGrp ); - new QLabel( tr( "DZ" ), aXAxisGrp ); + aXAxisGrpLayout->addWidget( myData[ DY1 ] ); + aXAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), aXAxisGrp ) ); myData[ DZ1 ] = new DlgRef_SpinBox( aXAxisGrp ); + aXAxisGrpLayout->addWidget( myData[ DZ1 ] ); - QGroupBox* anYAxisGrp = new QGroupBox( 1, Qt::Vertical, tr( "YDIR" ), aMainGrp ); - new QLabel( tr( "DX" ), anYAxisGrp ); + aMainGrpLayout->addWidget( aXAxisGrp ); + + QGroupBox* anYAxisGrp = new QGroupBox( tr( "YDIR" ), aMainGrp ); + QVBoxLayout* anYAxisGrpLayout = new QVBoxLayout( anYAxisGrp ); + + anYAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), anYAxisGrp ) ); myData[ DX2 ] = new DlgRef_SpinBox( anYAxisGrp ); - new QLabel( tr( "DY" ), anYAxisGrp ); + anYAxisGrpLayout->addWidget( myData[ DX2 ] ); + anYAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), anYAxisGrp ) ); myData[ DY2 ] = new DlgRef_SpinBox( anYAxisGrp ); - new QLabel( tr( "DZ" ), anYAxisGrp ); + anYAxisGrpLayout->addWidget( myData[ DY2 ] ); + anYAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), anYAxisGrp ) ); myData[ DZ2 ] = new DlgRef_SpinBox( anYAxisGrp ); + anYAxisGrpLayout->addWidget( myData[ DZ2 ] ); - Layout1->addWidget( aMainGrp, 2, 0 ); - Layout1->addWidget( Group1, 2, 0 ); - Layout1->addWidget( Group2, 2, 0 ); + aMainGrpLayout->addWidget( anYAxisGrp ); + + gridLayout1->addWidget( aMainGrp, 2, 0 ); + gridLayout1->addWidget( aGroup1Widget, 2, 0 ); + gridLayout1->addWidget( aGroup2Widget, 2, 0 ); setHelpFileName("local_coordinate_system.htm"); @@ -169,21 +200,21 @@ void BasicGUI_MarkerDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionDone() ) ); - initName( tr( "LCS_NAME" ) ); + initName( tr( "LCS_NAME" ).toStdString().c_str() ); SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100); for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter ) { - anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 ); - connect( anIter.data(), SIGNAL( valueChanged( double ) ), + anIter.value()->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 ); + connect( anIter.value(), SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged( double ) ) ); } myBlockPreview = true; for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter ) - anIter.data()->SetValue( 0 ); + anIter.value()->SetValue( 0 ); myData[ DX1 ]->SetValue( 1 ); myData[ DY2 ]->SetValue( 1 ); myBlockPreview = false; @@ -231,8 +262,8 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId ) { case 0: { - Group1->hide(); - Group2->hide(); + ::qobject_cast( Group1->gridLayout->parent() )->hide(); + ::qobject_cast( Group2->gridLayout->parent() )->hide(); resize(0, 0); aMainGrp->show(); localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); @@ -241,10 +272,10 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId ) } case 1: { - Group2->hide(); + ::qobject_cast( Group2->gridLayout->parent() )->hide(); aMainGrp->hide(); //PAL6669: resize(0, 0); - Group1->show(); + ::qobject_cast( Group1->gridLayout->parent() )->show(); globalSelection( GEOM_ALLGEOM ); myEditCurrentArgument = Group1->LineEdit1; @@ -254,9 +285,9 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId ) case 2: { aMainGrp->hide(); - Group1->show(); + ::qobject_cast( Group1->gridLayout->parent() )->show(); //PAL6669: resize(0, 0); - Group2->show(); + ::qobject_cast( Group2->gridLayout->parent() )->show(); globalSelection( GEOM_POINT ); myEditCurrentArgument = Group2->LineEdit1; diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.h b/src/BasicGUI/BasicGUI_MarkerDlg.h index 7ba75b60b..897f9e85a 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.h +++ b/src/BasicGUI/BasicGUI_MarkerDlg.h @@ -34,7 +34,7 @@ #include "DlgRef_1Sel_QTD.h" #include "DlgRef_3Sel_QTD.h" -#include +#include class DlgRef_SpinBox; @@ -82,9 +82,9 @@ private: int myConstructorId; int myBlockPreview; - QGroupBox* aMainGrp; - DlgRef_1Sel_QTD* Group1; - DlgRef_3Sel_QTD* Group2; + QFrame* aMainGrp; + Ui::DlgRef_1Sel_QTD* Group1; + Ui::DlgRef_3Sel_QTD* Group2; }; diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index a48162902..6db4f8a9a 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -27,16 +27,21 @@ // $Header$ #include "BasicGUI_PlaneDlg.h" +#include "DlgRef_1Sel1Spin.h" +#include "DlgRef_2Sel1Spin.h" +#include "DlgRef_3Sel1Spin.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 - #include "GEOMImpl_Types.hxx" using namespace std; @@ -49,30 +54,29 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(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_PLANE_PV"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_3PNTS"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_PLANE_FACE"))); QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_PLANE_TITLE")); + setWindowTitle(tr("GEOM_PLANE_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_PLANE")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image1); - RadioButton3->setPixmap(image2); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image1); + RadioButton3->setIcon(image2); GroupPntDir = new DlgRef_2Sel1Spin(this, "GroupPointDirection"); GroupPntDir->GroupBox1->setTitle(tr("GEOM_PLANE_PV")); GroupPntDir->TextLabel1->setText(tr("GEOM_POINT")); GroupPntDir->TextLabel2->setText(tr("GEOM_VECTOR")); GroupPntDir->TextLabel3->setText(tr("GEOM_PLANE_SIZE")); - GroupPntDir->PushButton1->setPixmap(image3); - GroupPntDir->PushButton2->setPixmap(image3); + GroupPntDir->PushButton1->setIcon(image3); + GroupPntDir->PushButton2->setIcon(image3); GroupPntDir->LineEdit1->setReadOnly( true ); GroupPntDir->LineEdit2->setReadOnly( true ); @@ -82,9 +86,9 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren Group3Pnts->TextLabel2->setText(tr("GEOM_POINT2")); Group3Pnts->TextLabel3->setText(tr("GEOM_POINT3")); Group3Pnts->TextLabel4->setText(tr("GEOM_PLANE_SIZE")); - Group3Pnts->PushButton1->setPixmap(image3); - Group3Pnts->PushButton2->setPixmap(image3); - Group3Pnts->PushButton3->setPixmap(image3); + Group3Pnts->PushButton1->setIcon(image3); + Group3Pnts->PushButton2->setIcon(image3); + Group3Pnts->PushButton3->setIcon(image3); Group3Pnts->LineEdit1->setReadOnly( true ); Group3Pnts->LineEdit2->setReadOnly( true ); @@ -94,13 +98,13 @@ BasicGUI_PlaneDlg::BasicGUI_PlaneDlg(GeometryGUI* theGeometryGUI, QWidget* paren GroupFace->GroupBox1->setTitle(tr("GEOM_FACE_OR_LCS")); GroupFace->TextLabel1->setText(tr("GEOM_SELECTION")); GroupFace->TextLabel2->setText(tr("GEOM_PLANE_SIZE")); - GroupFace->PushButton1->setPixmap(image3); + GroupFace->PushButton1->setIcon(image3); GroupFace->LineEdit1->setReadOnly( true ); - Layout1->addWidget(GroupPntDir, 2, 0); - Layout1->addWidget(Group3Pnts, 2, 0); - Layout1->addWidget(GroupFace, 2, 0); + gridLayout1->addWidget(GroupPntDir, 2, 0); + gridLayout1->addWidget(Group3Pnts, 2, 0); + gridLayout1->addWidget(GroupFace, 2, 0); /***************************************************************/ setHelpFileName("plane.htm"); @@ -178,7 +182,7 @@ void BasicGUI_PlaneDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - initName( tr( "GEOM_PLANE" ) ); + initName( tr( "GEOM_PLANE" ).toStdString().c_str() ); Group3Pnts->hide(); GroupFace->hide(); diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.h b/src/BasicGUI/BasicGUI_PlaneDlg.h index 05e8c69ec..aadf477a7 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.h +++ b/src/BasicGUI/BasicGUI_PlaneDlg.h @@ -31,9 +31,10 @@ #include "GEOM_BasicGUI.hxx" #include "GEOMBase_Skeleton.h" -#include "DlgRef_1Sel1Spin.h" -#include "DlgRef_2Sel1Spin.h" -#include "DlgRef_3Sel1Spin.h" + +class DlgRef_1Sel1Spin; +class DlgRef_2Sel1Spin; +class DlgRef_3Sel1Spin; //================================================================================= // class : BasicGUI_PlaneDlg @@ -45,7 +46,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_PlaneDlg : public GEOMBase_Skeleton public: BasicGUI_PlaneDlg( 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); ~BasicGUI_PlaneDlg(); protected: diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index 16b642130..abc0b4193 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -28,19 +28,26 @@ #include "BasicGUI_PointDlg.h" +#include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" +#include "GeometryGUI.h" +#include "GEOMBase.h" + +#include "DlgRef_SpinBox.h" +#include "DlgRef_1Sel1Spin.h" +#include "DlgRef_3Spin.h" +#include "DlgRef_1Sel3Spin.h" + #include "GEOMImpl_Types.hxx" -#include - -#include "utilities.h" +#include +#include #include #include -#include #include #include #include @@ -48,7 +55,6 @@ #include #include -#include using namespace std; //================================================================================= // class : BasicGUI_PointDlg() @@ -58,7 +64,7 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent, - const char* name, bool modal, WFlags fl) + const char* name, bool modal, Qt::WindowFlags fl) :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl ) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT"))); @@ -66,48 +72,56 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_REF"))); - setCaption(tr("GEOM_POINT_TITLE")); + setWindowTitle(tr("GEOM_POINT_TITLE")); - QGroupBox* aFrame = new QGroupBox( 1, Qt::Horizontal, this ); - aFrame->setInsideMargin( 0 ); + QFrame* aFrame = new QFrame( this ); + aFrame->setContentsMargins( 0, 0, 0, 0 ); aFrame->setFrameStyle( QFrame::NoFrame ); - + QHBoxLayout* aFrameLayout = new QHBoxLayout( aFrame ); + /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_POINTS")); - RadioButton1->setPixmap(image0); - RadioButton2->setPixmap(image3); - RadioButton3->setPixmap(image1); + RadioButton1->setIcon(image0); + RadioButton2->setIcon(image3); + RadioButton3->setIcon(image1); GroupXYZ = new DlgRef_3Spin( aFrame, "GroupXYZ" ); GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES")); GroupXYZ->TextLabel1->setText(tr("GEOM_X")); GroupXYZ->TextLabel2->setText(tr("GEOM_Y")); GroupXYZ->TextLabel3->setText(tr("GEOM_Z")); + aFrameLayout->addWidget(GroupXYZ); GroupOnCurve = new DlgRef_1Sel1Spin( aFrame, "GroupOnCurve" ); GroupOnCurve->GroupBox1->setTitle(tr("GEOM_PARAM_POINT")); GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE")); GroupOnCurve->TextLabel2->setText(tr("GEOM_PARAMETER")); - GroupOnCurve->PushButton1->setPixmap(image2); + GroupOnCurve->PushButton1->setIcon(image2); + aFrameLayout->addWidget(GroupOnCurve); GroupRefPoint = new DlgRef_1Sel3Spin( aFrame, "GoupRefPoint" ); GroupRefPoint->GroupBox1->setTitle(tr("GEOM_REF_POINT")); GroupRefPoint->TextLabel1->setText(tr("GEOM_POINT")); - GroupRefPoint->PushButton1->setPixmap(image2); + GroupRefPoint->PushButton1->setIcon(image2); GroupRefPoint->TextLabel2->setText(tr("GEOM_DX")); GroupRefPoint->TextLabel3->setText(tr("GEOM_DY")); GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ")); + aFrameLayout->addWidget(GroupRefPoint); - Layout1->addWidget( aFrame, 2, 0 ); + gridLayout1->addWidget( aFrame, 2, 0 ); /***************************************************************/ - myCoordGrp = new QGroupBox( 2, Qt::Horizontal, tr( "GEOM_COORDINATES" ), aFrame ); - new QLabel( tr( "GEOM_X" ), myCoordGrp ); + myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES" ), aFrame ); + QGridLayout* myCoordGrpLayout = new QGridLayout( myCoordGrp ); + myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), myCoordGrp ), 0, 0 ); myX = new QLineEdit( myCoordGrp ); - new QLabel( tr( "GEOM_Y" ), myCoordGrp ); + myCoordGrpLayout->addWidget( myX, 0, 1 ); + myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), myCoordGrp ), 1, 0 ); myY = new QLineEdit( myCoordGrp ); - new QLabel( tr( "GEOM_Z" ), myCoordGrp ); + myCoordGrpLayout->addWidget( myY, 1, 1 ); + myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), myCoordGrp ), 2, 0 ); myZ = new QLineEdit( myCoordGrp ); + myCoordGrpLayout->addWidget( myZ, 2, 1 ); myX->setReadOnly( true ); myY->setReadOnly( true ); @@ -118,7 +132,7 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren myZ->setEnabled( false ); QPalette aPal = myX->palette(); - aPal.setColor( QPalette::Disabled, QColorGroup::Text, QColor( 0, 0, 0 ) ) ; + aPal.setColor( QPalette::Disabled, QPalette::Text, QColor( 0, 0, 0 ) ) ; myX->setPalette( aPal ); myY->setPalette( aPal ); myZ->setPalette( aPal ); @@ -206,7 +220,7 @@ void BasicGUI_PointDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - initName( tr("GEOM_VERTEX") ); + initName( tr("GEOM_VERTEX").toStdString().c_str() ); ConstructorsClicked( 0 ); } diff --git a/src/BasicGUI/BasicGUI_PointDlg.h b/src/BasicGUI/BasicGUI_PointDlg.h index 5d9e7cd7f..b6dded380 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.h +++ b/src/BasicGUI/BasicGUI_PointDlg.h @@ -31,13 +31,16 @@ #include "GEOM_BasicGUI.hxx" #include "GEOMBase_Skeleton.h" -#include "DlgRef_1Sel1Spin.h" -#include "DlgRef_3Spin.h" -#include "DlgRef_1Sel3Spin.h" + +class DlgRef_1Sel1Spin; +class DlgRef_3Spin; +class DlgRef_1Sel3Spin; class QLineEdit; class QGroupBox; +class gp_Pnt; + //================================================================================= // class : BasicGUI_PointDlg // purpose : @@ -48,7 +51,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_PointDlg : public GEOMBase_Skeleton public: BasicGUI_PointDlg(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); ~BasicGUI_PointDlg(); diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 48fb526cd..c8acfeb52 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -27,18 +27,19 @@ // $Header$ #include "BasicGUI_VectorDlg.h" +#include "DlgRef_3Spin1Check.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,27 +50,32 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BasicGUI_VectorDlg::BasicGUI_VectorDlg(GeometryGUI* theGeometryGUI, QWidget* parent, - const char* name, bool modal, WFlags fl) + const char* name, bool modal, Qt::WindowFlags fl) :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl) { QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_VECTOR_2P"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_VECTOR_DXYZ"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT"))); - setCaption(tr("GEOM_VECTOR_TITLE")); + setWindowTitle(tr("GEOM_VECTOR_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_VECTOR")); - 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_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); GroupPoints->LineEdit1->setReadOnly( true ); GroupPoints->LineEdit2->setReadOnly( true ); @@ -81,8 +87,8 @@ BasicGUI_VectorDlg::BasicGUI_VectorDlg(GeometryGUI* theGeometryGUI, QWidget* par GroupDimensions->TextLabel3->setText(tr("GEOM_DZ")); GroupDimensions->CheckBox1->setText(tr("GEOM_REVERSE_VECTOR")); - Layout1->addWidget(GroupPoints, 2, 0); - Layout1->addWidget(GroupDimensions, 2, 0); + gridLayout1->addWidget(aGroupPointsWidget, 2, 0); + gridLayout1->addWidget(GroupDimensions, 2, 0); /***************************************************************/ setHelpFileName("vector.htm"); @@ -157,7 +163,7 @@ void BasicGUI_VectorDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - initName( tr("GEOM_VECTOR") ); + initName( tr("GEOM_VECTOR").toStdString().c_str() ); GroupDimensions->hide(); ConstructorsClicked( 0 ); @@ -180,7 +186,7 @@ void BasicGUI_VectorDlg::ConstructorsClicked( int constructorId ) { GroupDimensions->hide(); resize(0, 0); - GroupPoints->show(); + ::qobject_cast( GroupPoints->gridLayout->parent() )->show(); myEditCurrentArgument = GroupPoints->LineEdit1; GroupPoints->LineEdit1->setText(""); @@ -193,7 +199,7 @@ void BasicGUI_VectorDlg::ConstructorsClicked( int constructorId ) } case 1: { - GroupPoints->hide(); + ::qobject_cast( GroupPoints->gridLayout->parent() )->hide(); resize( 0, 0 ); GroupDimensions->show(); diff --git a/src/BasicGUI/BasicGUI_VectorDlg.h b/src/BasicGUI/BasicGUI_VectorDlg.h index a9dcb51b8..fd444db37 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.h +++ b/src/BasicGUI/BasicGUI_VectorDlg.h @@ -32,9 +32,8 @@ #include "GEOMBase_Skeleton.h" #include "DlgRef_2Sel_QTD.h" -#include "DlgRef_3Spin1Check.h" -#include "BasicGUI.h" +class DlgRef_3Spin1Check; //================================================================================= // class : BasicGUI_VectorDlg @@ -46,7 +45,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_VectorDlg : public GEOMBase_Skeleton public: BasicGUI_VectorDlg(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); ~BasicGUI_VectorDlg(); protected: @@ -62,8 +61,8 @@ private : GEOM::GEOM_Object_var myPoint1; GEOM::GEOM_Object_var myPoint2; - DlgRef_2Sel_QTD* GroupPoints; - DlgRef_3Spin1Check* GroupDimensions; + Ui::DlgRef_2Sel_QTD* GroupPoints; + DlgRef_3Spin1Check* GroupDimensions; private slots: void ClickOnOk(); diff --git a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx index 97a7421c2..35eba3f63 100644 --- a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx @@ -27,16 +27,16 @@ #include "BasicGUI_WorkingPlaneDlg.h" +#include "GeometryGUI.h" #include "GEOMBase.h" -#include "SUIT_Desktop.h" +#include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "SalomeApp_Application.h" #include "LightApp_SelectionMgr.h" // OCCT Includes #include -#include #include #include #include @@ -45,8 +45,7 @@ #include // QT Includes -#include -#include +#include #include "GEOMImpl_Types.hxx" @@ -60,57 +59,70 @@ using namespace std; // TRUE to construct a modal dialog. //================================================================================= BasicGUI_WorkingPlaneDlg::BasicGUI_WorkingPlaneDlg(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_SELECT"))); QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_WPLANE_FACE"))); QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_WPLANE_VECTOR"))); QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_WPLANE_ORIGIN"))); - setCaption(tr("GEOM_WPLANE_TITLE")); + setWindowTitle(tr("GEOM_WPLANE_TITLE")); /***************************************************************/ GroupConstructors->setTitle(tr("GEOM_WPLANE")); - RadioButton1->setPixmap(image1); - RadioButton2->setPixmap(image2); - RadioButton3->setPixmap(image3); + RadioButton1->setIcon(image1); + RadioButton2->setIcon(image2); + RadioButton3->setIcon(image3); + + Group1 = new Ui::DlgRef_1Sel_QTD(); + QWidget* aGroup1Widget = new QWidget(this); + Group1->setupUi(aGroup1Widget); + aGroup1Widget->setObjectName("Group1"); - Group1 = new DlgRef_1Sel_QTD(this, "Group1"); Group1->GroupBox1->setTitle(tr("GEOM_WPLANE_FACE")); Group1->TextLabel1->setText(tr("GEOM_SELECTION")); - Group1->PushButton1->setPixmap(image0); + Group1->PushButton1->setIcon(image0); Group1->LineEdit1->setReadOnly( true ); - Group2 = new DlgRef_2Sel_QTD(this, "Group2"); + Group2 = new Ui::DlgRef_2Sel_QTD(); + QWidget* aGroup2Widget = new QWidget(this); + Group2->setupUi(aGroup2Widget); + aGroup2Widget->setObjectName("Group2"); + Group2->GroupBox1->setTitle(tr("GEOM_WPLANE_VECTOR")); Group2->TextLabel1->setText(tr("GEOM_WPLANE_VX")); Group2->TextLabel2->setText(tr("GEOM_WPLANE_VZ")); - Group2->PushButton1->setPixmap(image0); - Group2->PushButton2->setPixmap(image0); + Group2->PushButton1->setIcon(image0); + Group2->PushButton2->setIcon(image0); Group2->LineEdit1->setReadOnly( true ); Group2->LineEdit2->setReadOnly( true ); - Group3 = new DlgRef_3Check_QTD(this, "Group3"); + Group3 = new Ui::DlgRef_3Check_QTD(); + QWidget* aGroup3Widget = new QWidget(this); + Group3->setupUi(aGroup3Widget); + aGroup3Widget->setObjectName("Group3"); + Group3->GroupBox1->setTitle(tr("GEOM_WPLANE_ORIGIN")); Group3->RadioButton1->setText(tr("GEOM_WPLANE_OXY")); Group3->RadioButton2->setText(tr("GEOM_WPLANE_OYZ")); Group3->RadioButton3->setText(tr("GEOM_WPLANE_OZX")); - Layout1->addWidget(Group1, 1, 0); - Layout1->addWidget(Group2, 1, 0); - Layout1->addWidget(Group3, 1, 0); + gridLayout1->addWidget(aGroup1Widget, 1, 0); + gridLayout1->addWidget(aGroup2Widget, 1, 0); + gridLayout1->addWidget(aGroup3Widget, 1, 0); /***************************************************************/ - QGroupBox* aReverseGroupBox = new QGroupBox(this, "aReverseGroupBox"); - aReverseGroupBox->setTitle(tr("")); - aReverseGroupBox->setColumnLayout(1, Qt::Horizontal); - aReverseGroupBox->setInsideMargin(10); - - myReverseCB = new QCheckBox(aReverseGroupBox, "myReverseCB"); - myReverseCB->setText(tr("GEOM_REVERSE_PLANE")); + QFrame* aReverseGroupBox = new QFrame(this); + aReverseGroupBox->setObjectName("aReverseGroupBox"); + aReverseGroupBox->setContentsMargins(10, 10, 10, 10); + QHBoxLayout* aReverseGroupBoxLayout = new QHBoxLayout( aReverseGroupBox ); - Layout1->addWidget(aReverseGroupBox, 2, 0); + myReverseCB = new QCheckBox(aReverseGroupBox); + myReverseCB->setObjectName("myReverseCB"); + myReverseCB->setText(tr("GEOM_REVERSE_PLANE")); + aReverseGroupBoxLayout->addWidget(myReverseCB); + + gridLayout1->addWidget(aReverseGroupBox, 2, 0); setHelpFileName("working_plane.htm"); @@ -171,7 +183,7 @@ void BasicGUI_WorkingPlaneDlg::Init() connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - initName( tr( "GEOM_WPLANE" ) ); + initName( tr( "GEOM_WPLANE" ).toStdString().c_str() ); ConstructorsClicked(0); } @@ -195,10 +207,10 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) aMap.Add( GEOM_MARKER ); globalSelection( aMap ); - Group2->hide(); - Group3->hide(); + ::qobject_cast( Group2->gridLayout->parent() )->hide(); + ::qobject_cast( Group3->gridLayout->parent() )->hide(); resize(0, 0); - Group1->show(); + ::qobject_cast( Group1->gridLayout->parent() )->show(); myEditCurrentArgument = Group1->LineEdit1; Group1->LineEdit1->setText(""); @@ -211,10 +223,10 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) { globalSelection( GEOM_LINE ); - Group1->hide(); - Group3->hide(); + ::qobject_cast( Group1->gridLayout->parent() )->hide(); + ::qobject_cast( Group3->gridLayout->parent() )->hide(); resize(0, 0); - Group2->show(); + ::qobject_cast( Group2->gridLayout->parent() )->show(); myEditCurrentArgument = Group2->LineEdit1; Group2->LineEdit1->setText(""); @@ -227,10 +239,10 @@ void BasicGUI_WorkingPlaneDlg::ConstructorsClicked(int constructorId) } case 2: { - Group1->hide(); - Group2->hide(); + ::qobject_cast( Group1->gridLayout->parent() )->hide(); + ::qobject_cast( Group2->gridLayout->parent() )->hide(); resize(0, 0); - Group3->show(); + ::qobject_cast( Group3->gridLayout->parent() )->show(); Group3->RadioButton1->setChecked(true); aOriginType = 1; diff --git a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.h b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.h index 40cddf743..da6d6ad03 100644 --- a/src/BasicGUI/BasicGUI_WorkingPlaneDlg.h +++ b/src/BasicGUI/BasicGUI_WorkingPlaneDlg.h @@ -35,6 +35,8 @@ #include "DlgRef_2Sel_QTD.h" #include "DlgRef_3Check_QTD.h" +#include + class QCheckBox; //================================================================================= @@ -47,7 +49,7 @@ class GEOM_BASICGUI_EXPORT BasicGUI_WorkingPlaneDlg : public GEOMBase_Skeleton public: BasicGUI_WorkingPlaneDlg( 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 ); ~BasicGUI_WorkingPlaneDlg(); virtual void closeEvent( QCloseEvent* e ); @@ -63,9 +65,9 @@ private: int aOriginType; - DlgRef_1Sel_QTD* Group1; - DlgRef_2Sel_QTD* Group2; - DlgRef_3Check_QTD* Group3; + Ui::DlgRef_1Sel_QTD* Group1; + Ui::DlgRef_2Sel_QTD* Group2; + Ui::DlgRef_3Check_QTD* Group3; QCheckBox* myReverseCB; diff --git a/src/src.pro b/src/src.pro index 8f1277801..fcc1d260e 100644 --- a/src/src.pro +++ b/src/src.pro @@ -26,7 +26,7 @@ SUBDIRS += GEOMGUI SUBDIRS += GEOMBase SUBDIRS += GEOMToolsGUI SUBDIRS += DisplayGUI -#SUBDIRS += BasicGUI +SUBDIRS += BasicGUI #SUBDIRS += PrimitiveGUI #SUBDIRS += GenerationGUI #SUBDIRS += EntityGUI