adutzu89
30th January 2014, 13:47
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(),
setCurrentIndex() from inside the constructor,tried making a function which I trigger after the table was created, also tried using
QTimer::SingleShot() and even
setFocus() 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.
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(),
setCurrentIndex() from inside the constructor,tried making a function which I trigger after the table was created, also tried using
QTimer::SingleShot() and even
setFocus() 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.