KD Reports API Documentation  2.0
KDReportsLayoutHelper.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDAB-KDReports OR LicenseRef-KDAB-KDReports-US
8 **
9 ** Licensees holding valid commercial KD Reports licenses may use this file in
10 ** accordance with the KD Reports Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 
18 
19 QT_BEGIN_NAMESPACE
20 Q_GUI_EXPORT extern int qt_defaultDpi(); // This is what QTextDocument uses...
21 QT_END_NAMESPACE
22 
23 qreal KDReports::mmToPixels(qreal mm)
24 {
25  return mm * 0.039370147 // mm to inch
26  * qt_defaultDpi(); // inch to pixels
27 }
28 
29 qreal KDReports::pixelsToPointsMultiplier(double resolution)
30 {
31  // See Q_GUI_EXPORT qreal qt_pixelMultiplier(int resolution) in Qt
32  return resolution <= 0 ? 1.0 : 72.0 / resolution;
33 }
qt_defaultDpi
QT_BEGIN_NAMESPACE Q_GUI_EXPORT int qt_defaultDpi()
KDReports::mmToPixels
KDREPORTS_EXPORT qreal mmToPixels(qreal mm)
Definition: KDReportsLayoutHelper.cpp:23
KDReportsLayoutHelper_p.h
KDReports::pixelsToPointsMultiplier
KDREPORTS_EXPORT qreal pixelsToPointsMultiplier(double resolution)
Definition: KDReportsLayoutHelper.cpp:29

© 2007-2021 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-reports/
Generated on Sat Jan 8 2022 02:38:32 for KD Reports API Documentation by doxygen 1.8.17