Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
4.8.5
Description
Using QApplication with GUIenabled 'false' the antialiasing cannot be disabled with QFont::setStyleStrategy(QFont::NoAntialias). This works correctly when GUIenabled is set to 'true'. Error is reproducible in Linux, but apparently not in Windows.
#include <QApplication> #include <QtGui> int main( int argc, char** argv ) { QApplication app( argc, argv, false ); QImage image( 400, 300, QImage::Format_RGB32 ); QFont font( "Helvetica", 24 ); font.setStyleStrategy(QFont::NoAntialias); QPainter painter( &image ); painter.setFont( font ); painter.setPen( Qt::white ); painter.fillRect( image.rect(), Qt::darkBlue ); painter.drawText( image.rect(), Qt::AlignCenter, "Hello, world!" ); image.save( "test.png", "PNG" ); return 0; }