Hello. I already did it. But I have determined that events belong to different objects.
After this code:
cc++;
qDebug() << cc;
cc++;
qDebug() << cc;
To copy to clipboard, switch view to plain text mode
I added the following code:
qDebug() << watched->metaObject()->className();
qDebug() << watched->metaObject()->className();
To copy to clipboard, switch view to plain text mode
Received a result:
Forum_question_2_1.png
Therefore, in eventFilter, I added the following kind of verification:
if (watched->metaObject()->className() == tempStr){
// code here
}
QString tempStr = "QWidgetWindow";
if (watched->metaObject()->className() == tempStr){
// code here
}
To copy to clipboard, switch view to plain text mode
In this case, the issue is resolved. But I do not know if it is correct to do so?
Bookmarks