From c92f6efec3a1dbbc485efa4a6e543295d701c80c Mon Sep 17 00:00:00 2001 From: avo Date: Thu, 26 Dec 2013 06:10:32 +0000 Subject: [PATCH] added public updateItem( SUIT_DataObject* object) to update the item display without reloading the tree --- src/SUIT/SUIT_TreeModel.cxx | 10 ++++++++++ src/SUIT/SUIT_TreeModel.h | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) 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 ); -- 2.39.2