PDA

View Full Version : How to go to next cell using Return key on QTableView ?



Daikyo
7th March 2018, 16:27
Hello,

I have a QTableView and here is my expected workflow :
1. Select a cell and edit it
2. Press Return/Enter key to validate the changes (default Qt behavior)
3. The cell below the edited one should be the new current item, ready to be edited next

I found out how to go to the next cell using model::index and model::setCurrentIndex but I did not find out how to trigger that on Return/Enter key pressed !

Can you please help me ?
Thank you :)

A.Josh
9th March 2018, 12:09
Can you simply post the aspect of the code where you were able to navigate to a next cell?

Daikyo
9th March 2018, 13:25
Hello and thank you for your answers.
I successfully managed to do that using an eventFilter on the QTableView :)