Hi,
I link a loadButton to a SLOT:
MainfForm::load {
loadButton->installEventFilter(this->myWidget1);
loadButton->installEventFilter(this->myWidget2);
loadButton->installEventFilter(this->myWidget3);
......
QString te
= fd.
getOpenFileName(xdir.
path()+"/"+" ....",
...........
}
MainfForm::load {
loadButton->installEventFilter(this->myWidget1);
loadButton->installEventFilter(this->myWidget2);
loadButton->installEventFilter(this->myWidget3);
......
QFileDialog fd;
QString te = fd.getOpenFileName(xdir.path()+"/"+" ....",
...........
}
To copy to clipboard, switch view to plain text mode
Then:
cout << "filter\n";
cout << e->type() << endl;
if ( e
->type
() == QEvent::Move) { cout << "filter out\n";
return TRUE;
}
}
bool MyWidget::eventFilter(QObject* obj, QEvent* e) {
cout << "filter\n";
cout << e->type() << endl;
if ( e->type() == QEvent::Move) {
cout << "filter out\n";
return TRUE;
}
return QGLWidget::eventFilter(obj,e);
}
To copy to clipboard, switch view to plain text mode
I have 3 instance of MyWidget. The MouseMoveEvent in myWidget start when I choose a file "with doubleClick" in QFileDialog but printf inside QMouseEvent (in MyWidget) says
that only mouseMove start...
A hint? Thanks
Bookmarks