Qt Utilities 6.14.3
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
Loading...
Searching...
No Matches
resources.h File Reference
#include "../global.h"
#include <QString>
#include <QtContainerFwd>
#include <QtGlobal>
#include <initializer_list>
#include <memory>
Include dependency graph for resources.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  QtUtilities
 !
 
namespace  QtUtilities::QtUtilitiesResources
 Functions for using the resources provided by this library.
 
namespace  QtUtilities::TranslationFiles
 Convenience functions to load translations for Qt and the application.
 
namespace  QtUtilities::ApplicationInstances
 Convenience functions to check whether a QCoreApplication/QGuiApplication/QApplication singleton has been instantiated yet.
 

Macros

#define SET_QT_DESKTOP_FILE_NAME
 Sets the base name of the desktop entry for this application from buildsystem-provided meta-data.
 
#define SET_QT_APPLICATION_INFO
 Sets the application meta data in the QCoreApplication singleton and attributes commonly used within my applications.
 
#define LOAD_QT_TRANSLATIONS
 Loads translations for Qt, other dependencies and the application.
 

Functions

QT_UTILITIES_EXPORT void QtUtilities::QtUtilitiesResources::init ()
 Initiates the resources used and provided by this library.
 
QT_UTILITIES_EXPORT void QtUtilities::QtUtilitiesResources::cleanup ()
 Frees the resources used and provided by this library.
 
QT_UTILITIES_EXPORT QString & QtUtilities::TranslationFiles::additionalTranslationFilePath ()
 Allows to set an additional search path for translation files.
 
QT_UTILITIES_EXPORT void QtUtilities::TranslationFiles::loadQtTranslationFile (std::initializer_list< QString > repositoryNames)
 Loads and installs the appropriate Qt translation file for the current locale.
 
QT_UTILITIES_EXPORT void QtUtilities::TranslationFiles::loadQtTranslationFile (std::initializer_list< QString > repositoryNames, const QString &localeName)
 
QT_UTILITIES_EXPORT void QtUtilities::TranslationFiles::loadApplicationTranslationFile (const QString &configName, const QString &applicationName)
 Loads and installs the appropriate application translation file for the current locale.
 
QT_UTILITIES_EXPORT void QtUtilities::TranslationFiles::loadApplicationTranslationFile (const QString &configName, const QString &applicationName, const QString &localeName)
 Loads and installs the appropriate application translation file for the specified locale.
 
QT_UTILITIES_EXPORT void QtUtilities::TranslationFiles::loadApplicationTranslationFile (const QString &configName, const std::initializer_list< QString > &applicationNames)
 Loads and installs the appropriate application translation file for the current locale.
 
QT_UTILITIES_EXPORT void QtUtilities::TranslationFiles::loadApplicationTranslationFile (const QString &configName, const std::initializer_list< QString > &applicationNames, const QString &localeName)
 Loads and installs the appropriate application translation file for the specified locale.
 
QT_UTILITIES_EXPORT void QtUtilities::TranslationFiles::clearTranslationFiles ()
 Clears all translation files previously loaded via the load-functions in this namespace.
 
QT_UTILITIES_EXPORT bool QtUtilities::ApplicationInstances::hasCoreApp ()
 Returns whether a QCoreApplication has been instantiated yet.
 
QT_UTILITIES_EXPORT void QtUtilities::setupCommonQtApplicationAttributes ()
 Sets Qt application attributes which are commonly used within my Qt applications.
 
QT_UTILITIES_EXPORT std::unique_ptr< QSettings > QtUtilities::getSettings (const QString &organization, const QString &application)
 Returns the settings object for the specified organization and application.
 
QT_UTILITIES_EXPORT QString QtUtilities::errorMessageForSettings (const QSettings &settings)
 Returns an error message for the specified settings or an empty string if there's no error.
 

Macro Definition Documentation

◆ LOAD_QT_TRANSLATIONS

#define LOAD_QT_TRANSLATIONS
Value:
QtUtilities::TranslationFiles::loadApplicationTranslationFile(QStringLiteral(PROJECT_CONFIG_NAME), APP_SPECIFIC_QT_TRANSLATION_FILES)
QT_UTILITIES_EXPORT void loadQtTranslationFile(std::initializer_list< QString > repositoryNames)
Loads and installs the appropriate Qt translation file for the current locale.

Loads translations for Qt, other dependencies and the application.

Definition at line 47 of file resources.h.

◆ SET_QT_APPLICATION_INFO

#define SET_QT_APPLICATION_INFO
Value:
QCoreApplication::setOrganizationName(QStringLiteral(APP_AUTHOR)); \
QCoreApplication::setOrganizationDomain(QStringLiteral(APP_DOMAIN)); \
QCoreApplication::setApplicationName(QStringLiteral(APP_NAME)); \
QCoreApplication::setApplicationVersion(QStringLiteral(APP_VERSION)); \
SET_QT_DESKTOP_FILE_NAME \
::QtUtilities::setupCommonQtApplicationAttributes()

Sets the application meta data in the QCoreApplication singleton and attributes commonly used within my applications.

See also
QtUtilities::setupCommonQtApplicationAttributes()

Definition at line 36 of file resources.h.

◆ SET_QT_DESKTOP_FILE_NAME

#define SET_QT_DESKTOP_FILE_NAME

Sets the base name of the desktop entry for this application from buildsystem-provided meta-data.

Remarks
  • This is done as part of SET_QT_APPLICATION_INFO and thus normally doesn't need to be invoked individually.
  • This macro is still experimental.

Definition at line 25 of file resources.h.