[Digikam-devel] [Bug 201717] Changing rating filter when images are selected, select all images between first and last selected image

Marcel Wiesweg marcel.wiesweg at gmx.de
Tue Jul 28 21:07:23 BST 2009


https://bugs.kde.org/show_bug.cgi?id=201717





--- Comment #2 from Marcel Wiesweg <marcel wiesweg gmx de>  2009-07-28 22:07:22 ---
This is indeep a Qt problem. See this code from QItemSelectionModel:

void QItemSelectionModelPrivate::_q_layoutAboutToBeChanged()
{
    savedPersistentIndexes.clear();
    savedPersistentCurrentIndexes.clear();

    // special case for when all indexes are selected
    if (ranges.isEmpty() && currentSelection.count() == 1) {
        QItemSelectionRange range = currentSelection.first();
        QModelIndex parent = range.parent();
        if (range.top() == 0
            && range.left() == 0
            && range.bottom() == model->rowCount(parent) - 1
            && range.right() == model->columnCount(parent) - 1) {
            tableSelected = true;
            tableParent = parent;
            tableColCount = model->columnCount(parent);
            tableRowCount = model->rowCount(parent);
            return;
        }
    }
...
}

void QItemSelectionModelPrivate::_q_layoutChanged()
{
    // special case for when all indexes are selected
    if (tableSelected && tableColCount == model->columnCount(tableParent)
        && tableRowCount == model->rowCount(tableParent)) {
        ...
    }

    if (savedPersistentCurrentIndexes.isEmpty() &&
savedPersistentIndexes.isEmpty()) {
        // either the selection was actually empty, or we
        // didn't get the layoutAboutToBeChanged() signal
        return;
    }
...
}

The "special case" is hit in the first method when storing the indexes. In the
second method for restoring the selection, the special case is not met, and no
indexes have been saved in the savedPersistentIndexes list.

1) For what purpose is this special case added?
2) File a Qt bug?

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list