summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-08-06 08:47:37 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-08-06 11:43:24 +0200
commit76068d0114157c6b59523f3fb032cd8de64e9a63 (patch)
tree2dfe4e31b17ca2768eb7248760a86513128024ea /src/widgets
parentb7a1bd306443e4f932a96020c1d48418916237ea (diff)
Make QFontDatabase member functions static
QFontDatabase is a singleton and all instances would share a single, mutex-protected global data pointer. But some functions were implemented as non-static functions. This caused a lot of code on the form QFontDatabase().families(...) since there was no static access. Other functions were implemented as static. To consolidate, we make all functions static. This should be source-compatible, but not binary compatible. [ChangeLog][QtGui][Fonts] Some functions in QFontDatabase were in principle static, but previously not implemented as such. All member functions have now been made static, so that constructing objects of QFontDatabase is no longer necessary to access certain functionality. Fixes: QTBUG-83284 Change-Id: Ifd8c15016281c71f631b53387402c942cd9c43f6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index 5f90853ec5..4b3003a6f3 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -134,7 +134,7 @@ static QFontDatabase::WritingSystem writingSystemFromLocale()
static QFontDatabase::WritingSystem writingSystemForFont(const QFont &font, bool *hasLatin)
{
- QList<QFontDatabase::WritingSystem> writingSystems = QFontDatabase().writingSystems(font.family());
+ QList<QFontDatabase::WritingSystem> writingSystems = QFontDatabase::writingSystems(font.family());
// qDebug() << font.family() << writingSystems;
// this just confuses the algorithm below. Vietnamese is Latin with lots of special chars
@@ -231,7 +231,7 @@ void QFontFamilyDelegate::paint(QPainter *painter,
}
const QIcon *icon = &bitmap;
- if (QFontDatabase().isSmoothlyScalable(text)) {
+ if (QFontDatabase::isSmoothlyScalable(text)) {
icon = &truetype;
}
const QSize actualSize = icon->actualSize(r.size());
@@ -267,7 +267,7 @@ void QFontFamilyDelegate::paint(QPainter *painter,
if (system != QFontDatabase::Any) {
int w = painter->fontMetrics().horizontalAdvance(text + QLatin1String(" "));
painter->setFont(font2);
- QString sample = QFontDatabase().writingSystemSample(system);
+ QString sample = QFontDatabase::writingSystemSample(system);
if (option.direction == Qt::RightToLeft)
r.setRight(r.right() - w);
else