2011-11-02 23:37:50 +00:00
|
|
|
#include "mruqmenu.hh"
|
|
|
|
#include <QKeyEvent>
|
|
|
|
|
|
|
|
MRUQMenu::MRUQMenu( const QString title, QWidget * parent ):
|
2023-04-12 08:11:36 +00:00
|
|
|
QMenu( title, parent )
|
|
|
|
{
|
|
|
|
}
|
2011-11-02 23:37:50 +00:00
|
|
|
|
2023-04-12 08:11:36 +00:00
|
|
|
void MRUQMenu::keyReleaseEvent( QKeyEvent * kev )
|
|
|
|
{
|
|
|
|
if ( kev->key() == Qt::Key_Control && actions().size() > 1 ) {
|
|
|
|
QAction * act = activeAction();
|
|
|
|
if ( act == nullptr ) {
|
|
|
|
act = actions().at( 1 );
|
2011-11-02 23:37:50 +00:00
|
|
|
}
|
2023-04-12 08:11:36 +00:00
|
|
|
emit requestTabChange( act->data().toInt() );
|
|
|
|
hide();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
kev->ignore();
|
|
|
|
}
|
|
|
|
};
|