chore: remove Singleton & replace getIApp with getApp (#5514)

This commit is contained in:
pajlada
2024-07-21 15:09:59 +02:00
committed by GitHub
parent 21186df058
commit 5deec1f02f
145 changed files with 802 additions and 856 deletions
+4 -4
View File
@@ -16,7 +16,7 @@ Label::Label(BaseWidget *parent, QString text, FontStyle style)
, text_(std::move(text))
, fontStyle_(style)
{
this->connections_.managedConnect(getIApp()->getFonts()->fontChanged,
this->connections_.managedConnect(getApp()->getFonts()->fontChanged,
[this] {
this->updateSize();
});
@@ -89,10 +89,10 @@ void Label::paintEvent(QPaintEvent *)
{
QPainter painter(this);
QFontMetrics metrics = getIApp()->getFonts()->getFontMetrics(
QFontMetrics metrics = getApp()->getFonts()->getFontMetrics(
this->getFontStyle(), this->scale());
painter.setFont(
getIApp()->getFonts()->getFont(this->getFontStyle(), this->scale()));
getApp()->getFonts()->getFont(this->getFontStyle(), this->scale()));
int offset = this->getOffset();
@@ -119,7 +119,7 @@ void Label::paintEvent(QPaintEvent *)
void Label::updateSize()
{
QFontMetrics metrics =
getIApp()->getFonts()->getFontMetrics(this->fontStyle_, this->scale());
getApp()->getFonts()->getFontMetrics(this->fontStyle_, this->scale());
int width =
metrics.horizontalAdvance(this->text_) + (2 * this->getOffset());