gsplash
Loading...
Searching...
No Matches
gsplash_example.cc File Reference

Example program demonstrating GSplash usage in GUI and CLI modes. More...

#include "gsplash.h"
#include <QApplication>
#include <QMainWindow>
Include dependency graph for gsplash_example.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Entry point for the GSplash example.
 

Detailed Description

This example shows how to:

Usage notes:

  • When --gui is enabled, the program starts a QApplication event loop and displays a window.
  • The splash is closed automatically when the application quits (after a timeout).
  • When --gui is disabled, the example runs in command-line mode and does not create GUI objects.

Definition in file gsplash_example.cc.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

The program demonstrates two execution modes:

  • GUI mode: enabled by the --gui switch, creates a QApplication, shows a main window, and displays a splash.
  • CLI mode: default when --gui is not enabled, skips all GUI initialization.

The timeout value is read from the tt scalar option and used to exit the GUI event loop.

Parameters
argcNumber of command-line arguments.
argvArray of command-line arguments.
Returns
EXIT_SUCCESS on normal completion.

Definition at line 41 of file gsplash_example.cc.