Newer
Older
// ************************************************************************************************
// BornAgain: simulate and fit reflection and scattering

Wuttke, Joachim
committed
//! @file GUI/main/main.cpp
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
// ************************************************************************************************
#include "GUI/Application/Application.h"
#include "GUI/DataLoaders/DataLoaderUtil.h"
#include "GUI/mainwindow/mainwindow.h"
void messageHandler(QtMsgType, const QMessageLogContext&, const QString&) {}
Mohammad Mahadi Hasan
committed
int main(int argc, char* argv[])
{
ApplicationOptions options(argc, argv);
if (!options.isConsistent())
return 0;
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
qRegisterMetaType<QVector<double>>("QVector<double>");
if (!options.disableHighDPISupport())
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
Mohammad Mahadi Hasan
committed
register1DDataLoaders();
app.loadStyle(app.settings().styleToUse());
if (!QDir().exists(app.appDataFolder()))
QDir().mkpath(app.appDataFolder());
app.instrumentLibrary().load(app.instrumentLibraryFilePath());
if (options.find("geometry"))
win.resize(options.mainWindowSize());
int ret = QApplication::exec();
app.instrumentLibrary().saveIfModified(app.instrumentLibraryFilePath());