From: asl Date: Thu, 14 Feb 2008 13:00:12 +0000 (+0000) Subject: the modification time is updated on model update X-Git-Tag: V5_0_0a1~41 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cb99c69f4b913f7e6ac6a4a02215124afd21bd58;p=modules%2Fgui.git the modification time is updated on model update --- diff --git a/src/SUIT/SUIT_DataBrowser.cxx b/src/SUIT/SUIT_DataBrowser.cxx index 32c92c013..43680d59b 100644 --- a/src/SUIT/SUIT_DataBrowser.cxx +++ b/src/SUIT/SUIT_DataBrowser.cxx @@ -255,7 +255,10 @@ void SUIT_DataBrowser::contextMenuEvent( QContextMenuEvent* e ) */ void SUIT_DataBrowser::init( SUIT_DataObject* root ) { - setModel( new SUIT_ProxyModel( root, this ) ); + SUIT_ProxyModel* m = new SUIT_ProxyModel( root, this ); + connect( m, SIGNAL( modelUpdated() ), this, SLOT( onModelUpdated() ) ); + + setModel( m ); setItemDelegate( qobject_cast( model() )->delegate() ); connect( treeView(), SIGNAL( sortingEnabled(bool ) ), model(), SLOT( setSortingEnabled( bool ) ) ); @@ -272,3 +275,13 @@ void SUIT_DataBrowser::init( SUIT_DataObject* root ) \sa updateKey(), setUpdateKey() */ + + + +/*! + \brief Update internal modification time just after data model update +*/ +void SUIT_DataBrowser::onModelUpdated() +{ + setModified(); +} diff --git a/src/SUIT/SUIT_DataBrowser.h b/src/SUIT/SUIT_DataBrowser.h index 25794a685..604574dd9 100644 --- a/src/SUIT/SUIT_DataBrowser.h +++ b/src/SUIT/SUIT_DataBrowser.h @@ -69,6 +69,9 @@ private: signals: void requestUpdate(); +private slots: + void onModelUpdated(); + private: QShortcut* myShortcut; };