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<n && !found; i++ ) {
if ( name == myColumns[i].myName ) {
myColumns[i].myIds.insert( group_id, custom_id );
int n = myColumns.size();
myColumns.resize( n+1 );
myColumns[n] = inf;
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ endResetModel();
+#else
reset();
#endif
}
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;
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* ) ) );
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();