Project

General

Profile

Actions

Bug #14285

open

getItemFromIndex returns the wrong item

Added by Korneel Dumon 10 days ago. Updated 8 days ago.

Status:
Review
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
01/30/2026
Due date:
% Done:

0%

Estimated time:

Description

See the screenshot. There is an inconsistency between parent, index and c: index has row 2 but c has row 0.

This happened while using something like this:

    void setUp() {
        model = new WStandardItemModel();
        model.insertRows(0, 4);
        child1Index = model.getIndex(0, 0);
        model.insertRows(0, 3,child1Index);
        child2Index = model.getIndex(2, 0);
        model.insertRows(0, 2, child2Index);
        grandchildIndex = model.getIndex(1, 0, child1Index);
        model.insertRows(0, 2, grandchildIndex);
        iterator = new TreeModelIterator(model);

    }

I managed to work around it by initializing the model with actual WStandardItem objects.


Files

Actions #1

Updated by Romain Mardulyn 8 days ago

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn
Actions #2

Updated by Romain Mardulyn 8 days ago

  • Target version set to 4.12.3
Actions #3

Updated by Romain Mardulyn 8 days ago

  • Status changed from InProgress to Review
  • Assignee deleted (Romain Mardulyn)
Actions

Also available in: Atom PDF