Project

General

Profile

Actions

Bug #14285

closed
KD RM

getItemFromIndex returns the wrong item

Bug #14285: getItemFromIndex returns the wrong item

Added by Korneel Dumon 8 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
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

RM Updated by Romain Mardulyn 8 months ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn

RM Updated by Romain Mardulyn 8 months ago Actions #2

  • Target version set to 4.12.3

RM Updated by Romain Mardulyn 8 months ago Actions #3

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

MV Updated by Matthias Van Ceulebroeck 8 months ago Actions #4

  • Assignee set to Matthias Van Ceulebroeck

RM Updated by Romain Mardulyn 8 months ago Actions #5

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Matthias Van Ceulebroeck to Romain Mardulyn

RM Updated by Romain Mardulyn 8 months ago Actions #6

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: PDF Atom