Вопрос

Is it possible to increase/decrease font size by a factor using qss?

Это было полезно?

Решение

The Qt Style Sheets Reference for the font-size property says:

In this version of Qt, only pt and px metrics are supported.

So it still doesn't seem to be possible.

Другие советы

Well, you could try scaling the value through code and then inserting back to stylesheet.

//nFontSize and nSomeFactor are your base font size and factor
widgetYouWantToSetFontSizeFor->setStyleSheet("font-size: "+QString::number(scaleUsingSomeFactor(nFontSize, nSomeFactor))+"pt;");

Although, I am not sure what you're looking for.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top