9 const std::shared_ptr<GOptions>& gopts,
11 if (!gopts || !gopts->getSwitch(
"gui"))
13 return std::unique_ptr<GSplash>(
new GSplash(gopts, img));
20GSplash::GSplash(
const std::shared_ptr<GOptions>& gopts,
const string& imageName)
27 pixmap.load(filename);
32 " must point to an image file.");
37 if (!pixmap.load(QString::fromStdString(imageName))) {
38 pixmap.load(QString(
":/%1").arg(QString::fromStdString(imageName)));
46 if (!pixmap.isNull()) {
47 splash = std::make_unique<QSplashScreen>(pixmap);
49 QCoreApplication::processEvents(QEventLoop::AllEvents, 50);
58 QPointer<QSplashScreen> sp = splash.get();
59 QTimer::singleShot(delay_ms, sp, [sp, qmsg = QString::fromStdString(msg)] {
61 sp->showMessage(qmsg, Qt::AlignLeft, Qt::black);
62 QCoreApplication::processEvents(QEventLoop::AllEvents, 50);
70 splash->showMessage(QString::fromStdString(msg), Qt::AlignLeft, Qt::black);
71 QCoreApplication::processEvents(QEventLoop::AllEvents, 50);
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
Splash screen utility for GUI runs.
void message(const std::string &msg)
Displays a message on the splash screen immediately.
static std::unique_ptr< GSplash > create(const std::shared_ptr< GOptions > &gopts, const std::string &imageName="gemcArchitecture")
Factory method for creating a GSplash instance.
void messageAfter(int delay, const std::string &msg)
Displays a message on the splash screen after a delay.
#define GSPLASHENVIRONMENT
#define NOSPLASHIMAGESELECTED
constexpr const char * GSPLASH_LOGGER
Default logger name used by this module.
#define ERR_NOSPLASHENVFOUND