I have a table made with QTableView and at it's creation I select the first row, it works, the issue is that the selected row is inactive,meaning I cannot navigate with direction keys through the rows until I click on one.
I also have a signal which is emited when I press the return key, which if I trigger it the signal will emit and after that if I press long on down key it starts to navigate.
I tried using
selectRow()
selectRow()
To copy to clipboard, switch view to plain text mode
,
setCurrentIndex()
setCurrentIndex()
To copy to clipboard, switch view to plain text mode
from inside the constructor,tried making a function which I trigger after the table was created, also tried using
QTimer::SingleShot()
To copy to clipboard, switch view to plain text mode
and even
setFocus()
setFocus()
To copy to clipboard, switch view to plain text mode
on table after it is constructed but still the selected row remains inactive.
Any thing else to try?
Finally figured out, I focused the wrong way. I had multiple widgets inside the widget that contain the table and instead of focusing on the table I focused on the widget that contains the table.
Bookmarks