Qt Utilities
6.1.0
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
|
Go to the documentation of this file. 1 #ifndef APPLICATION_UTILITIES_RESOURCES_H
2 #define APPLICATION_UTILITIES_RESOURCES_H
8 #include <initializer_list>
10 QT_FORWARD_DECLARE_CLASS(QString)
11 QT_FORWARD_DECLARE_CLASS(QStringList)
12 QT_FORWARD_DECLARE_CLASS(QSettings)
17 #define SET_QT_APPLICATION_INFO \
18 QCoreApplication::setOrganizationName(QStringLiteral(APP_AUTHOR)); \
19 QCoreApplication::setOrganizationDomain(QStringLiteral(APP_DOMAIN)); \
20 QCoreApplication::setApplicationName(QStringLiteral(APP_NAME)); \
21 QCoreApplication::setApplicationVersion(QStringLiteral(APP_VERSION)); \
22 QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true)
27 #define LOAD_QT_TRANSLATIONS \
28 QtUtilities::TranslationFiles::loadQtTranslationFile(QT_TRANSLATION_FILES); \
29 QtUtilities::TranslationFiles::loadApplicationTranslationFile(QStringLiteral(PROJECT_CONFIG_NAME), APP_SPECIFIC_QT_TRANSLATION_FILES)
33 namespace QtUtilitiesResources {
39 namespace TranslationFiles {
48 const QString &configName,
const std::initializer_list<QString> &applicationNames,
const QString &localeName);
51 namespace ApplicationInstances {
53 #if defined(QT_UTILITIES_GUI_QTWIDGETS)
56 #if defined(QT_UTILITIES_GUI_QTWIDGETS) || defined(QT_UTILITIES_GUI_QTQUICK)
64 #endif // APPLICATION_UTILITIES_RESOURCES_H
QT_UTILITIES_EXPORT bool hasCoreApp()
Returns whether a QCoreApplication has been instantiated yet.
QT_UTILITIES_EXPORT void loadQtTranslationFile(std::initializer_list< QString > repositoryNames)
Loads and installs the appropriate Qt translation file for the current locale.
QT_UTILITIES_EXPORT QString & additionalTranslationFilePath()
Allows to set an additional search path for translation files.
#define QT_UTILITIES_EXPORT
Marks the symbol to be exported by the qtutilities library.
QT_UTILITIES_EXPORT void loadApplicationTranslationFile(const QString &configName, const QString &applicationName)
Loads and installs the appropriate application translation file for the current locale.
QT_UTILITIES_EXPORT void cleanup()
Frees the resources used and provided by this library.
QT_UTILITIES_EXPORT void init()
Initiates the resources used and provided by this library.