1 | // Copyright (C) 2016 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 <QtGui/private/qfont_p.h> |
5 | |
6 | #include "qquicklayoutstyleinfo_p.h" |
7 | |
8 | |
9 | QT_BEGIN_NAMESPACE |
10 | |
11 | QQuickLayoutStyleInfo::QQuickLayoutStyleInfo() |
12 | { |
13 | } |
14 | |
15 | qreal QQuickLayoutStyleInfo::spacing(Qt::Orientation /*orientation*/) const |
16 | { |
17 | #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) || defined(Q_OS_QNX) |
18 | // On Android and iOS the default spacing between each UI element is 8dp |
19 | qreal spacing = 8.0; |
20 | #else |
21 | qreal spacing = 5.0; |
22 | #endif |
23 | |
24 | #ifndef Q_OS_MACOS |
25 | // On OS X the DPI is always 72 so we should not scale it |
26 | spacing = qRound(d: spacing * (qreal(qt_defaultDpiX()) / 96.0)); |
27 | #endif |
28 | |
29 | return spacing; |
30 | } |
31 | |
32 | qreal QQuickLayoutStyleInfo::windowMargin(Qt::Orientation /*orientation*/) const |
33 | { |
34 | return 0; |
35 | } |
36 | |
37 | bool QQuickLayoutStyleInfo::hasChangedCore() const |
38 | { |
39 | // never changes |
40 | return false; |
41 | } |
42 | |
43 | QT_END_NAMESPACE |
44 | |
45 |