52 lines
989 B
C++
52 lines
989 B
C++
|
#include "pushbuttonmod.h"
|
||
|
|
||
|
pushbuttonmod::pushbuttonmod(QWidget *parent) :
|
||
|
QPushButton(parent)
|
||
|
{
|
||
|
F11disabled = false;
|
||
|
}
|
||
|
|
||
|
bool pushbuttonmod::isF11disabled()
|
||
|
{
|
||
|
return F11disabled;
|
||
|
}
|
||
|
|
||
|
void pushbuttonmod::setF11disabled(bool fl)
|
||
|
{
|
||
|
F11disabled = fl;
|
||
|
}
|
||
|
|
||
|
void pushbuttonmod::keyPressEvent(QKeyEvent *e)
|
||
|
{
|
||
|
int c = e->key();
|
||
|
bool fl = true;
|
||
|
|
||
|
// qDebug("%x", c);
|
||
|
|
||
|
if ((c==Qt::Key_F11)&& !F11disabled)
|
||
|
{
|
||
|
this->animateClick();
|
||
|
}
|
||
|
|
||
|
if ((uid==0x13)&&(c==Qt::Key_Left)) fl = false;
|
||
|
if ((uid==0x13)&&(c==Qt::Key_Up)) fl = false;
|
||
|
|
||
|
if ((uid==0x1e)&&(c==Qt::Key_Right)) fl = false;
|
||
|
if ((uid==0x1e)&&(c==Qt::Key_Down)) fl = false;
|
||
|
// if ((c==Qt::Key_Tab)) fl = false;
|
||
|
|
||
|
|
||
|
if ((uid==0x11)&&(c==Qt::Key_Left)) fl = false;
|
||
|
if ((uid==0x11)&&(c==Qt::Key_Right)) fl = false;
|
||
|
|
||
|
|
||
|
|
||
|
if (fl) QPushButton::keyPressEvent(e);
|
||
|
}
|
||
|
|
||
|
void pushbuttonmod::focusOutEvent(QFocusEvent *e)
|
||
|
{
|
||
|
|
||
|
QPushButton::focusOutEvent(e);
|
||
|
}
|