You mean you want a QSplashScreen ?
No, We don't want a QSplashScreen, what we need is a PopUp to notify to user that request to retrieve some files has been received, We have implemented it with a QDialog. Ten seconds after appearing it hides automatically, but we would like that the user can click Popup anywhere to hide it if is disturbing, before the 10 seconds.
What's about using QWidget::mousePressEvent() and close the widget there?
We have tried QWidget::mousePressEvent(), but It not works. This PopUp contains inside others QWidgets like QLabel, QGroupBox,... If the users click the PopUp in a area with no others QWidgets mousePressEvent works, but if the user click for example on QGroupBox widget then the mousePressEvent is not thrown.
Try to install event filter on every widget in the dialog:
This code is not tested by me, I'm just wondering.Qt Code:
MyDialog * dialog = new MyDialog(); // for each element in the window: label->installEventFilter(dialog); groupBox->installEventFilter(dialog); // ... this->close(); return true; } else { return false; } }To copy to clipboard, switch view to plain text mode
Last edited by stampede; 3rd March 2011 at 08:56. Reason: updated contents (link)
I would try QWidget::grabMouse.
Using QWidget::grabMouse, It doesnt works because then no other widget except the PopUp receive mouseEvent. If you have another dialogs o widgets showed, they not receive mouseEvents.
Finally I have implemented it installing even widget to all widget ins the PopUp.
Thanks to all for your help,
Bookmarks