PDA

View Full Version : Found a bad bug in QTableWidget!



trallallero
27th October 2011, 10:34
Using a QTableWidget with the following properties:
selectionMode: SingleSelection
selectionBehaviour : SelectItems

uname -a:

Linux 2.6.32-34-generic #77-Ubuntu SMP Tue Sep 13 19:40:53 UTC 2011 i686 GNU/Linux
Ubuntu 10.04

In the itemSelectionChanged() slot I print the currentRow().

Then I do the following:
- click on a cell of the first row keeping the mouse button pressed - currentRow is 0 (OK)
- move the mouse without releasing the button on the next row - currentRow is 0 (KO - should be 1)
- move the mouse without releasing the button on the next row - currentRow is 1 (KO - should be 2)
- move the mouse without releasing the button on the next row - currentRow is 2 (KO - should be 3)
and so on...

The first movement of the mouse, selecting the next row, doesn't update the currentRow.
All the next movements increment the currentRow but it's not synchronized as it has lost one value in the first movement.

d_stranz
27th October 2011, 17:52
Why do you think the current row should be changed when you are doing an extended or contiguous selection operation? A "current row" has no meaning when there are multiple rows selected.

The initial row you clicked on is the current row and will probably remain the current row until you click somewhere else. In your selection changed slot, it is telling you that the selection has changed, not the current row.

trallallero
7th December 2012, 14:54
4.8.3 and it's still there!

@d_stranz: sorry I didn't reply, I forgot to subscribe to the thread (it should be the default choice).
How is it possible that you don't see the bug ? have you tried to replicate it ?
it's not only a bug for the developer but also for the final user!
You click line 1 that is highlighted then, keeping pressed the mouse button, you move to line 2 and release the mouse.
In the following tables, only the second line of the first table has 3 lines displayed in the second table (1, 2 and 3).
This should be the correct result:

8488


But this is what the user sees (wrong as line 2 has 3 entries on the second table):

8489


Then, if the user clicks on the first line and moves the mouse (keeping the button pressed) till the 3rd line, this is what he sees (wrong as line 3 has no entries on the second table):

8490