diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2010-11-23 14:31:12 (GMT) |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2010-11-23 14:31:32 (GMT) |
commit | 88dd7568fff419510a7c26ffb93d93cc276d7b3b (patch) | |
tree | b0839add85cec60827890fd5e72e253d438e2912 /src | |
parent | ea84d7431810951aff2d6f85dca5f4ae4aeb4490 (diff) | |
download | Qt-88dd7568fff419510a7c26ffb93d93cc276d7b3b.zip Qt-88dd7568fff419510a7c26ffb93d93cc276d7b3b.tar.gz Qt-88dd7568fff419510a7c26ffb93d93cc276d7b3b.tar.bz2 |
Fix filtering of columns in QSFPM.
Fixes a crash introduced in 315c09c3873f7c5d8b785443372bf975bae47ee7
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: Olivier
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/itemviews/qsortfilterproxymodel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index dc8d938..0d9819e 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -782,14 +782,14 @@ void QSortFilterProxyModelPrivate::source_items_inserted( if (orthogonal_source_to_proxy.isEmpty()) { const int ortho_end = (orient == Qt::Horizontal) ? model->rowCount(source_parent) : model->columnCount(source_parent); + orthogonal_source_to_proxy.resize(ortho_end); + for (int ortho_item = 0; ortho_item < ortho_end; ++ortho_item) { if ((orient == Qt::Horizontal) ? q->filterAcceptsRow(ortho_item, source_parent) : q->filterAcceptsColumn(ortho_item, source_parent)) { orthogonal_proxy_to_source.append(ortho_item); } } - orthogonal_source_to_proxy.resize(orthogonal_proxy_to_source.size()); - if (orient == Qt::Horizontal) { // We're reacting to columnsInserted, but we've just inserted new rows. Sort them. sort_source_rows(orthogonal_proxy_to_source, source_parent); |