{
SUIT_ResourceMgr* resMgr = theModule->getApp()->resourceMgr();
+ if ( ( !theRoot ) && theModule )
+ {
+ // Initialize the root with the module data model
+ setRoot( new CAM_ModuleObject( theModule->dataModel(), NULL ) );
+ }
+
setSortMenuEnabled( true );
setAutoUpdate( true );
+ setUpdateModified( true );
if ( resMgr->hasValue( "ObjectBrowser", "auto_hide_search_tool" ) )
searchTool()->enableAutoHide( resMgr->booleanValue( "ObjectBrowser", "auto_hide_search_tool" ) );
QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
QString RefObjCol = tr( "REF_OBJECT_COLUMN" );
QString BathymetryCol = tr( "BATHYMETRY_COLUMN" );
+
SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( model() );
//RKV: treeModel->setSearcher( theModule->getApp() );
treeModel->setSearcher( this ); //RKV
connect( proxyModel,
SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
+
+ //// Connect signal emitted after editing for updating after objects renaming
+ SUIT_TreeModel* aMiniModel = dynamic_cast<SUIT_TreeModel*>( proxyModel->sourceModel() );
+ if ( aMiniModel )
+ {
+ connect( aMiniModel, SIGNAL( dataChanged( const QModelIndex &, const QModelIndex & ) ),
+ SIGNAL( dataChanged() ) );
+ }
+
+ // Do updating also in the module's main object browser.
+ if ( theModule )
+ {
+ SUIT_DataBrowser* aModulBrowser = theModule->getApp()->objectBrowser();
+ if ( aModulBrowser )
+ {
+ SUIT_ProxyModel* aPModel = dynamic_cast<SUIT_ProxyModel*>(aModulBrowser->model());
+ if ( aPModel )
+ {
+ SUIT_TreeModel* aModel = dynamic_cast<SUIT_TreeModel*>(aPModel->sourceModel());
+ //connect( proxyModel, SIGNAL( dataChanged( const QModelIndex &, const QModelIndex & ) ),
+ // aPModel, SIGNAL( dataChanged( const QModelIndex &, const QModelIndex & ) ) );
+ //connect( proxyModel, SIGNAL( dataChanged( const QModelIndex &, const QModelIndex & ) ),
+ // aModel, SIGNAL( dataChanged( const QModelIndex &, const QModelIndex & ) ) );
+ connect( proxyModel, SIGNAL( modelUpdated() ), aModel, SIGNAL( modelUpdated() ) );
+ }
+ }
+ }
}
// temporary commented