Hi, I create two shortcuts like this: (slotRemove is different in the two widgets)
connect(del, SIGNAL(activated()),widget1, SLOT(slotRemove()));
connect(del2, SIGNAL(activated()),widget2,SLOT(slotRemove()));
QShortcut* del = new QShortcut(QKeySequence(Qt::Key_Delete),widget1);
connect(del, SIGNAL(activated()),widget1, SLOT(slotRemove()));
QShortcut* del2= new QShortcut(QKeySequence(Qt::Key_Delete),widget2);
connect(del2, SIGNAL(activated()),widget2,SLOT(slotRemove()));
To copy to clipboard, switch view to plain text mode
where widget1 is a QTableWidget and widget2 is a QTableView with custom model. The problem is that if I press delete in the tree, the slot is called correctly, however if I then try to press delete in the table, nothing happens, and delete no longer works correctly in the tree. In fact, nothing happens at all after I try to 'switch' and press delete. The same happens if I reverse the order (table first, tree second). I tried to change the contexts, but it did not work. Am I missing something here?
Bookmarks