From: san Date: Fri, 16 Sep 2011 05:29:10 +0000 (+0000) Subject: Method QtxPagePrefSelectItem::setIcons() was added. X-Git-Tag: V5_1_14~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=32d862f55dba87d779657425b248263119f992f0;p=modules%2Fgui.git Method QtxPagePrefSelectItem::setIcons() was added. --- diff --git a/src/Qtx/QtxPagePrefMgr.cxx b/src/Qtx/QtxPagePrefMgr.cxx index d7522d4de..27e8a9776 100644 --- a/src/Qtx/QtxPagePrefMgr.cxx +++ b/src/Qtx/QtxPagePrefMgr.cxx @@ -2325,7 +2325,7 @@ void QtxPagePrefSelectItem::setInputType( const int type ) /*! \brief Get the list of the values from the selection widget. \return list of values - \sa numbers(), setStrings() + \sa numbers(), icons(), setStrings() */ QStringList QtxPagePrefSelectItem::strings() const { @@ -2338,7 +2338,7 @@ QStringList QtxPagePrefSelectItem::strings() const /*! \brief Get the list of the values identifiers from the selection widget. \return list of values IDs - \sa strings(), setNumbers() + \sa strings(), icons(), setNumbers() */ QList QtxPagePrefSelectItem::numbers() const { @@ -2351,6 +2351,19 @@ QList QtxPagePrefSelectItem::numbers() const return res; } +/*! + \brief Get the list of the icons from the selection widget. + \return list of icons + \sa strings(), numbers(), setIcons() +*/ +QList QtxPagePrefSelectItem::icons() const +{ + QList res; + for ( uint i = 0; i < mySelector->count(); i++ ) + res.append( mySelector->itemIcon( i ) ); + return res; +} + /*! \brief Set the list of the values to the selection widget. \param lst new list of values @@ -2374,6 +2387,18 @@ void QtxPagePrefSelectItem::setNumbers( const QList& ids ) mySelector->setId( i, *it ); } +/*! + \brief Set the list of the icons to the selection widget. + \param lst new list of icons + \sa numbers(), strings(), setIcons() +*/ +void QtxPagePrefSelectItem::setIcons( const QList& icons ) +{ + uint i = 0; + for ( QList::const_iterator it = icons.begin(); it != icons.end() && i < mySelector->count(); ++it, i++ ) + mySelector->setItemIcon( i, *it ); +} + /*! \brief Store preference item to the resource manager. \sa retrieve() diff --git a/src/Qtx/QtxPagePrefMgr.h b/src/Qtx/QtxPagePrefMgr.h index c2b3bccea..2cb95bcb1 100644 --- a/src/Qtx/QtxPagePrefMgr.h +++ b/src/Qtx/QtxPagePrefMgr.h @@ -435,9 +435,11 @@ public: QStringList strings() const; QList numbers() const; + QList icons() const; void setStrings( const QStringList& ); void setNumbers( const QList& ); + void setIcons( const QList& ); virtual void store(); virtual void retrieve();