MCPcopy Create free account
hub / github.com/KDE/okular / localizedSize

Method localizedSize

core/document.cpp:227–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227QString DocumentPrivate::localizedSize(const QSizeF size) const
228{
229 double inchesWidth = 0, inchesHeight = 0;
230 switch (m_generator->pagesSizeMetric()) {
231 case Generator::Points:
232 inchesWidth = size.width() / 72.0;
233 inchesHeight = size.height() / 72.0;
234 break;
235
236 case Generator::Pixels: {
237 const QSizeF dpi = m_generator->dpi();
238 inchesWidth = size.width() / dpi.width();
239 inchesHeight = size.height() / dpi.height();
240 } break;
241
242 case Generator::None:
243 break;
244 }
245 if (QLocale::system().measurementSystem() == QLocale::ImperialSystem) {
246 return i18nc("%1 is width, %2 is height, %3 is paper size name", "%1 × %2 in (%3)", inchesWidth, inchesHeight, namePaperSize(inchesWidth, inchesHeight));
247 } else {
248 return i18nc("%1 is width, %2 is height, %3 is paper size name", "%1 × %2 mm (%3)", QString::number(inchesWidth * 25.4, 'd', 0), QString::number(inchesHeight * 25.4, 'd', 0), namePaperSize(inchesWidth, inchesHeight));
249 }
250}
251
252qulonglong DocumentPrivate::calculateMemoryToFree()
253{

Callers 1

pageSizeStringMethod · 0.80

Calls 4

pagesSizeMetricMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
dpiMethod · 0.45

Tested by

no test coverage detected