2015-06-24 00:54:58 +02:00
|
|
|
#include "initiate.h"
|
|
|
|
#include "settings.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
|
2015-09-01 20:12:37 +02:00
|
|
|
#include <qtutilities/resources/qtconfigarguments.h>
|
2015-06-24 00:54:58 +02:00
|
|
|
#include <qtutilities/resources/resources.h>
|
|
|
|
|
|
|
|
#if defined(GUI_QTWIDGETS)
|
|
|
|
# include <QApplication>
|
|
|
|
#elif defined(GUI_QTQUICK)
|
|
|
|
# include <QGuiApplication>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
using namespace std;
|
2015-09-01 20:12:37 +02:00
|
|
|
using namespace ApplicationUtilities;
|
2015-06-24 00:54:58 +02:00
|
|
|
|
|
|
|
namespace QtGui {
|
|
|
|
|
2015-09-01 20:12:37 +02:00
|
|
|
int runWidgetsGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs)
|
2015-06-24 00:54:58 +02:00
|
|
|
{
|
|
|
|
#ifdef GUI_QTWIDGETS
|
2015-09-01 20:12:37 +02:00
|
|
|
SET_QT_APPLICATION_INFO;
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
// load resources needed by classes of qtutilities
|
|
|
|
QtUtilitiesResources::init();
|
|
|
|
// apply settings specified via command line args
|
|
|
|
qtConfigArgs.applySettings();
|
|
|
|
QtGui::restoreSettings();
|
|
|
|
QtGui::MainWindow w;
|
|
|
|
w.show();
|
|
|
|
int r = a.exec();
|
|
|
|
QtGui::saveSettings();
|
|
|
|
return r;
|
2015-06-24 00:54:58 +02:00
|
|
|
#else
|
2015-09-01 20:12:37 +02:00
|
|
|
cout << "Application has not been build with Qt widgets GUI support." << endl;
|
|
|
|
return 0;
|
2015-06-24 00:54:58 +02:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|