Add a localDpiFactor helper

As we don't do everything via QStyle. layout margins for example
still need a manual factor
This commit is contained in:
Sergio Martins
2021-02-21 23:02:49 +00:00
parent 630d832f50
commit 6047275cfa
2 changed files with 25 additions and 0 deletions

View File

@@ -94,6 +94,16 @@ protected:
virtual void onCloseEvent(QCloseEvent *);
};
inline qreal logicalDpiFactor(QWidget *w)
{
#ifdef Q_OS_MACOS
// It's always 72 on mac
return 1;
#else
return w->logicalDpiX() / 96.0;
#endif
}
}
#endif