Hi all,
I am using a model/view/delegate and I subclass QTableView to reimplement keyPressEvent(QKeyEvent *event) to catch ctrl-c and ctrl-v. I use the clipboard to copy the text at the currentIndex() and paste the results with model->setData(..). The method looks like this:
The problem I'm having is that pasting text into a table-cell does not occur unless I use the Shift key also [CTRL-Shift-P].Code:
{ if (event->key() == Qt::Key_C && event->modifiers() & Qt::ControlModifier) { } else if (event->modifiers() & Qt::ControlModifier && event->key() == Qt::Key_P) { } else { } }
Any ideas what might be causing this?
Added code tags/e8johan