2015-04-22 18:57:44 +02:00
|
|
|
#ifndef RESOURCES_H
|
|
|
|
#define RESOURCES_H
|
|
|
|
|
|
|
|
#include <c++utilities/application/global.h>
|
|
|
|
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
2015-09-16 17:30:25 +02:00
|
|
|
QT_FORWARD_DECLARE_CLASS(QString)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QStringList)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QSettings)
|
2015-04-22 18:57:44 +02:00
|
|
|
|
2015-08-25 19:16:09 +02:00
|
|
|
#define SET_QT_APPLICATION_INFO \
|
2015-07-27 23:22:46 +02:00
|
|
|
QCoreApplication::setOrganizationName(QStringLiteral(APP_AUTHOR)); \
|
|
|
|
QCoreApplication::setOrganizationDomain(QStringLiteral(APP_URL)); \
|
|
|
|
QCoreApplication::setApplicationName(QStringLiteral(APP_NAME)); \
|
|
|
|
QCoreApplication::setApplicationVersion(QStringLiteral(APP_VERSION))
|
|
|
|
|
2015-08-25 19:16:09 +02:00
|
|
|
#define LOAD_QT_TRANSLATIONS \
|
2015-07-27 23:22:46 +02:00
|
|
|
TranslationFiles::loadQtTranslationFile(); \
|
|
|
|
TranslationFiles::loadApplicationTranslationFile(QStringLiteral(PROJECT_NAME))
|
|
|
|
|
2015-04-22 18:57:44 +02:00
|
|
|
namespace QtUtilitiesResources {
|
|
|
|
|
|
|
|
LIB_EXPORT void init();
|
|
|
|
LIB_EXPORT void cleanup();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace TranslationFiles {
|
|
|
|
|
|
|
|
LIB_EXPORT void loadQtTranslationFile();
|
|
|
|
LIB_EXPORT void loadApplicationTranslationFile(const QString &applicationName);
|
2015-06-21 21:45:58 +02:00
|
|
|
LIB_EXPORT void loadApplicationTranslationFile(const QString &applicationName, const QString &localeName);
|
2015-04-22 18:57:44 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace ApplicationInstances {
|
|
|
|
|
|
|
|
#if defined(GUI_QTWIDGETS)
|
|
|
|
LIB_EXPORT bool hasWidgetsApp();
|
|
|
|
#endif
|
|
|
|
#if defined(GUI_QTWIDGETS) || defined(GUI_QTQUICK)
|
|
|
|
LIB_EXPORT bool hasGuiApp();
|
|
|
|
#endif
|
|
|
|
LIB_EXPORT bool hasCoreApp();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-09-16 17:30:25 +02:00
|
|
|
namespace ConfigFile {
|
|
|
|
|
|
|
|
LIB_EXPORT QString locateConfigFile(const QString &applicationName, const QString &fileName, const QSettings *settings = nullptr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-04-22 18:57:44 +02:00
|
|
|
#endif // RESOURCES_H
|