Skip to content

Commit

Permalink
Avoid FontLoader Class from being constructed and copied elsewhere (#721
Browse files Browse the repository at this point in the history
)
  • Loading branch information
1250890838 authored Nov 1, 2024
1 parent 4cc7c2a commit 1177ffb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/fontloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
class FontLoader
{
public:
FontLoader() = default;
~FontLoader() = default;

static FontLoader &getInstance()
{
static FontLoader instance;
return instance;
}

FontLoader(const FontLoader &) = delete;
void operator=(const FontLoader &) = delete;
QFont loadFont(const QString &family, const QString &style, int pointSize);

private:
FontLoader() = default;
~FontLoader() = default;
};

0 comments on commit 1177ffb

Please sign in to comment.