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:
parent
2a3a546f80
commit
6d9022dca2
@ -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();
|
||||
|
@ -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;
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user