QT 为VideoWidget添加快捷键

 

头文件

public:

  Phonon::VideoWidget * vw;

 

 

cpp

#include <QShortcut>

 

  QShortcut *shortcut = new QShortcut(QKeySequence("ESC"), vw);

        QObject::connect(shortcut, SIGNAL(activated()), SLOT(CloseZone()));

 

        QShortcut *shortcut2 = new QShortcut(QKeySequence(Qt::Key_Enter), vw);

        QObject::connect(shortcut2, SIGNAL(activated()), SLOT(resizeZone()));

你可能感兴趣的:(widget)