updated application startup
This commit is contained in:
parent
18636e1541
commit
8960d5be53
|
@ -43,9 +43,8 @@ int main(int argc, char *argv[])
|
||||||
cout << "Unable to parse arguments. " << ex.what() << "\nSee --help for available commands." << endl;
|
cout << "Unable to parse arguments. " << ex.what() << "\nSee --help for available commands." << endl;
|
||||||
}
|
}
|
||||||
// set meta info for application
|
// set meta info for application
|
||||||
SET_QT_APPLICATION_INFO;
|
|
||||||
if(qtConfigArgs.areQtGuiArgsPresent()) {
|
if(qtConfigArgs.areQtGuiArgsPresent()) {
|
||||||
return QtGui::runWidgetsGui(argc, argv);
|
return QtGui::runWidgetsGui(argc, argv, qtConfigArgs);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include <qtutilities/resources/qtconfigarguments.h>
|
||||||
#include <qtutilities/resources/resources.h>
|
#include <qtutilities/resources/resources.h>
|
||||||
|
|
||||||
#if defined(GUI_QTWIDGETS)
|
#if defined(GUI_QTWIDGETS)
|
||||||
|
@ -11,24 +12,28 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace ApplicationUtilities;
|
||||||
|
|
||||||
namespace QtGui {
|
namespace QtGui {
|
||||||
|
|
||||||
int runWidgetsGui(int argc, char *argv[])
|
int runWidgetsGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs)
|
||||||
{
|
{
|
||||||
#ifdef GUI_QTWIDGETS
|
#ifdef GUI_QTWIDGETS
|
||||||
QApplication a(argc, argv);
|
SET_QT_APPLICATION_INFO;
|
||||||
QtUtilitiesResources::init();
|
QApplication a(argc, argv);
|
||||||
Theme::setup();
|
// load resources needed by classes of qtutilities
|
||||||
QtGui::restoreSettings();
|
QtUtilitiesResources::init();
|
||||||
QtGui::MainWindow w;
|
// apply settings specified via command line args
|
||||||
w.show();
|
qtConfigArgs.applySettings();
|
||||||
int r = a.exec();
|
QtGui::restoreSettings();
|
||||||
QtGui::saveSettings();
|
QtGui::MainWindow w;
|
||||||
return r;
|
w.show();
|
||||||
|
int r = a.exec();
|
||||||
|
QtGui::saveSettings();
|
||||||
|
return r;
|
||||||
#else
|
#else
|
||||||
cout << "Application has not been build with Qt widgets GUI support." << endl;
|
cout << "Application has not been build with Qt widgets GUI support." << endl;
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
#ifndef QTGUI_INIT_H
|
#ifndef QTGUI_INIT_H
|
||||||
#define QTGUI_INIT_H
|
#define QTGUI_INIT_H
|
||||||
|
|
||||||
|
namespace ApplicationUtilities {
|
||||||
|
class QtConfigArguments;
|
||||||
|
}
|
||||||
|
|
||||||
namespace QtGui {
|
namespace QtGui {
|
||||||
|
|
||||||
int runWidgetsGui(int argc, char *argv[]);
|
int runWidgetsGui(int argc, char *argv[], const ApplicationUtilities::QtConfigArguments &qtConfigArgs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_FORWARD_DECLARE_CLASS(QIODevice)
|
||||||
class QIODevice;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace Network {
|
namespace Network {
|
||||||
|
|
||||||
|
@ -42,6 +40,8 @@ public:
|
||||||
PermissionStatus ignoreSslErrorsPermission() const;
|
PermissionStatus ignoreSslErrorsPermission() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void chuckOutputDevice();
|
||||||
|
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QUrl m_url;
|
QUrl m_url;
|
||||||
size_t m_redirectsTo;
|
size_t m_redirectsTo;
|
||||||
|
@ -60,7 +60,6 @@ private:
|
||||||
PermissionStatus m_appendPermission;
|
PermissionStatus m_appendPermission;
|
||||||
PermissionStatus m_redirectPermission;
|
PermissionStatus m_redirectPermission;
|
||||||
PermissionStatus m_ignoreSslErrorsPermission;
|
PermissionStatus m_ignoreSslErrorsPermission;
|
||||||
void chuckOutputDevice();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Reference in New Issue