- //RKV: TODO: Uncomment for drag and drop
- //RKV: SUIT_ProxyModel* proxyModel = dynamic_cast<SUIT_ProxyModel*>(treeModel);
- //RKV: if ( proxyModel ) {
- //RKV: connect( proxyModel, SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
- //RKV: theModule->getApp(), SLOT( onDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
- //RKV: }
+ SUIT_ProxyModel* proxyModel = dynamic_cast<SUIT_ProxyModel*>(treeModel);
+ if ( proxyModel ) {
+ 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() ) );
+ }
+ }
+ }
+ }