should now also connect to (and disconnect from) the rowsAboutToBeMoved and
rowsMoved signals.
+* The default value of the property QSortFilterProxyModel::dynamicSortFilter was
+ changed from false to true.
+
QtGui
-----
* Accessibility has been refactored. The hierachy of accessible objects is implemented via
proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(table);
- proxyModel->setDynamicSortFilter(true);
-
+
QTableView *tableView = new QTableView;
tableView->setModel(proxyModel);
tableView->setSortingEnabled(true);
Window::Window()
{
proxyModel = new QSortFilterProxyModel;
- proxyModel->setDynamicSortFilter(true);
sourceView = new QTreeView;
sourceView->setRootIsDecorated(false);
Window::Window()
{
proxyModel = new MySortFilterProxyModel(this);
- proxyModel->setDynamicSortFilter(true);
//! [0]
//! [1]
or vice versa, use mapToSource(), mapFromSource(), mapSelectionToSource(),
and mapSelectionFromSource().
- \note By default, the model does not dynamically re-sort and re-filter data
+ \note By default, the model dynamically re-sorts and re-filters data
whenever the original model changes. This behavior can be changed by
setting the \l{QSortFilterProxyModel::dynamicSortFilter}{dynamicSortFilter}
property.
d->sort_localeaware = false;
d->filter_column = 0;
d->filter_role = Qt::DisplayRole;
- d->dynamic_sortfilter = false;
+ d->dynamic_sortfilter = true;
connect(this, SIGNAL(modelReset()), this, SLOT(_q_clearMapping()));
}
call \l{QSortFilterProxyModel::}{sort()} after adding items to the
QComboBox.
- The default value is false.
+ The default value is true.
*/
bool QSortFilterProxyModel::dynamicSortFilter() const
{
const QStringList initial = QString("bateau avion dragon hirondelle flamme camion elephant").split(" ");
model1.setStringList(initial);
QSortFilterProxyModel proxy1;
+ proxy1.setDynamicSortFilter(false);
proxy1.sort(0);
proxy1.setSourceModel(&model1);
//set up the sorting before seting the model up
QSortFilterProxyModel proxy2;
- proxy2.setDynamicSortFilter(true);
proxy2.sort(0);
proxy2.setSourceModel(&model2);
for (int row = 0; row < proxy2.rowCount(QModelIndex()); ++row) {
QStandardItemModel *standardItemModel = new QStandardItemModel;
model->setSourceModel(standardItemModel);
populateTestArea(model);
- model->setFilterRegExp(QRegExp("(^$|0.*)"));
+ model->setFilterRegExp(QRegExp("(^$|I.*)"));
return model;
}