1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qquickuniversaltheme_p.h"
5
6#include <QtGui/qfontinfo.h>
7#include <QtQuickTemplates2/private/qquicktheme_p.h>
8
9QT_BEGIN_NAMESPACE
10
11void QQuickUniversalTheme::initialize(QQuickTheme *theme)
12{
13 QFont systemFont;
14 QFont groupBoxTitleFont;
15 QFont tabButtonFont;
16
17 const QFont font(QLatin1String("Segoe UI"));
18 if (QFontInfo(font).family() == QLatin1String("Segoe UI")) {
19 const QStringList families{font.family()};
20 systemFont.setFamilies(families);
21 groupBoxTitleFont.setFamilies(families);
22 tabButtonFont.setFamilies(families);
23 }
24
25 systemFont.setPixelSize(15);
26 theme->setFont(scope: QQuickTheme::System, font: systemFont);
27
28 groupBoxTitleFont.setPixelSize(15);
29 groupBoxTitleFont.setWeight(QFont::DemiBold);
30 theme->setFont(scope: QQuickTheme::GroupBox, font: groupBoxTitleFont);
31
32 tabButtonFont.setPixelSize(24);
33 tabButtonFont.setWeight(QFont::Light);
34 theme->setFont(scope: QQuickTheme::TabBar, font: tabButtonFont);
35}
36
37QT_END_NAMESPACE
38

source code of qtdeclarative/src/quickcontrols/universal/qquickuniversaltheme.cpp