bibhukalyana
5th July 2014, 10:24
Hi everyone,
I want to detect key press and mouse event from any widget. So I inherit QApplication and re implement the notify function.
I am able to detect mouse and key press event from any widget. But in some widget key press is not working fine. In lineEdit texts are not able to print escape key is not working in some widget.....
But if i remove the implementation of notify the all things are fine.
class MyApplication : public QApplication
{
Q_OBJECT
public:
MyApplication(int argc ,char** argv);
bool notify(QObject *obj, QEvent *e);
};
bool MyApplication::notify(QObject *obj, QEvent *e)
{
return obj->event(e);
}
Can anybody please tell me what is the problem ?
thanks.
I want to detect key press and mouse event from any widget. So I inherit QApplication and re implement the notify function.
I am able to detect mouse and key press event from any widget. But in some widget key press is not working fine. In lineEdit texts are not able to print escape key is not working in some widget.....
But if i remove the implementation of notify the all things are fine.
class MyApplication : public QApplication
{
Q_OBJECT
public:
MyApplication(int argc ,char** argv);
bool notify(QObject *obj, QEvent *e);
};
bool MyApplication::notify(QObject *obj, QEvent *e)
{
return obj->event(e);
}
Can anybody please tell me what is the problem ?
thanks.