![]() |
OpenMS
|
A QSplashScreen which stays responsive and can be dismissed early by the user. More...
#include <OpenMS/VISUAL/MISC/InteractiveSplashScreen.h>
Public Member Functions | |
| InteractiveSplashScreen (const QPixmap &pixmap) | |
| C'tor from a pixmap (as for QSplashScreen). Starts an internal timer used by showFor(). | |
| ~InteractiveSplashScreen () override | |
| D'tor. | |
| void | showFor (double max_seconds) |
Keep the splash visible and responsive for at most max_seconds, then close it. | |
Protected Member Functions | |
| void | mousePressEvent (QMouseEvent *e) override |
| void | keyPressEvent (QKeyEvent *e) override |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
A QSplashScreen which stays responsive and can be dismissed early by the user.
Applications typically want to show a splash screen for a minimum duration (so users can actually read it).
This class instead offers showFor(), which runs a nested, interruptible event loop. The splash stays responsive for at most the requested time and closes immediately once the user clicks it or presses a key.
Usage:
|
explicit |
C'tor from a pixmap (as for QSplashScreen). Starts an internal timer used by showFor().
|
override |
D'tor.
|
overrideprotected |
|
overrideprotected |
| void showFor | ( | double | max_seconds | ) |
Keep the splash visible and responsive for at most max_seconds, then close it.
Returns early (closing the splash) as soon as the user clicks the splash or presses a key. The elapsed time is counted from construction, so any work done between constructing the splash and calling this method counts towards max_seconds.
Referenced by main().
|
private |