Some debugging for gridUnit
This commit is contained in:
parent
caa975c7bb
commit
13a6a38628
@ -51,6 +51,7 @@ Item {
|
||||
text: "DPI"
|
||||
onClicked: {
|
||||
print("DPI Button onClicked");
|
||||
print(units.gridUnit);
|
||||
var d = theme.dpi(dpilabel);
|
||||
dpilabel.text = "DPI: " + d
|
||||
}
|
||||
|
@ -41,6 +41,10 @@ Units::~Units()
|
||||
|
||||
qreal Units::gridUnit() const
|
||||
{
|
||||
const int gridUnit = QFontMetrics(QApplication::font()).boundingRect("M").width();
|
||||
qDebug() << "FontMetrics: " << QApplication::font().pixelSize() << QFontMetrics(QApplication::font()).boundingRect("M");
|
||||
qDebug() << " MRect" << QFontMetrics(QApplication::font()).boundingRect("M").size();
|
||||
qDebug() << " like spacing" << QFontMetrics(QApplication::font()).boundingRect("M").size().height();
|
||||
return m_gridUnit;
|
||||
}
|
||||
|
||||
@ -65,6 +69,9 @@ qreal Units::gu(qreal value) const
|
||||
void Units::themeChanged()
|
||||
{
|
||||
const int gridUnit = QFontMetrics(QApplication::font()).boundingRect("M").width();
|
||||
qDebug() << "FontMetrics: " << QApplication::font().pixelSize() << QFontMetrics(QApplication::font()).boundingRect("M");
|
||||
qDebug() << " MRect" << QFontMetrics(QApplication::font()).boundingRect("M").size();
|
||||
qDebug() << " like spacing" << QFontMetrics(QApplication::font()).boundingRect("M").size().height();
|
||||
if (gridUnit != m_gridUnit) {
|
||||
m_gridUnit = gridUnit;
|
||||
emit gridUnitChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user