]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix regression caused by introducing of GUI observers - Show/Hide children operation...
authorvsr <vsr@opencascade.com>
Fri, 25 Feb 2011 06:19:16 +0000 (06:19 +0000)
committervsr <vsr@opencascade.com>
Fri, 25 Feb 2011 06:19:16 +0000 (06:19 +0000)
src/SUIT/SUIT_DataObject.cxx
src/SUIT/SUIT_DataObject.h
src/SUIT/SUIT_TreeModel.cxx

index 36c8e5fd54d04e1ffa8ae493b02fa564e71d2f25..f8d8f23a957bfc8a9408431ca8a4b50c39504331 100755 (executable)
@@ -546,6 +546,11 @@ int SUIT_DataObject::alignment( const int /*id*/ ) const
   return Qt::AlignLeft;
 }
 
+bool SUIT_DataObject::expandable() const
+{
+  return true;
+}
+
 /*!
   \brief Check if the object is visible.
 
index bc6ee7bbc6f103415c109124e1a262b8c1bc695b..73792a5142b8fcb8e6d0ccb550499bddb1b56d15 100755 (executable)
@@ -113,6 +113,7 @@ public:
   virtual QFont               font( const int = NameId ) const;
   virtual int                 alignment( const int = NameId ) const;
 
+  virtual bool                expandable() const;
   virtual bool                isVisible() const;
   virtual bool                isDragable() const;
   virtual bool                isDropAccepted( SUIT_DataObject* obj );
index f4c3a999f31be659d94632c5e93002ec70610d85..ed11fbad8b92b93117249d767555a74bc59d4560 100755 (executable)
@@ -1500,10 +1500,12 @@ void SUIT_TreeModel::updateItem( SUIT_TreeModel::TreeItem* item )
     return;
   
   // update all columns corresponding to the given data object
+  emit layoutAboutToBeChanged();
   QModelIndex firstIdx = index( obj, 0 );
   QModelIndex lastIdx  = index( obj, columnCount() - 1 );
   emit dataChanged( firstIdx, lastIdx );
   obj->setModified(false);
+  emit layoutChanged();
 }
 
 /*!
@@ -1854,7 +1856,8 @@ SUIT_AbstractModel* SUIT_ProxyModel::treeModel() const
 bool SUIT_ProxyModel::filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const
 {
   SUIT_DataObject* o = treeModel()->object( sourceModel()->index( sourceRow, 0, sourceParent ) );
-  return o && o->isVisible();
+  SUIT_DataObject* p = o ? o->parent() : 0;
+  return ( !p || p->expandable() ) && o && o->isVisible();
 }
 
 /*!