X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=tools%2FDFBrowserPane%2FDFBrowserPane_AttributePaneModel.hxx;h=047ea67d21fd6d0807cc4afd24a400f20c21a230;hb=d2c909178edea381a99889edd7d75b57f4cdf4d3;hpb=434098193aa1f747c50d2a0a709f85c6fe3c8b40 diff --git a/tools/DFBrowserPane/DFBrowserPane_AttributePaneModel.hxx b/tools/DFBrowserPane/DFBrowserPane_AttributePaneModel.hxx index 8177df3fc8..047ea67d21 100644 --- a/tools/DFBrowserPane/DFBrowserPane_AttributePaneModel.hxx +++ b/tools/DFBrowserPane/DFBrowserPane_AttributePaneModel.hxx @@ -46,35 +46,53 @@ public: //! \param theOrientation if horizontal, the values are applyed by rows, otherwise by columns void SetOrientation (const Qt::Orientation& theOrientation) { myOrientation = theOrientation; } + //! Returns table orientation for setting data values + //! \return thye current orientation + Qt::Orientation GetOrientation() const { return myOrientation; } + //! Sets number of columns //! \param theColumnCount a column count void SetColumnCount (const int theColumnCount) { myColumnCount = theColumnCount; } //! Fills the model with the values. Store the values in a cache. //! \param theValues a container of values - Standard_EXPORT void Init(const QList& theValues); + Standard_EXPORT void Init (const QList& theValues); //! Fills the model header values for orientation. //! \param theValues a container of header text values //! \param theOrientation an orientation of header - Standard_EXPORT void SetHeaderValues(const QList& theValues, Qt::Orientation theOrientation); + Standard_EXPORT void SetHeaderValues (const QList& theValues, Qt::Orientation theOrientation); + + //! Returns header values for orientation. + //! \param theValues a container of header text values + //! \param theOrientation an orientation of header + const QList& HeaderValues (Qt::Orientation theOrientation) + { return theOrientation == Qt::Horizontal ? myHorizontalHeaderValues : myVerticalHeaderValues; } + + //! Returns indices of italic columns + //! \return indices of columns + const QList& GetItalicColumns() const { return myItalicColumns; } + + //! Sets indices of italic columns + //! \param theValues indices of columns + void SetItalicColumns (const QList& theValues) { myItalicColumns = theValues; } //! Returns number of columns, depending on orientation: myColumnCount or size of values container //! \param theParent an index of the parent item //! \return an integer value - Standard_EXPORT virtual int columnCount(const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE; + Standard_EXPORT virtual int columnCount (const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE; //! Returns number of rows, depending on orientation: myColumnCount or size of values container //! \param theParent an index of the parent item //! \return an integer value - Standard_EXPORT virtual int rowCount(const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE; + Standard_EXPORT virtual int rowCount (const QModelIndex& theParent = QModelIndex()) const Standard_OVERRIDE; //! Returns content of the model index for the given role, it is obtained from internal container of values //! It returns value only for DisplayRole. //! \param theIndex a model index //! \param theRole a view role //! \return value intepreted depending on the given role - Standard_EXPORT virtual QVariant data(const QModelIndex& theIndex, int theRole = Qt::DisplayRole) const Standard_OVERRIDE; + Standard_EXPORT virtual QVariant data (const QModelIndex& theIndex, int theRole = Qt::DisplayRole) const Standard_OVERRIDE; //! Returns content of the model index for the given role, it is obtainer from internal container of header values //! It returns value only for DisplayRole. @@ -82,7 +100,7 @@ public: //! \param theIndex a model index //! \param theRole a view role //! \return value intepreted depending on the given role - Standard_EXPORT virtual QVariant headerData(int theSection, Qt::Orientation theOrientation, int theRole = Qt::DisplayRole) const Standard_OVERRIDE; + Standard_EXPORT virtual QVariant headerData (int theSection, Qt::Orientation theOrientation, int theRole = Qt::DisplayRole) const Standard_OVERRIDE; //! Returns flags for the item: ItemIsEnabled | Qt::ItemIsSelectable //! \param theIndex a model index @@ -97,6 +115,8 @@ private: QMap< int, QList > myValuesMap; //!< container of values, filled in Init(), used in data() QList myHorizontalHeaderValues; //!< table horizontal header values QList myVerticalHeaderValues; //!< table vertical header values + QList myItalicColumns; //!< indices of columns that should be visualized in gray and italic + }; #endif