KD Reports API Documentation  2.2
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 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
12 
13 QT_BEGIN_NAMESPACE
14 Q_GUI_EXPORT extern int qt_defaultDpi(); // This is what QTextDocument uses...
15 QT_END_NAMESPACE
16 
17 qreal KDReports::mmToPixels(qreal mm)
18 {
19  return mm * 0.039370147 // mm to inch
20  * qt_defaultDpi(); // inch to pixels
21 }
22 
23 qreal KDReports::pixelsToPointsMultiplier(double resolution)
24 {
25  // See Q_GUI_EXPORT qreal qt_pixelMultiplier(int resolution) in Qt
26  return resolution <= 0 ? 1.0 : 72.0 / resolution;
27 }
QT_BEGIN_NAMESPACE Q_GUI_EXPORT int qt_defaultDpi()
KDREPORTS_EXPORT qreal mmToPixels(qreal mm)
KDREPORTS_EXPORT qreal pixelsToPointsMultiplier(double resolution)

© 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 by doxygen 1.9.1