Antialiasing works on simulator, not on N9

  • I am developing an app with Qt Creator for Nokia N9. Cause I need to draw things, I use class inherited from QWidget and on paintEvent I use QPainter to draw a line (drawLine(0,0,480,854))

    It works, but line is aliased on my device, and antialiased on simulator.

    I seems, that setRenderHints does not work at all and have no effect.

    @painter.setRenderHint(RenderHint.Antialiasing, true);@
    The text is aliased (drawText), but line is not. If I do:

    @painter.setRenderHint(RenderHint.TextAntialiasing, false);@
    Text is still aliased on N9 and not aliased in simulator. I'm stuck.

  • AFAIK the N9 UI is running using OpenGL. Try using QPainter::HighQualityAntialiasing.

  • Ok, will try tonight and post the result! Thanks for participation!

  • Checked -- doesn't work :-(

    The app is really simple.

    Q_DECL_EXPORT int main(int argc, char argv[])
    app = createApplication(argc, argv);
    Board* board = new Board();
    return app->exec();

    void Board::paintEvent(QPaintEvent *)
    QPainter painter(this);
    QPen pen;
    painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing);

    I so much need help!

  • and Board is just QWidget

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.