Qt Utilities
6.2.1
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)
19 #define SET_QT_APPLICATION_INFO \
20 QCoreApplication::setOrganizationName(QStringLiteral(APP_AUTHOR)); \
21 QCoreApplication::setOrganizationDomain(QStringLiteral(APP_DOMAIN)); \
22 QCoreApplication::setApplicationName(QStringLiteral(APP_NAME)); \
23 QCoreApplication::setApplicationVersion(QStringLiteral(APP_VERSION)); \
24 ::QtUtilities::setupCommonQtApplicationAttributes()
29 #define LOAD_QT_TRANSLATIONS \
30 QtUtilities::TranslationFiles::loadQtTranslationFile(QT_TRANSLATION_FILES); \
31 QtUtilities::TranslationFiles::loadApplicationTranslationFile(QStringLiteral(PROJECT_CONFIG_NAME), APP_SPECIFIC_QT_TRANSLATION_FILES)
35 namespace QtUtilitiesResources {
41 namespace TranslationFiles {
50 const QString &configName,
const std::initializer_list<QString> &applicationNames,
const QString &localeName);
53 namespace ApplicationInstances {
55 #if defined(QT_UTILITIES_GUI_QTWIDGETS)
58 #if defined(QT_UTILITIES_GUI_QTWIDGETS) || defined(QT_UTILITIES_GUI_QTQUICK)
68 #endif // APPLICATION_UTILITIES_RESOURCES_H
QT_UTILITIES_EXPORT bool hasCoreApp()
Returns whether a QCoreApplication has been instantiated yet.
QT_UTILITIES_EXPORT void setupCommonQtApplicationAttributes()
Sets Qt application attributes which are commonly used within my Qt applications.
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.