Domanda

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

È stato utile?

Soluzione

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.

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top