Hi, I installed an event filter on a PushButton in MainForm; Pushbutton call an QFileDialog
in wich I can choose file. If I choose a file with doubleClick, QFileDIalog is closing but
start MYWidget::MouseMoveEvent.
loadButton->installEventFilter(myWidget1);
loadButton->installEventFilter(myWidget1);
To copy to clipboard, switch view to plain text mode
I tried to filter out only mosue events but filtering is not executed. If I chancge below
QMouseEvent* in QEvent*: it works and filters out some event but none QMouseEvent.
I tried to not remove filter on loadButton and don't change....
cout << "filter\n";
//if (obj == w->loadTexture) {
cout << e->type() << endl;
cout << "filter out\n";
return TRUE;
}
else {
return FALSE;
}
}
bool MyWidget::eventFilter(QObject* obj, QMouseEvent* e) {
cout << "filter\n";
//if (obj == w->loadTexture) {
cout << e->type() << endl;
if (( e->type() != QMouseEvent::None)) {
cout << "filter out\n";
return TRUE;
}
else {
return FALSE;
}
}
To copy to clipboard, switch view to plain text mode
thanks
Bookmarks