qtutilities/resources/resources.h

63 lines
1.7 KiB
C
Raw Normal View History

#ifndef APPLICATION_UTILITIES_RESOURCES_H
#define APPLICATION_UTILITIES_RESOURCES_H
2015-04-22 18:57:44 +02:00
#include <c++utilities/application/global.h>
#include <QtGlobal>
QT_FORWARD_DECLARE_CLASS(QString)
QT_FORWARD_DECLARE_CLASS(QStringList)
QT_FORWARD_DECLARE_CLASS(QSettings)
2015-04-22 18:57:44 +02:00
/*!
* \brief Sets the application meta data in the QCoreApplication singleton.
*/
2015-08-25 19:16:09 +02:00
#define SET_QT_APPLICATION_INFO \
QCoreApplication::setOrganizationName(QStringLiteral(APP_AUTHOR)); \
QCoreApplication::setOrganizationDomain(QStringLiteral(APP_URL)); \
QCoreApplication::setApplicationName(QStringLiteral(APP_NAME)); \
QCoreApplication::setApplicationVersion(QStringLiteral(APP_VERSION))
/*!
* \brief Loads translations for Qt and the application.
*/
2015-08-25 19:16:09 +02:00
#define LOAD_QT_TRANSLATIONS \
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 loadQtTranslationFile(const QString &localeName);
2015-04-22 18:57:44 +02:00
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();
}
namespace ConfigFile {
LIB_EXPORT QString locateConfigFile(const QString &applicationName, const QString &fileName, const QSettings *settings = nullptr);
}
#endif // APPLICATION_UTILITIES_RESOURCES_H