From: avo Date: Thu, 26 Dec 2013 06:10:32 +0000 (+0000) Subject: added public updateItem( SUIT_DataObject* object) to update the item display without... X-Git-Tag: PLEX_0_1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c92f6efec3a1dbbc485efa4a6e543295d701c80c;p=modules%2Fgui.git added public updateItem( SUIT_DataObject* object) to update the item display without reloading the tree --- diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index 95ccb9e6b..e8e38e179 100755 --- a/src/SUIT/SUIT_TreeModel.cxx +++ b/src/SUIT/SUIT_TreeModel.cxx @@ -1230,6 +1230,16 @@ void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item ) emit dataChanged( firstIdx, lastIdx ); } +void SUIT_TreeModel::updateItem( SUIT_DataObject* obj) +{ + if(obj) + { + QModelIndex firstIdx = index( obj, 0 ); + QModelIndex lastIdx = index( obj, columnCount() - 1 ); + emit dataChanged( firstIdx, lastIdx ); + } +} + /*! \brief Remove tree item (recursively). \param item tree item to be removed diff --git a/src/SUIT/SUIT_TreeModel.h b/src/SUIT/SUIT_TreeModel.h index 9d1d7a0cb..94d336091 100755 --- a/src/SUIT/SUIT_TreeModel.h +++ b/src/SUIT/SUIT_TreeModel.h @@ -151,7 +151,9 @@ public: int row, int column, const QModelIndex& parent ); bool getObjects( const QMimeData* data, QList& ) const; void setDropAccepted( const bool ); - + + void updateItem( SUIT_DataObject* object); + public slots: virtual void updateTree( const QModelIndex& ); virtual void updateTree( SUIT_DataObject* = 0 );