LibrePCB Developers Documentation
Application Class Referencefinal

Static functions to access some global application configuration. More...

#include <application.h>

+ Collaboration diagram for Application:

Public Member Functions

 Application ()=delete
 
 Application (const Application &other)=delete
 
 ~Application ()=delete
 
Applicationoperator= (const Application &rhs)=delete
 

Static Public Member Functions

static QString getVersion () noexcept
 Get the application version. More...
 
static QString getGitRevision () noexcept
 Get the git revision of the sources used to build the application. More...
 
static QDateTime getBuildDate () noexcept
 Get the date/time when the application was built. More...
 
static QString getBuildAuthor () noexcept
 Get the author who has built the application. More...
 
static const VersiongetFileFormatVersion () noexcept
 Get the used file format version. More...
 
static bool isFileFormatStable () noexcept
 Check whether the used file format is stable. More...
 
static FilePath getCacheDir () noexcept
 Get the path to the cache directory. More...
 
static const FilePathgetResourcesDir () noexcept
 Get the path to the resources directory. More...
 
static QStringList getTranslationLocales () noexcept
 Get all available translation locales. More...
 
static const QFont & getDefaultSansSerifFont () noexcept
 Get the default sans serif font. More...
 
static const QFont & getDefaultMonospaceFont () noexcept
 Get the default monospace font. More...
 
static const StrokeFontPoolgetStrokeFonts () noexcept
 Get all globally available stroke fonts. More...
 
static const StrokeFontgetDefaultStrokeFont () noexcept
 Get the default stroke font. More...
 
static QString getDefaultStrokeFontName () noexcept
 Get the name of the default stroke font. More...
 
static void loadBundledFonts () noexcept
 Load all bundled fonts to make them available in the application. More...
 
static void setTranslationLocale (const QLocale &locale) noexcept
 Install all translators for a given locale. More...
 

Detailed Description

Static functions to access some global application configuration.

Constructor & Destructor Documentation

◆ Application() [1/2]

Application ( )
delete

◆ Application() [2/2]

Application ( const Application other)
delete

◆ ~Application()

~Application ( )
delete

Member Function Documentation

◆ getVersion()

QString getVersion ( )
staticnoexcept

Get the application version.

Note
This function is thread-safe.
Returns
Version string (e.g. "0.2.0-unstable")
+ Here is the caller graph for this function:

◆ getGitRevision()

QString getGitRevision ( )
staticnoexcept

Get the git revision of the sources used to build the application.

Note
This function is thread-safe.
Returns
Revision hash (might be empty)
+ Here is the caller graph for this function:

◆ getBuildDate()

QDateTime getBuildDate ( )
staticnoexcept

Get the date/time when the application was built.

Note
This function is thread-safe.
Returns
Date/time (might be invalid)
+ Here is the caller graph for this function:

◆ getBuildAuthor()

QString getBuildAuthor ( )
staticnoexcept

Get the author who has built the application.

Note
This function is thread-safe.
Returns
Author (e.g. "LibrePCB CI"; might be empty)
+ Here is the caller graph for this function:

◆ getFileFormatVersion()

const Version & getFileFormatVersion ( )
staticnoexcept

Get the used file format version.

Note
This function is thread-safe.
Returns
File format version number
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFileFormatStable()

bool isFileFormatStable ( )
staticnoexcept

Check whether the used file format is stable.

Note
This function is thread-safe.
Return values
trueStable
falseUnstable
+ Here is the caller graph for this function:

◆ getCacheDir()

FilePath getCacheDir ( )
staticnoexcept

Get the path to the cache directory.

Note
This function is thread-safe.
Returns
Guaranteed valid file path (e.g. "/home/user/.cache/LibrePCB/LibrePCB/")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getResourcesDir()

const FilePath & getResourcesDir ( )
staticnoexcept

Get the path to the resources directory.

Note
This function is thread-safe.
Returns
Guaranteed valid file path (e.g. "/usr/share/librepcb/")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTranslationLocales()

QStringList getTranslationLocales ( )
staticnoexcept

Get all available translation locales.

Returns
Locales like "de_CH"
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultSansSerifFont()

const QFont & getDefaultSansSerifFont ( )
staticnoexcept

Get the default sans serif font.

Font to be used e.g. in schematics.

Warning
This function is not thread-safe!
Returns
Reference to font object
+ Here is the caller graph for this function:

◆ getDefaultMonospaceFont()

const QFont & getDefaultMonospaceFont ( )
staticnoexcept

Get the default monospace font.

Font to be used e.g. in schematics.

Warning
This function is not thread-safe!
Returns
Reference to font object
+ Here is the caller graph for this function:

◆ getStrokeFonts()

const StrokeFontPool & getStrokeFonts ( )
staticnoexcept

Get all globally available stroke fonts.

Note
This function is thread-safe.
Returns
Reference to stroke font pool
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultStrokeFont()

const StrokeFont & getDefaultStrokeFont ( )
staticnoexcept

Get the default stroke font.

Note
This function is thread-safe.
Returns
Reference to stroke font
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultStrokeFontName()

QString getDefaultStrokeFontName ( )
staticnoexcept

Get the name of the default stroke font.

Note
This function is thread-safe.
Returns
Name of the default stroke font
+ Here is the caller graph for this function:

◆ loadBundledFonts()

void loadBundledFonts ( )
staticnoexcept

Load all bundled fonts to make them available in the application.

To be called once at application startup.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTranslationLocale()

void setTranslationLocale ( const QLocale &  locale)
staticnoexcept

Install all translators for a given locale.

Parameters
localeLocale to use for translated strings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

Application& operator= ( const Application rhs)
delete

The documentation for this class was generated from the following files: