Home > Back-end >  Why the Qt notify () function will enter twice
Why the Qt notify () function will enter twice

Time:09-24

# include "Application. H"
Int notifyNum=0;
Application: Application (int & amp; Arg c, char * * argv) : QApplication (arg c, argv)
{

}

Bool Application: : notify (QObject * obj, QEvent * event)
{
The static bool status=true;
If (event - & gt; The type ()==QEvent: : KeyPress)
{
QDebug () & lt; <"NotifyNum:" & lt; NotifyNum++;
}
Return QApplication: : notify (obj, event);
}
Why every keystroke print two qDebug () & lt; <"NotifyNum:" & lt;
  • Related