]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
the modification time should be updated on model update
authorasl <asl@opencascade.com>
Thu, 14 Feb 2008 13:00:44 +0000 (13:00 +0000)
committerasl <asl@opencascade.com>
Thu, 14 Feb 2008 13:00:44 +0000 (13:00 +0000)
src/SUIT/SUIT_TreeModel.cxx
src/SUIT/SUIT_TreeModel.h

index 48f486896c0f87b0dbe6aa23b76c5793eb4c08cd..12dc98e56a241d029bafaab2df97f1ef6a8cd614 100755 (executable)
@@ -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<ObjPtr,ItemPtr,SUIT_TreeModel::TreeSync>( 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 );
 }
 
index 89ca777e26c7ac4f6bb6d65c4cb1313fc4f3e091..74e593dfbbd080e3b14700b96177b73b58c75ce4 100755 (executable)
@@ -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;