[Qt-interest] What is wrong on QPainter?

Stefanos Antaris santaris at csd.auth.gr
Wed May 13 13:58:54 CEST 2009


Hello i am reading on Prentice Hall C++ GUI Programming with Qt 4, 
Second Edition and i am reading about QPainter.I am just trying to make 
a simple app just to test it but something is going wrong.I am just 
trying to make a Bezier curve but it doesn't show me anything.Can anyone 
explain me?Here is my code on constructor.On the header file i just have 
this.QPainter* painter;
[code]
    painter = new QPainter(this);
    painter->setRenderHint(QPainter::Antialiasing , true);

    QPainterPath path;
    path.moveTo(80,320);
    path.cubicTo(200,80,320,80,480,320);

    painter->setPen(QPen(Qt::black,8));
    painter->drawPath(path);

[/code]
The code is just a copy from the book.



More information about the Qt-interest-old mailing list