g4dialog
Loading...
Searching...
No Matches
g4dialog_example.cc File Reference

Example program demonstrating how to instantiate and run G4Dialog. More...

#include "G4VisExecutive.hh"
#include "G4RunManagerFactory.hh"
#include "g4dialog.h"
#include "g4dialog_options.h"
#include <QApplication>
#include <QMainWindow>
#include <QTimer>
Include dependency graph for g4dialog_example.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 Program entry point for the G4Dialog example.
 

Detailed Description

This example supports two modes:

  • GUI mode (enabled by --gui): creates a QApplication, embeds G4Dialog in a QMainWindow, and runs the Qt event loop. A timer can be used to auto-quit after a configurable timeout.
  • CLI mode (default): initializes options/logging and performs minimal setup without starting Qt.

The example also initializes a Geant4 visualization manager (G4VisExecutive) so that UI commands and visualization-related help are available in typical setups.

Notes:

  • The exact options (e.g., --gui, --tt) are expected to be provided by the surrounding option definition conventions via g4dialog::defineOptions().
  • This example intentionally keeps the logic minimal and focused on wiring the UI components together.

Definition in file g4dialog_example.cc.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )
Parameters
argcNumber of command-line arguments.
argvCommand-line argument vector.
Returns
Process exit code (EXIT_SUCCESS on normal completion).

Definition at line 43 of file g4dialog_example.cc.