From: imn Date: Mon, 7 Dec 2015 13:30:32 +0000 (+0300) Subject: Fix pb. with Object Browser X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a950a8e1fde8203e9d1a6cd00fb811238dea4245;p=modules%2Fgui.git Fix pb. with Object Browser --- diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index e6cd32fdb..2753ac368 100755 --- a/src/SUIT/SUIT_TreeModel.cxx +++ b/src/SUIT/SUIT_TreeModel.cxx @@ -500,6 +500,9 @@ SUIT_TreeModel::~SUIT_TreeModel() void SUIT_TreeModel::registerColumn( const int group_id, const QString& name, const int custom_id ) { bool found = false; +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + beginResetModel(); +#endif for ( int i=0, n=myColumns.size(); i= QT_VERSION_CHECK(4, 6, 0) + endResetModel(); +#else reset(); #endif } @@ -535,12 +540,17 @@ void SUIT_TreeModel::registerColumn( const int group_id, const QString& name, co void SUIT_TreeModel::unregisterColumn( const int group_id, const QString& name ) { for ( int i = 0, n = myColumns.size(); i < n; i++ ) { +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + beginResetModel(); +#endif if ( myColumns[i].myName == name ) { myColumns[i].myIds.remove( group_id ); if ( myColumns[i].myIds.isEmpty() ) { - myColumns.remove( i ); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - reset(); + myColumns.remove( i ); +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + endResetModel(); +#else + reset(); #endif } break; @@ -751,6 +761,10 @@ void SUIT_TreeModel::setRoot( SUIT_DataObject* r ) if ( root() == r ) return; +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + beginResetModel(); +#endif + if ( autoDeleteTree() ) { SUIT_DataObject::disconnect( SIGNAL( inserted( SUIT_DataObject*, SUIT_DataObject* ) ), this, SLOT( onInserted( SUIT_DataObject*, SUIT_DataObject* ) ) ); @@ -770,7 +784,9 @@ void SUIT_TreeModel::setRoot( SUIT_DataObject* r ) myRoot = r; //initialize(); -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + endResetModel(); +#else reset(); #endif emit modelUpdated();