From 6d9022dca25d83dedc87db3ef8fc86eae4ee1f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Fri, 24 Jan 2014 12:33:39 +0100 Subject: [PATCH] Use int for units.gridUnit It was an int already anyway, so let's be true about this and also return an int. This reflects pixel-alignment in the API, not just in the implementation. --- src/declarativeimports/core/units.cpp | 2 +- src/declarativeimports/core/units.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarativeimports/core/units.cpp b/src/declarativeimports/core/units.cpp index d02835fa1..01a470384 100644 --- a/src/declarativeimports/core/units.cpp +++ b/src/declarativeimports/core/units.cpp @@ -96,7 +96,7 @@ void Units::setDevicePixelRatio(const qreal scale) } } -qreal Units::gridUnit() const +int Units::gridUnit() const { qDebug() << "FontMetrics: " << QApplication::font().pixelSize() << QFontMetrics(QApplication::font()).boundingRect("M"); qDebug() << " MRect" << QFontMetrics(QApplication::font()).boundingRect("M").size(); diff --git a/src/declarativeimports/core/units.h b/src/declarativeimports/core/units.h index 7f6da5cc7..26f73d9f4 100644 --- a/src/declarativeimports/core/units.h +++ b/src/declarativeimports/core/units.h @@ -35,7 +35,7 @@ class Units : public QObject * The fundamental unit of space that should be used for sizes, expressed in pixels. * Given the screen has an accurate DPI settings, it corresponds to a millimeter */ - Q_PROPERTY(qreal gridUnit READ gridUnit NOTIFY gridUnitChanged()) + Q_PROPERTY(int gridUnit READ gridUnit NOTIFY gridUnitChanged()) /** * units.iconSizes provides access to platform-dependent icon sizing @@ -75,7 +75,7 @@ public: bool eventFilter(QObject *watched, QEvent *event); - qreal gridUnit() const; + int gridUnit() const; /**