BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
main.cpp File Reference

Main function of the whole GUI. More...

Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 
void messageHandler (QtMsgType, const QMessageLogContext &, const QString &)
 

Detailed Description

Main function of the whole GUI.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file main.cpp.

Function Documentation

◆ main()

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

Definition at line 26 of file main.cpp.

27 {
28  ApplicationOptions options(argc, argv);
29  if (!options.isConsistent())
30  return 0;
31 
32  QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
33  qRegisterMetaType<QVector<double>>("QVector<double>");
34 
35  if (!options.disableHighDPISupport())
36  QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
37 
38  QApplication app(argc, argv);
39 
40  qInstallMessageHandler(MessageHandler);
41 
42  std::unique_ptr<SplashScreen> splash;
43  if (!options.find("no-splash")) {
44  splash.reset(new SplashScreen);
45  splash->start(/*show_during*/ 1200);
46  }
47 
48  MainWindow win;
49  if (options.find("geometry"))
50  win.resize(options.mainWindowSize());
51 
52  win.show();
53 
54  if (splash)
55  splash->finish(&win);
56 
57  return QApplication::exec();
58 }
void MessageHandler(QtMsgType type, const QMessageLogContext &, const QString &msg)
This is set by main to be the message handler of our GUI.
Handles command line and config file program options.
Definition: appoptions.h:32

References ApplicationOptions::disableHighDPISupport(), ApplicationOptions::find(), ApplicationOptions::isConsistent(), ApplicationOptions::mainWindowSize(), and MessageHandler().

Here is the call graph for this function:

◆ messageHandler()

void messageHandler ( QtMsgType  ,
const QMessageLogContext &  ,
const QString &   
)

Definition at line 24 of file main.cpp.

24 {}