工作随笔,方便下次查阅:
QShortcut *shortcut = new QShortcut(QKeySequence("ESC"), this);
//方式二
//QShortcut *shortcut2 = new QShortcut(QKeySequence(Qt::Key_Escape), this);
QObject::connect(shortcut, SIGNAL(activated()), SLOT(xxx()));
工作随笔,方便下次查阅:
QShortcut *shortcut = new QShortcut(QKeySequence("ESC"), this);
//方式二
//QShortcut *shortcut2 = new QShortcut(QKeySequence(Qt::Key_Escape), this);
QObject::connect(shortcut, SIGNAL(activated()), SLOT(xxx()));