#include <SUIT_Accel.h>
#include <SUIT_MessageBox.h>
#include <SUIT_ViewWindow.h>
+#include <SUIT_TreeModel.h>
#include <Qtx.h>
#include <QtxToolBar.h>
ob->setWindowTitle( tr( "OBJECT_BROWSER" ) );
connect( ob, SIGNAL( requestUpdate() ), this, SLOT( onRefresh() ) );
+ QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( ob->model() );
+ treeModel->registerColumn( 0, EntryCol, LightApp_DataObject::EntryId );
+ treeModel->setAppropriate( EntryCol, Qtx::Toggled );
+
// temporary commented
/*
OB_ListView* ob_list = dynamic_cast<OB_ListView*>( const_cast<QListView*>( ob->listView() ) );
if ( mySwitchOp == 0 )
mySwitchOp = new LightApp_SwitchOp( this );
+ /* BUG 0020498 : The Entry column is always shown at module activation
+ The registration of column is moved into LightApp_Application
+
QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
if( m )
SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( getApp()->objectBrowser()->model() );
m->registerColumn( getApp()->objectBrowser(), EntryCol, LightApp_DataObject::EntryId );
treeModel->setAppropriate( EntryCol, Qtx::Toggled );
- }
+ }*/
return res;
}
anIt.value()->abort();
}
+ /* BUG 0020498 : The Entry column is always shown at module activation
QString EntryCol = QObject::tr( "ENTRY_COLUMN" );
LightApp_DataModel* m = dynamic_cast<LightApp_DataModel*>( dataModel() );
if( m )
treeModel->setAppropriate( EntryCol, Qtx::Shown );
m->unregisterColumn( getApp()->objectBrowser(), EntryCol );
}
+ */
return CAM_Module::deactivateModule( study );
}
void SUIT_TreeModel::setAppropriate( const QString& name, const Qtx::Appropriate appr )
{
for( int i=0, n=myColumns.size(); i<n; i++ )
- if( myColumns[i].myName==name )
- {
- myColumns[i].myAppropriate = appr;
- emit headerDataChanged( Qt::Horizontal, i, i );
- break;
- }
+ if( myColumns[i].myName==name || myColumns[i].myAppropriate != appr )
+ {
+ myColumns[i].myAppropriate = appr;
+ emit headerDataChanged( Qt::Horizontal, i, i );
+ break;
+ }
}
/*!