Merge 15587b4f1d into merged_master (Bitcoin PR bitcoin-core/gui#448)

This commit is contained in:
Byron Hambly 2023-05-10 12:43:19 +00:00
commit 7aeb30eca5
3 changed files with 12 additions and 2 deletions

View file

@ -45,7 +45,6 @@
#include <QApplication>
#include <QDebug>
#include <QFontDatabase>
#include <QLatin1String>
#include <QLibraryInfo>
#include <QLocale>
@ -469,7 +468,7 @@ int GuiMain(int argc, char* argv[])
#endif
BitcoinApplication app;
QFontDatabase::addApplicationFont(":/fonts/monospace");
GUIUtil::LoadFont(QStringLiteral(":/fonts/monospace"));
/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these
// Command-line options take precedence:

View file

@ -279,6 +279,12 @@ bool hasEntryData(const QAbstractItemView *view, int column, int role)
return !selection.at(0).data(role).toString().isEmpty();
}
void LoadFont(const QString& file_name)
{
const int id = QFontDatabase::addApplicationFont(file_name);
assert(id != -1);
}
QString getDefaultDataDirectory()
{
return boostPathToQString(GetDefaultDataDir());

View file

@ -115,6 +115,11 @@ namespace GUIUtil
void setClipboard(const QString& str);
/**
* Loads the font from the file specified by file_name, aborts if it fails.
*/
void LoadFont(const QString& file_name);
/**
* Determine default data directory for operating system.
*/