From: asl Date: Thu, 14 Feb 2008 13:00:44 +0000 (+0000) Subject: the modification time should be updated on model update X-Git-Tag: V5_0_0a1~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=178bbf17fb45aec5a4cac61d195a9901e7bd7186;p=modules%2Fgui.git the modification time should be updated on model update --- diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index 48f486896..12dc98e56 100755 --- a/src/SUIT/SUIT_TreeModel.cxx +++ b/src/SUIT/SUIT_TreeModel.cxx @@ -482,6 +482,7 @@ void SUIT_TreeModel::setRoot( SUIT_DataObject* r ) //initialize(); reset(); + emit modelUpdated(); } /*! @@ -917,6 +918,7 @@ void SUIT_TreeModel::updateTree( SUIT_DataObject* obj ) synchronize( obj, treeItem( obj ), SUIT_TreeModel::TreeSync( this ) ); + emit modelUpdated(); } /*! @@ -1117,7 +1119,9 @@ SUIT_ProxyModel::SUIT_ProxyModel( QObject* parent ) : QSortFilterProxyModel( parent ), mySortingEnabled( true ) { - setSourceModel( new SUIT_TreeModel( this ) ); + SUIT_TreeModel* model = new SUIT_TreeModel( this ); + connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) ); + setSourceModel( model ); } /*! @@ -1129,7 +1133,9 @@ SUIT_ProxyModel::SUIT_ProxyModel( SUIT_DataObject* root, QObject* parent ) : QSortFilterProxyModel( parent ), mySortingEnabled( true ) { - setSourceModel( new SUIT_TreeModel( root, this ) ); + SUIT_TreeModel* model = new SUIT_TreeModel( root, this ); + connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) ); + setSourceModel( model ); } /*! @@ -1141,6 +1147,7 @@ SUIT_ProxyModel::SUIT_ProxyModel( SUIT_TreeModel* model, QObject* parent ) : QSortFilterProxyModel( parent ), mySortingEnabled( true ) { + connect( model, SIGNAL( modelUpdated() ), this, SIGNAL( modelUpdated() ) ); setSourceModel( model ); } diff --git a/src/SUIT/SUIT_TreeModel.h b/src/SUIT/SUIT_TreeModel.h index 89ca777e2..74e593dfb 100755 --- a/src/SUIT/SUIT_TreeModel.h +++ b/src/SUIT/SUIT_TreeModel.h @@ -108,6 +108,9 @@ public slots: virtual void updateTree( const QModelIndex& ); virtual void updateTree( SUIT_DataObject* = 0 ); +signals: + void modelUpdated(); + private: void initialize(); @@ -169,6 +172,9 @@ public slots: virtual void updateTree( SUIT_DataObject* = 0 ); void setSortingEnabled( bool ); +signals: + void modelUpdated(); + protected: virtual bool lessThan( const QModelIndex&, const QModelIndex& ) const;