mania
19th June 2014, 12:05
Hi All,
I have used three push buttons inside a groupbox and when I assign eventFilter() for the pushbuttons it gets hidden in the output screen. groupbox has NoFocus policy and pushbuttons has StrongFocus policy.
test1::test1(QWidget *parent) :
QDialog(parent, Qt::FramelessWindowHint),
ui(new Ui::test1)
{
ui->setupUi(this);
ui->pushButton_1->installEventFilter(this);
ui->pushButton_2->installEventFilter(this);
ui->pushButton_3->installEventFilter(this);
}
bool test1::eventFilter(QObject *o, QEvent *e)
{
if(e->type()==QEvent::KeyPress)
{
return QObject::eventFilter(o,e);
}
}
I have used three push buttons inside a groupbox and when I assign eventFilter() for the pushbuttons it gets hidden in the output screen. groupbox has NoFocus policy and pushbuttons has StrongFocus policy.
test1::test1(QWidget *parent) :
QDialog(parent, Qt::FramelessWindowHint),
ui(new Ui::test1)
{
ui->setupUi(this);
ui->pushButton_1->installEventFilter(this);
ui->pushButton_2->installEventFilter(this);
ui->pushButton_3->installEventFilter(this);
}
bool test1::eventFilter(QObject *o, QEvent *e)
{
if(e->type()==QEvent::KeyPress)
{
return QObject::eventFilter(o,e);
}
}