X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FHYDROGUI%2FHYDROGUI_StricklerTableDlg.h;h=11704db432d2c253edc8ce99ee5509c53326df41;hb=60c1b803621af637e863bf91a54f59251a28552c;hp=0fa872b2d18fd1e27e35e48b70b5af70031a28bd;hpb=f9bd5128a1aed8c1974b1d1cfb87aff32191fa60;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h index 0fa872b2..11704db4 100644 --- a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h +++ b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h @@ -20,6 +20,8 @@ #define HYDROGUI_STRICKLERTABLEDLG_H #include "HYDROGUI_InputPanel.h" +#include +#include class HYDROData_StricklerTable; @@ -34,17 +36,6 @@ class HYDROGUI_StricklerTableDlg : public HYDROGUI_InputPanel Q_OBJECT public: - struct StricklerCoefficient - { - QString myType; - double myCoefficient; - - StricklerCoefficient( const QString& theType, - double theCoefficient ) - : myType( theType ), myCoefficient( theCoefficient ) {} - }; - typedef QList StricklerCoefficientList; - enum { Edit, Import, Export }; public: @@ -62,8 +53,8 @@ public: bool isTableNameReadOnly() const; void setTableNameReadOnly( bool ); - StricklerCoefficientList getData() const; - void setData(const StricklerCoefficientList& theData); + void getGuiData( Handle(HYDROData_StricklerTable)& theTable ) const; + void setGuiData( const Handle(HYDROData_StricklerTable)& theTable ); protected: void updateControls(); @@ -82,13 +73,38 @@ Q_SIGNALS: void fileSelected( const QString& theFileName ); private: - int myType; - QLineEdit* myFileName; //!< Source Strickler table file name input field - QLineEdit* myName; //!< The Strickler table name input field - QTableWidget* myTable; //!< The table of Strickler coefficients - QToolButton* myAddBtn; //!< The add Strickler coefficient button - QToolButton* myRemoveBtn; //!< The remove Strickler coefficient button - QToolButton* myClearBtn; //!< The clear all Strickler coefficients button + friend class test_HYDROData_StricklerTable; + +private: + int myType; + QLineEdit* myFileName; //!< Source Strickler table file name input field + QLineEdit* myName; //!< The Strickler table name input field + QLineEdit* myAttrName; //!< The Strickler table attribute's name input field + QTableWidget* myTable; //!< The table of Strickler coefficients + QToolButton* myAddBtn; //!< The add Strickler coefficient button + QToolButton* myRemoveBtn; //!< The remove Strickler coefficient button + QToolButton* myClearBtn; //!< The clear all Strickler coefficients button +}; + +class HYDROGUI_ColorDelegate : public QAbstractItemDelegate +{ +public: + HYDROGUI_ColorDelegate( QWidget* theParent ); + virtual ~HYDROGUI_ColorDelegate(); + + virtual void paint( QPainter* thePainter, const QStyleOptionViewItem& theOption, + const QModelIndex& theIndex ) const; + + virtual QWidget* createEditor( QWidget* theParent, + const QStyleOptionViewItem& theOption, + const QModelIndex& theIndex ) const; + + virtual void setEditorData( QWidget* theEditor, const QModelIndex& theIndex ) const; + + virtual void setModelData( QWidget* theEditor, QAbstractItemModel* theModel, + const QModelIndex& theIndex ) const; + + virtual QSize sizeHint( const QStyleOptionViewItem& theOption, const QModelIndex& theIndex ) const; }; #endif