units.dp and units.du be gone

- They're not used
- They're conceptually broken and arbitrary to our scaling concepts
- The implementation as Q_INVOKABLE isn't very useful
This commit is contained in:
Sebastian Kügler 2014-01-25 03:35:00 +01:00
parent c8ba9746f2
commit b1bc20259a
2 changed files with 0 additions and 24 deletions

View File

@ -136,20 +136,6 @@ int Units::gridUnit() const
return m_gridUnit;
}
qreal Units::dp(qreal value) const
{
if (value <= 2.0) {
return qRound(value * floor(m_devicePixelRatio));
} else {
return qRound(value * m_devicePixelRatio);
}
}
qreal Units::gu(qreal value) const
{
return qRound(m_gridUnit * value);
}
void Units::themeChanged()
{
const int gridUnit = QFontMetrics(QApplication::font()).boundingRect("M").height();

View File

@ -94,16 +94,6 @@ public:
int smallSpacing() const;
int largeSpacing() const;
/**
* @returns the number of pixels value density independent pixels correspond to.
*/
Q_INVOKABLE qreal dp(qreal value) const;
/**
* @returns the number of pixels value grid units correspond to.
*/
Q_INVOKABLE qreal gu(qreal value) const;
/**
* @returns the dpi value for the item's screen
*/