QTableWidget::itemSelectionChanged
-
call currentrow in the slot for itemSelectionChanged
-
it will be different depending if you click or click and drag.
btw Qt version is the awful 5.11.1 that completely broke the nativeevent message
-
@Megamouse
Hi
Tried withvoid MainWindow::on_listWidget_itemSelectionChanged() { ui->label->setText( QString::number(ui->listWidget->currentRow()) ); }
and it follows fine. So not sure why you see different results.
(also using 5.11.1)- 5.11.1 that completely broke the nativeevent message
in what way ?
- 5.11.1 that completely broke the nativeevent message
-
Can you send me the sample you use?
For the nativeevent:
Apparently it is already fixed for Qt 5.11.2.
But to explain:
One of the devs added a copy pasta mistake and now we need to cast the nativeEvent messages like this for Qt 5.11.1:#if (QT_VERSION == QT_VERSION_CHECK(5, 11, 1)) MSG* msg = *reinterpret_cast<MSG**>(message); #else MSG* msg = reinterpret_cast<MSG*>(message); #endif
For some programs this breaks the whole application
-
@Megamouse
ofc but its just default gui project with ListWidget
https://www.dropbox.com/s/y6dxx17dd6mc1cd/untitled68.zip?dl=0oh, i see. type was changed to **
Well good they fixed it so fast :) -
in the second half you can see what i mean
-
@Megamouse
Ah, yes, now i can do it too.
Holding left and rapid move up and down seems to lag behind one.
Funny enough the signal is correct. (right side)
Seems to be the order of signals.
As if i make a buttonvoid MainWindow::on_pushButton_released() { ui->label->setText( QString::number(ui->listWidget->currentRow()) ); }
and then ask it, its correct.
so it seems when in itemSelectionChanged and not released the left buttons, its
not updated yet. -
exactly. and in my opinion that's missing in the documentation.
or even wrong in general -
@Megamouse
Well it might be border case and hence the slightly odd behavior.
Since we are using SingleSelection, the dragging is really not needed as user
can just click on the one he wants. -
Well.
I use the selection as a direct visual indication.
Meaning if you change the list object the view will show corresponding data on another table.So if i were to use currentrow in this case the data would be wrong.
-
Well did you try the signal for that. seems to be correct even
when ui->listWidget->currentRow() is off. ? -
don't worry about it. It's fixed anyway. I just think it's a weird glitch or "feature"
-
indeed it is.
-
@Megamouse
native events!
How did you find it? where they announced something like that?
but thank you ... you saved my life ;) -
@HojjatJafary It was on a hunch. After searching for native event problems for a while, I found an issue on the Qt issue tracker in which the solution to the bug was shared in the comment section.
-
Can you share the link to the bug report ?
-
I believe it's https://bugreports.qt.io/browse/QTBUG-69074
-
@SGaist sorry I wasn't on this forum in a while. But Sergio's link is correct