Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquicklayoutstyleinfo.cpp
Go to the documentation of this file.
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
(
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
QQuickLayoutStyleInfo::spacing
qreal spacing(Qt::Orientation orientation) const override
Definition
qquicklayoutstyleinfo.cpp:15
QQuickLayoutStyleInfo::windowMargin
qreal windowMargin(Qt::Orientation orientation) const override
Definition
qquicklayoutstyleinfo.cpp:32
QQuickLayoutStyleInfo::hasChangedCore
bool hasChangedCore() const override
Definition
qquicklayoutstyleinfo.cpp:37
QQuickLayoutStyleInfo::QQuickLayoutStyleInfo
QQuickLayoutStyleInfo()
Definition
qquicklayoutstyleinfo.cpp:11
spacing
qreal spacing
Definition
doc_src_properties.cpp:104
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
Qt::Orientation
Orientation
Definition
qnamespace.h:98
qRound
int qRound(qfloat16 d) noexcept
Definition
qfloat16.h:327
qt_defaultDpiX
Q_GUI_EXPORT int qt_defaultDpiX()
Definition
qfont.cpp:110
qquicklayoutstyleinfo_p.h
qreal
double qreal
Definition
qtypes.h:187
qtdeclarative
src
quicklayouts
qquicklayoutstyleinfo.cpp
Generated by
1.10.0