[Qt-interest] Sin wave with using QGraphicsScene/QGraphicsView

Kari Laine klaine8 at gmail.com
Thu Dec 3 21:24:04 CET 2009


Thanks,

this pointer helped me - I will now try to make a little test program.

Best Regards
Kari

On Thu, Dec 3, 2009 at 9:09 PM, Dave Smith <dave at thesmithfam.org> wrote:
> Kari Laine wrote:
>> Hi All,
>>
>> I turn to you again. I would really need a little example how to draw
>> sin wave with QGraphicsScene/QGraphicsView . I am now going through an
>> example diagramscene from QT-examples and I am not able to undestand
>> where the QPainter is initialized. And example contains a lot of code
>> - I would need a little example to stop my head spinning.
>>
>> As told I am working on a GPL-project.
>
> You don't usually need to initialize a QPainter with QGraphcisView. You
> just sub-class a QGraphicsItem class and reimplement the paint() method.
> One of the arguments to paint() is a QPainter*, which you use to paint
> to your graphics item.
>
> You might want to forget about QPainter and just use a
> QGraphicsPathItem, where each point in the path is a point along your
> (discreet) sine wave.
>
> --Dave
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



-- 
PIC - ARM - Microcontrollers - I2C - SPI
Keypads - USB-RS232 - USB-I2C - Accessories
http://www.byvac.com
I am just a happy customer



More information about the Qt-interest-old mailing list