From ca7f74119c9102be9b12f6521e531250d7c9f51f Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 17 Oct 2013 16:55:54 +0000 Subject: [PATCH] ILMAB: field of geometry Fix a bug that modification of values of the boolean field is not stored by [Apply] --- src/EntityGUI/EntityGUI_FieldDlg.cxx | 51 +-------------------------- src/EntityGUI/EntityGUI_FieldDlg.h | 52 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 50 deletions(-) diff --git a/src/EntityGUI/EntityGUI_FieldDlg.cxx b/src/EntityGUI/EntityGUI_FieldDlg.cxx index f819f96e8..9b4246b20 100644 --- a/src/EntityGUI/EntityGUI_FieldDlg.cxx +++ b/src/EntityGUI/EntityGUI_FieldDlg.cxx @@ -263,56 +263,6 @@ private: StepTable* myTable; }; -/* - Class : EntityGUI_FieldDlg::StepTable - Description : Table widget -*/ - -class EntityGUI_FieldDlg::StepTable : public QTableWidget -{ - //Q_OBJECT - - int myDataType; - int myStepID; - int myStamp; - GEOM::GEOM_FieldStep_var myStep; - bool myIsChanged; - - QTableWidgetItem * newDefaultItem(); -public: - StepTable( int stepID, int dataType, int nbRows, int nbColumns, - QString shapeName, QStringList headers, - GEOM::GEOM_FieldStep_ptr stepVar, QWidget* = 0 ); - virtual ~StepTable(); - - QSize minimumSizeHint() const; - - void setEditable( bool, int, int ); - bool isEditable( int, int ) const; - - void setReadOnly( bool ); - bool isReadOnly() const; - - void insertRows( int, int = 1 ); - QString text( int, int ); - - QList selectedRows(); - void selectRows(const QList& rows); - - void setDim( int nbRows, QString shapeName, bool setDefault=true ); - void setNbComps( int nbComps ); - void setDataType( int dataType ); - void setStamp( int stamp ) { myStamp = stamp; } - int getStamp() { return myStamp; } - int getStepID() { return myStepID; } - QStringList getHeaders(); - void setHeaders(const QStringList& headers); - GEOM::GEOM_FieldStep_var getStep() { return myStep; } - void setValues(GEOM::GEOM_FieldStep_var& step); - - void setIsChanged() { myIsChanged = true; } -}; - EntityGUI_FieldDlg::Delegate::Delegate( QObject* parent ) : QItemDelegate( parent ), myTable( dynamic_cast( parent ) ) @@ -443,6 +393,7 @@ EntityGUI_FieldDlg::StepTable::StepTable (int stepID, int dataType, for ( int iC = 1; iC < nbColumns; ++iC ) setItem( iR, iC, new CheckItem( vals[ iV++ ])); } + connect( this, SIGNAL( itemClicked(QTableWidgetItem *)), this, SLOT( setIsChanged() )); break; } case 1: diff --git a/src/EntityGUI/EntityGUI_FieldDlg.h b/src/EntityGUI/EntityGUI_FieldDlg.h index c5c7b2120..c3a0b7ae1 100644 --- a/src/EntityGUI/EntityGUI_FieldDlg.h +++ b/src/EntityGUI/EntityGUI_FieldDlg.h @@ -36,6 +36,7 @@ #include #include #include +#include class QGroupBox; class QLineEdit; @@ -131,6 +132,57 @@ private: QWidget* mySwitchTableWdg; QComboBox* myStepsCombo; SalomeApp_IntSpinBox* myStampSpin; + +}; + +/* + Class : EntityGUI_FieldDlg::StepTable + Description : Table widget +*/ + +class EntityGUI_FieldDlg::StepTable : public QTableWidget +{ + Q_OBJECT + + int myDataType; + int myStepID; + int myStamp; + GEOM::GEOM_FieldStep_var myStep; + bool myIsChanged; + + QTableWidgetItem * newDefaultItem(); +public: + StepTable( int stepID, int dataType, int nbRows, int nbColumns, + QString shapeName, QStringList headers, + GEOM::GEOM_FieldStep_ptr stepVar, QWidget* = 0 ); + virtual ~StepTable(); + + QSize minimumSizeHint() const; + + void setEditable( bool, int, int ); + bool isEditable( int, int ) const; + + void setReadOnly( bool ); + bool isReadOnly() const; + + void insertRows( int, int = 1 ); + QString text( int, int ); + + QList selectedRows(); + void selectRows(const QList& rows); + + void setDim( int nbRows, QString shapeName, bool setDefault=true ); + void setNbComps( int nbComps ); + void setDataType( int dataType ); + void setStamp( int stamp ) { myStamp = stamp; } + int getStamp() { return myStamp; } + int getStepID() { return myStepID; } + QStringList getHeaders(); + void setHeaders(const QStringList& headers); + GEOM::GEOM_FieldStep_var getStep() { return myStep; } + void setValues(GEOM::GEOM_FieldStep_var& step); +public slots: + void setIsChanged() { myIsChanged = true; } }; #endif -- 2.39.2