m->setAutoUpdate( on );
}
+/*!
+ \brief Get 'auto-update layout tree' flag value.
+ \return 'auto-update layout tree' flag value
+ \sa setAutoUpdateLayout(), updateTree()
+*/
+bool SUIT_DataBrowser::autoUpdateLayout() const
+{
+ SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+ return m ? m->autoUpdateLayout() : false;
+}
+
+/*!
+ \brief Set 'auto-update layout tree' flag value.
+
+ If this flag is set to \c true (by default), the 'layoutChanged' signal is emitted
+ for each item update automatically.
+
+ \param on 'auto-update layout tree' flag value
+ \sa autoUpdateLayout(), updateTree()
+*/
+void SUIT_DataBrowser::setAutoUpdateLayout( const bool on )
+{
+ SUIT_ProxyModel* m = qobject_cast<SUIT_ProxyModel*>( model() );
+ if ( m )
+ m->setAutoUpdateLayout( on );
+}
+
/*!
\brief Get 'updateModified' flag value.
\return 'updateModified' flag value
myRootItem( 0 ),
myAutoDeleteTree( false ),
myAutoUpdate( true ),
+ myAutoUpdateLayout( true ),
myUpdateModified( false )
{
initialize();
myRootItem( 0 ),
myAutoDeleteTree( false ),
myAutoUpdate( true ),
+ myAutoUpdateLayout( true ),
myUpdateModified( false )
{
initialize();
return myAutoUpdate;
}
+/*!
+ \brief Get 'auto-update layout tree' flag value.
+ \return 'auto-update layout tree' flag value
+ \sa setAutoUpdateLayout(), updateItem()
+*/
+bool SUIT_TreeModel::autoUpdateLayout() const
+{
+ return myAutoUpdateLayout;
+}
+
/*!
\brief Set 'auto-update tree' flag value.
updateTree();
}
+
+}
+
+/*!
+ \brief Set 'auto-update layout tree' flag value.
+
+ If this flag is set to \c true (by default), the 'layoutChanged' signal is emitted
+ for each item update automatically.
+
+ \param on 'auto-update layout tree' flag value
+ \sa autoUpdateLayout(), updateItem()
+*/
+void SUIT_TreeModel::setAutoUpdateLayout( const bool on )
+{
+ if ( myAutoUpdateLayout == on )
+ return;
+
+ myAutoUpdateLayout = on;
+
+ if (myAutoUpdateLayout) {
+ emit layoutChanged();
+ }
}
/*!
QModelIndex lastIdx = index( obj, columnCount() - 1 );
emit dataChanged( firstIdx, lastIdx );
obj->setModified(false);
- emit layoutChanged();
+ if (myAutoUpdateLayout) { // MPV 12/03/2012: update whole layout for each item is bad for performance
+ emit layoutChanged();
+ }
}
/*!
return treeModel() ? treeModel()->autoUpdate() : false;
}
+/*!
+ \brief Get 'auto-update layout tree' flag value.
+ \return 'auto-update layout tree' flag value
+ \sa setAutoUpdateLayout(), updateItem()
+*/
+bool SUIT_ProxyModel::autoUpdateLayout() const
+{
+ return treeModel() ? treeModel()->autoUpdateLayout() : false;
+}
+
/*!
\brief Get 'updateModified' flag value.
\return 'updateModified' flag value
treeModel()->setAutoUpdate( on );
}
+/*!
+ \brief Set 'auto-update layout tree' flag value.
+
+ If this flag is set to \c true (by default), the 'layoutChanged' signal is emitted
+ for each item update automatically.
+
+ \param on 'auto-update layout tree' flag value
+ \sa autoUpdateLayout(), updateItem()
+*/
+void SUIT_ProxyModel::setAutoUpdateLayout( const bool on )
+{
+ if ( treeModel() )
+ treeModel()->setAutoUpdateLayout( on );
+}
+
/*!
\brief Check if sorting is enabled.
\return \c true if sorting is enabled
virtual void setAutoDeleteTree( const bool ) = 0;
virtual bool autoUpdate() const = 0;
virtual void setAutoUpdate( const bool ) = 0;
+ virtual bool autoUpdateLayout() const = 0;
+ virtual void setAutoUpdateLayout( const bool ) = 0;
virtual bool updateModified() const = 0;
virtual void setUpdateModified( const bool ) = 0;
virtual QAbstractItemDelegate* delegate() const = 0;
bool autoUpdate() const;
void setAutoUpdate( const bool );
+ bool autoUpdateLayout() const;
+ void setAutoUpdateLayout( const bool );
bool updateModified() const;
void setUpdateModified( const bool );
VisibilityMap myVisibilityMap;
bool myAutoDeleteTree;
bool myAutoUpdate;
+ bool myAutoUpdateLayout;
bool myUpdateModified;
QVector<ColumnInfo> myColumns;
bool autoUpdate() const;
void setAutoUpdate( const bool );
+ bool autoUpdateLayout() const;
+ void setAutoUpdateLayout( const bool );
bool updateModified() const;
void setUpdateModified( const bool );