-// Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
-#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_ListIO.hxx>
// Qt includes
#include <QGridLayout>
QTreeWidgetItem * headerItem = new QTreeWidgetItem( columnNames );
theTreeWidget->setHeaderItem ( headerItem );
theTreeWidget->header()->moveSection( 1, 0 );
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
theTreeWidget->header()->setClickable( true );
theTreeWidget->header()->setMovable( false );
theTreeWidget->header()->setResizeMode( 1, QHeaderView::ResizeToContents );
+#else
+ theTreeWidget->header()->setSectionsClickable( true );
+ theTreeWidget->header()->setSectionsMovable( false );
+ theTreeWidget->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
+#endif
theTreeWidget->setSelectionMode( QAbstractItemView::ExtendedSelection );
}
{
GEOMToolsGUI_TreeWidgetItem* item;
if( !theObject->IsMainShape() ) {
- GEOMToolsGUI_TreeWidgetItem* parentItem = addSubObject( theWidget, theObjects, theObject->GetMainShape() );
+ GEOM::GEOM_Object_var aMainShape = theObject->GetMainShape();
+ if ( CORBA::is_nil( aMainShape ) )
+ return NULL;
+ GEOMToolsGUI_TreeWidgetItem* parentItem = addSubObject( theWidget, theObjects, aMainShape );
item = findObjectInTree( theWidget, theObject );
if( !item )
item = new GEOMToolsGUI_TreeWidgetItem( parentItem, QStringList() << theObject->GetName(), theObject->GetStudyEntry() );
_PTR(SObject) obj ( myStudy->FindObjectID( theStudyEntry.c_str() ) );
if ( obj ) {
// remove visual properties of the object
- appStudy->removeObjectFromAll(obj->GetID().c_str());
+ appStudy->removeObjectProperties(obj->GetID().c_str());
// remove references to this object
appStudy->deleteReferencesTo( obj );
// remove objects from study