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.
This commit is contained in:
Sebastian Kügler 2014-01-24 12:33:39 +01:00
parent 2a3a546f80
commit 6d9022dca2
2 changed files with 3 additions and 3 deletions

View File

@ -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();

View File

@ -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;
/**