refs #446, moved common parts for GUI applications in a utility function

* for init
* for parser
This commit is contained in:
Klaus Basan
2015-06-19 23:35:54 +02:00
committed by Mathew Sutcliffe
parent 091c61c909
commit 08670c9e89
4 changed files with 106 additions and 110 deletions

View File

@@ -13,8 +13,10 @@
#define BLACKGUI_GUIUTILITY_H
#include "blackgui/blackguiexport.h"
#include <QWidgetList>
#include "blackmisc/icon.h"
#include "enableforframelesswindow.h"
#include <QWidgetList>
#include <QCommandLineParser>
namespace BlackGui
{
@@ -23,7 +25,6 @@ namespace BlackGui
{
public:
//! Main application window
static CEnableForFramelessWindow *mainApplicationWindow();
@@ -51,11 +52,22 @@ namespace BlackGui
//! Delete hierarchy of layouts
static void deleteLayout(QLayout *layout, bool deleteWidgets);
//! Message box or command line warning (depending on OS)
static void commandLineErrorMessage(const QString &errorMessage, const QCommandLineParser &parser);
//! Message box or command line version info
static void commandLineVersionRequested();
//! Message box or command line version info
static void commandLineHelpRequested(QCommandLineParser &parser);
//! Standard initialization for a swift GUI application
static void initSwiftGuiApplication(QApplication &a, const QString &applicationName, const QPixmap &icon = BlackMisc::CIcons::swift24());
private:
//! Constructor, use static methods only
CGuiUtility() {}
};
}
} // ns
#endif // guard