From 15ba1ff23c140849d3cac32a5005c352cd5a699f Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Wed, 15 Sep 2010 13:30:55 +0200 Subject: Doc: Note on updating proxy models with dynamic sort filters Task-number: QT-689 Reviewed-by: David Boddie --- src/gui/itemviews/qsortfilterproxymodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index 953a7f1..dc8d938 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -2230,6 +2230,14 @@ void QSortFilterProxyModel::setFilterFixedString(const QString &pattern) \brief whether the proxy model is dynamically sorted and filtered whenever the contents of the source model change + Note that you should not update the source model through the proxy + model when dynamicSortFilter is true. For instance, if you set the + proxy model on a QComboBox, then using functions that update the + model, e.g., \l{QComboBox::}{addItem()}, will not work as + expected. An alternative is to set dynamicSortFilter to false and + call \l{QSortFilterProxyModel::}{sort()} after adding items to the + QComboBox. + The default value is false. */ bool QSortFilterProxyModel::dynamicSortFilter() const -- cgit v0.12