[Gambas-user] TreeView.Count value differs using qt rather than gtk

Kadaitcha Man nospam.nospam.nospam at ...626...
Tue Jan 26 10:44:41 CET 2010


2010/1/26 Doriano Blengino <doriano.blengino at ...1909...>:

> Actually I expressed myself badly. Example:

Actually, I express myself badly quite often. Example:

[CENSORED] [CENSORED] [CENSORED] [CENSORED]!

:)

As for this:

[QUOTE]
Tree1:
 - item0
 - item1
   - item1.0

Tree1.count is  3      (global count)
[QUOTE]

Unless you expressed yourself badly again I disagree. :)

The count is one. One root. One tree.

tv["Tree1"].Count < -- count of immediate descendants (child nodes)
below Tree1, which is 2. One for each child, item0 and item1.

Your count includes children and grandchildren. Each node, should only
ever report its direct 1st level ascendants, not any subsequent
generation nodes.

therefore, from your example:

tv["Tree1"].Count = 2
tv["Item0"].Count = 0
tv["Tree1"].Count = 1

and...

tv.Count = 1 <-- Tree1, the one and only root node.

The point is, the count changes based on what node you are looking at.
The count should always, ever, without fail, report only the count of
its children, never later descendants.

So, given this tree:

ZZZZ
AAAA
 - BBBB
 - CCCC
 - DDDD
   - EEEE
    - FFFFF

The count at root is 2, AAAA and ZZZZ.

The count at ZZZZ is 0, no children.

The count at AAAA is 3, with BBBB, CCCC, and DDDD being children.

The count at BBBB and CCCC is 0.

The count at DDDD is 1.

The count at EEEE is 1, with FFFF being the only child.

The count at FFFF is?

Zero.




More information about the User mailing list