Hi JP-N,
I am trying a similar thing with the Escape key in a QTableView. I am using the QShortcut, tied to the qtableview and then connecting the activated signal.
What happens is that it works fine as long as I am not editing a row in the qtableview, if data entry is occurring in the table, the first "Esc" key sequence resets the table to the pre-edit state, and the second and subsequent presses catch fine.
My question is how can I intercept the first ESC key sequence, utilizing the QShortcut?
connect(keyEsc,SIGNAL(activated()),this,SLOT(ESCPressed_tblview()));
keyEsc = new QShortcut(QKeySequence(Qt::Key_Escape),ui->tableView);
connect(keyEsc,SIGNAL(activated()),this,SLOT(ESCPressed_tblview()));
To copy to clipboard, switch view to plain text mode
Thanks,
AlphaWolfXV
Bookmarks