sashoalm
sashoalm

Reputation: 79467

Disable text anti-aliasing in Qt application

Since Qt does its own text rendering, is it possible to disable anti-aliasing for a Qt app at runtime, without changing the global OS settings?

If possible, I assume it would be done by tweaking the app's QStyle or something similar. Is that correct?

Upvotes: 3

Views: 2330

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262939

The QFont class exposes a setStyleStrategy() method that allows you to alter the font matching algorithm.

Passing QFont::NoAntialias should achieve what you want:

yourFont.setStyleStrategy(QFont::NoAntialias);

Upvotes: 4

Related Questions