Use a QShortcut, connect the activated() signal to a slot, and call the view's edit() slot. Something like:
{
Q_OBJECT
public:
connect(s, SIGNAL(activated()), SLOT(editActivated()));
}
private slots:
void editActivated() {
edit(currentIndex());
}
};
class Table: public QTableView
{
Q_OBJECT
public:
Table(QWidget *p = 0): QTableView(p) {
QShortcut *s = new QShortcut(QKeySequence(tr("Ctrl+;")), this);
connect(s, SIGNAL(activated()), SLOT(editActivated()));
}
private slots:
void editActivated() {
edit(currentIndex());
}
};
To copy to clipboard, switch view to plain text mode
If you intercept Enter to start and edit you may lose it as a way to end the edit as it is by default.
Bookmarks