|
gsplash
|
Splash screen utility for GUI runs. More...
#include <gsplash.h>
Public Member Functions | |
| void | message (const std::string &msg) |
| Displays a message on the splash screen immediately. | |
| void | messageAfter (int delay, const std::string &msg) |
| Displays a message on the splash screen after a delay. | |
| void | finish (QWidget *callingWindow) const |
| Finishes the splash screen and returns focus to the calling window. | |
Public Member Functions inherited from GBase< GSplash > | |
| GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") | |
| GBase (const std::shared_ptr< GLogger > &logger) | |
| GBase (const GBase &)=default | |
| GBase (GBase &&) noexcept=default | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
| GBase & | operator= (GBase &&) noexcept=default |
Static Public Member Functions | |
| static std::unique_ptr< GSplash > | create (const std::shared_ptr< GOptions > &gopts, const std::string &imageName="gemcArchitecture") |
| Factory method for creating a GSplash instance. | |
Additional Inherited Members | |
Protected Attributes inherited from GBase< GSplash > | |
| std::shared_ptr< GLogger > | log |
GSplash shows a splash image and supports overlaying messages on top of it. It is designed to be optional: when GUI mode is disabled, create() returns nullptr so callers can safely use it in both GUI and headless workflows.
Image selection rules:
imageName is not NOSPLASHIMAGESELECTED, GSplash tries to load it first as a filesystem path, then as a Qt resource by prefixing ":/".imageName is NOSPLASHIMAGESELECTED, GSplash reads the image filename from the environment variable GSPLASH.Message behavior:
QTimer.
|
static |
This method centralizes the “GUI enabled?” policy:
gopts is null or the --gui switch is not enabled, it returns nullptr.Ownership is returned as a std::unique_ptr to enforce a single owner and avoid ambiguous lifetime.
| gopts | Shared application options. |
| imageName | Splash image name or path. When set to NOSPLASHIMAGESELECTED, the image path is taken from the environment variable GSPLASH. Defaults to "gemcArchitecture". |
Definition at line 8 of file gsplash.cc.
|
inline |
| void GSplash::message | ( | const std::string & | msg | ) |
If the splash is inactive (no valid image was loaded or GUI is disabled), this method does nothing. Internally, the message is shown via QSplashScreen::showMessage and the event loop is processed briefly to keep the UI responsive during initialization.
| msg | The message to display. |
Definition at line 67 of file gsplash.cc.
| void GSplash::messageAfter | ( | int | delay, |
| const std::string & | msg ) |
This schedules an update via QTimer::singleShot. A guarded pointer is used so the callback is safe even if the splash widget is destroyed before the timer fires.
If the splash is inactive (no valid image was loaded or GUI is disabled), this method does nothing.
| delay | Delay in milliseconds before displaying msg. |
| msg | The message to display. |
Definition at line 54 of file gsplash.cc.