A dialog is also a widget
Ok, does it have keyboard focus?
Furthermore your code is incorrect:
if (event->key() == Qt::Key_Control && Qt::Key_Alt && Qt::Key_V)
if (event->key() == Qt::Key_Control && Qt::Key_Alt && Qt::Key_V)
To copy to clipboard, switch view to plain text mode
this can be translated to:
if(event->key() == Qt::Key_Control && 0x01000023 && 0x56)
if(event->key() == Qt::Key_Control && 0x01000023 && 0x56)
To copy to clipboard, switch view to plain text mode
which again translates to:
if(event->key() == Qt::Key_Control && true && true)
if(event->key() == Qt::Key_Control && true && true)
To copy to clipboard, switch view to plain text mode
and then to:
if(event->key() == Qt::Key_Control)
if(event->key() == Qt::Key_Control)
To copy to clipboard, switch view to plain text mode
which as you probably guess is not what you want. Read what QKeyEvent::key() is and use it with conjunction with QKeyEvent::modifiers(). Or just use QShortcut.
Learning a bit more C++ wouldn't hurt either.
Bookmarks