From 24702e4b6a0bdf24dfaaa44d3defe0cade6d6f7e Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 18 Mar 2008 16:24:05 +0000 Subject: [PATCH] Qt4 porting. --- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 6 ++++-- src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx | 6 ++++-- src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx | 4 +++- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 3 +++ src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx | 4 +++- src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx | 3 +++ src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx | 4 +++- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_NodesDlg.cxx | 8 +++++--- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 4 +++- src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx | 4 +++- src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx | 4 +++- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 5 +++-- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 2 +- 15 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 1267a44ce..a8d640da2 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -70,9 +70,10 @@ #include #include #include -#include +#include #include #include +#include #define SPACING 6 #define MARGIN 11 @@ -281,6 +282,7 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule, /***************************************************************/ GroupConstructors = new QGroupBox(buttonGrTitle, this); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); GroupConstructorsLayout->setSpacing(SPACING); GroupConstructorsLayout->setMargin(MARGIN); @@ -290,7 +292,7 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule, Constructor1->setChecked(true); GroupConstructorsLayout->addWidget(Constructor1); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton( Constructor1, 0 ); /***************************************************************/ GroupC1 = new QGroupBox(grBoxTitle, this); diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index 35465fb07..52458d535 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -78,6 +78,7 @@ #include #include #include +#include // STL includes #include @@ -402,6 +403,7 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM /***************************************************************/ GroupConstructors = new QGroupBox(constructorGrTitle, this); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* aGroupConstructorsLayout = new QHBoxLayout(GroupConstructors); aGroupConstructorsLayout->setSpacing(SPACING); aGroupConstructorsLayout->setMargin(MARGIN); @@ -409,7 +411,7 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM myRadioButton1 = new QRadioButton(GroupConstructors); myRadioButton1->setIcon(image0); aGroupConstructorsLayout->addWidget(myRadioButton1); - aGroupConstructorsLayout->addStretch(); + ButtonGroup->addButton(myRadioButton1, 0); /***************************************************************/ GroupArguments = new QGroupBox(argumentsGrTitle, this); @@ -1058,7 +1060,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity ) // clear table for ( int row = 0; row < myTable->rowCount(); row++ ) for ( int col = 0; col < myTable->columnCount(); col++ ) - myTable->item(row, col)->setText(""); + if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText(""); myTable->setEnabled( false ); } diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index 7e88164ac..73efb4e4a 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -56,6 +56,7 @@ #include #include #include +#include // STL includes #include @@ -88,6 +89,7 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule ) /***************************************************************/ GroupConstructors = new QGroupBox(tr("COMPOUND"), this); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); GroupConstructorsLayout->setSpacing(SPACING); GroupConstructorsLayout->setMargin(MARGIN); @@ -96,7 +98,7 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule ) Constructor1->setIcon(image0); Constructor1->setChecked(true); GroupConstructorsLayout->addWidget(Constructor1); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton(Constructor1, 0); /***************************************************************/ GroupName = new QGroupBox(tr("RESULT_NAME"), this); diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 76b247247..195295c12 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -77,6 +77,7 @@ #include #include #include +#include // VTK includes #include @@ -812,6 +813,7 @@ QFrame* SMESHGUI_ComputeDlg::createMainFrame (QWidget* theParent) // constructor QGroupBox* aPixGrp = new QGroupBox(tr("CONSTRUCTOR"), aFrame); + QButtonGroup* aBtnGrp = new QButtonGroup(this); QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp); aPixGrpLayout->setMargin(MARGIN); aPixGrpLayout->setSpacing(SPACING); @@ -819,6 +821,7 @@ QFrame* SMESHGUI_ComputeDlg::createMainFrame (QWidget* theParent) aRBut->setIcon(iconCompute); aRBut->setChecked(true); aPixGrpLayout->addWidget(aRBut); + aBtnGrp->addButton(aRBut, 0); // Mesh name diff --git a/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx index 1024fdfae..1afa9aa05 100644 --- a/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx @@ -86,6 +86,7 @@ #include #include #include +#include #define SPACING 6 #define MARGIN 11 @@ -329,6 +330,7 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule, tr("SMESH_MERGE_NODES"), this); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); GroupConstructorsLayout->setSpacing(SPACING); GroupConstructorsLayout->setMargin(MARGIN); @@ -337,7 +339,7 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule, RadioButton->setIcon(myAction == 1 ? IconMergeElems : IconMergeNodes); RadioButton->setChecked(true); GroupConstructorsLayout->addWidget(RadioButton); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton(RadioButton, 0); /***************************************************************/ // Controls for mesh defining diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index ddc62504c..9dc81ed3c 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -67,6 +67,7 @@ #include #include #include +#include // VTK includes #include @@ -114,6 +115,7 @@ QWidget* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent) // constructor QGroupBox* aPixGrp = new QGroupBox(tr("MESH_PASS_THROUGH_POINT"), aFrame); + QButtonGroup* aBtnGrp = new QButtonGroup(this); QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp); aPixGrpLayout->setMargin(MARGIN); aPixGrpLayout->setSpacing(SPACING); @@ -122,6 +124,7 @@ QWidget* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent) aRBut->setIcon(iconMoveNode); aRBut->setChecked(true); aPixGrpLayout->addWidget(aRBut); + aBtnGrp->addButton(aRBut, 0); // coordinates diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx index 131e60b9f..1d39661bc 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx @@ -70,6 +70,7 @@ #include #include #include +#include // IDL includes #include @@ -158,6 +159,7 @@ QWidget* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent) //------------------------------------------------------------ QGroupBox* aPixGrp = new QGroupBox(tr("MESH_NODE"), aFrame); + QButtonGroup* aBtnGrp = new QButtonGroup(this); QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp); aPixGrpLayout->setSpacing(SPACING); aPixGrpLayout->setMargin(MARGIN); @@ -167,7 +169,7 @@ QWidget* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent) aRBut->setChecked(true); aPixGrpLayout->addWidget(aRBut); - aPixGrpLayout->addStretch(); + aBtnGrp->addButton(aRBut, 0); //------------------------------------------------------------ QGroupBox* anIdGrp = new QGroupBox(tr("SMESH_MOVE"), aFrame); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index 83b092f0d..27a885dd8 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -400,7 +400,7 @@ void SMESHGUI_MultiEditDlg::Init() if (myEntityTypeGrp) connect(myEntityTypeGrp, SIGNAL(buttonClicked(int)), SLOT(on3d2dChanged(int))); - connect(myListBox, SIGNAL(selectionChanged()), SLOT(onListSelectionChanged())); + connect(myListBox, SIGNAL(itemSelectionChanged()), SLOT(onListSelectionChanged())); onSelectionDone(); diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index d3a963b39..11f2e8ccf 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -76,6 +76,7 @@ #include #include #include +#include // IDL includes #include @@ -226,7 +227,7 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ): { setModal( false ); setAttribute( Qt::WA_DeleteOnClose, true ); - setWindowTitle( "MESH_NODE_TITLE" ); + setWindowTitle( tr("MESH_NODE_TITLE") ); setSizeGripEnabled( true ); mySimulation = new SMESH::TNodeSimulation( SMESH::GetViewWindow( mySMESHGUI ) ); @@ -240,6 +241,7 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ): /***************************************************************/ GroupConstructors = new QGroupBox( tr( "MESH_NODE" ), this ); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout( GroupConstructors ); GroupConstructorsLayout->setSpacing( SPACING ); GroupConstructorsLayout->setMargin( MARGIN ); @@ -247,9 +249,9 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ): Constructor1 = new QRadioButton( GroupConstructors ); Constructor1->setIcon( image0 ); Constructor1->setChecked( true ); - + GroupConstructorsLayout->addWidget( Constructor1 ); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton( Constructor1, 0 ); /***************************************************************/ GroupCoordinates = new QGroupBox( tr( "SMESH_COORDINATES" ), this ); diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index 300ab51c2..c8aa32a60 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -62,6 +62,7 @@ #include #include #include +#include // IDL includes #include @@ -96,6 +97,7 @@ SMESHGUI_RemoveElementsDlg /***************************************************************/ GroupConstructors = new QGroupBox(tr("SMESH_ELEMENTS"), this); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); GroupConstructorsLayout->setSpacing(SPACING); GroupConstructorsLayout->setMargin(MARGIN); @@ -105,7 +107,7 @@ SMESHGUI_RemoveElementsDlg Constructor1->setChecked(true); GroupConstructorsLayout->addWidget(Constructor1); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton(Constructor1, 0); /***************************************************************/ GroupC1 = new QGroupBox(tr("SMESH_REMOVE"), this); diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx index c12333923..50404e8cc 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx @@ -62,6 +62,7 @@ #include #include #include +#include // IDL includes #include @@ -96,6 +97,7 @@ SMESHGUI_RemoveNodesDlg /***************************************************************/ GroupConstructors = new QGroupBox(tr("SMESH_NODES"), this); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); GroupConstructorsLayout->setSpacing(SPACING); GroupConstructorsLayout->setMargin(MARGIN); @@ -105,7 +107,7 @@ SMESHGUI_RemoveNodesDlg Constructor1->setChecked(true); GroupConstructorsLayout->addWidget(Constructor1); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton(Constructor1, 0); /***************************************************************/ GroupC1 = new QGroupBox(tr("SMESH_REMOVE"), this); diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx index 4dc3f240d..2867d12db 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx @@ -54,6 +54,7 @@ #include #include #include +#include // IDL includes #include @@ -99,6 +100,7 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int "renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor" : "renumbering_nodes_and_elements_page.html#renumbering_elements_anchor"; + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); GroupConstructorsLayout->setSpacing(SPACING); GroupConstructorsLayout->setMargin(MARGIN); @@ -108,7 +110,7 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int Constructor1->setChecked(true); GroupConstructorsLayout->addWidget(Constructor1); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton(Constructor1, 0); /***************************************************************/ GroupMesh = new QGroupBox(tr("SMESH_RENUMBERING"), this); diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index d0ec0fb7a..914562d31 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -104,6 +104,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) /***************************************************************/ GroupConstructors = new QGroupBox(tr("SMESH_ROTATION"), this); + QButtonGroup* ButtonGroup = new QButtonGroup(this); QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors); GroupConstructorsLayout->setSpacing(SPACING); GroupConstructorsLayout->setMargin(MARGIN); @@ -112,7 +113,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) RadioButton1->setIcon(image0); GroupConstructorsLayout->addWidget(RadioButton1); - GroupConstructorsLayout->addStretch(); + ButtonGroup->addButton(RadioButton1, 0); /***************************************************************/ GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this); @@ -180,7 +181,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) SpinBox_Angle = new SMESHGUI_SpinBox(GroupArguments); // action switch - ActionBox = new QGroupBox(tr("ACTION"), GroupArguments); + ActionBox = new QGroupBox(GroupArguments); ActionGroup = new QButtonGroup(GroupArguments); QVBoxLayout* ActionBoxLayout = new QVBoxLayout(ActionBox); ActionBoxLayout->setSpacing(SPACING); diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 39d9b89a1..4dccb4c79 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -188,7 +188,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule ) GroupMirrorLayout->addWidget(SpinBox_DZ, 1, 7); // switch of action type - ActionBox = new QGroupBox(tr("ACTION"), GroupArguments); + ActionBox = new QGroupBox(GroupArguments); ActionGroup = new QButtonGroup(GroupArguments); QVBoxLayout* ActionBoxLayout = new QVBoxLayout(ActionBox); ActionBoxLayout->addSpacing(SPACING); diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 1c5ac1f1e..6c520a0e4 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -161,7 +161,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) SpinBox2_3 = new SMESHGUI_SpinBox(GroupArguments); // switch of action type - ActionBox = new QGroupBox(tr("ACTION"), GroupArguments); + ActionBox = new QGroupBox(GroupArguments); ActionGroup = new QButtonGroup(GroupArguments); QVBoxLayout* ActionBoxLayout = new QVBoxLayout(ActionBox); ActionBoxLayout->addSpacing(SPACING); -- 2.39.2