[Qt-interest] QWidget backgroup to white
Alexandre Beraud
aberaud at infflux.com
Tue Dec 1 18:31:56 CET 2009
Hi Kari,
(Since you replied only to me, and provided that your mail is intended
to the whole list, I will reply to the list)
I only recently had the courage to test QGraphicsScene and I discovered
that it is a very simple, yet powerful tool to use. I think that you can
use it for a simple application, without the need for scrollbars, for
instance. Of course the various examples you will find on the internet
will show hundreds of rotating and zooming items, nested inside each
other, and so on... just because the trolls need to show how powerful
their new toy is :) Anyway, if you have many points, lines or paths
(especialy in the case of an oscilloscope) to draw, you will find it
much easier to use the dedicated QGraphicsItem(s) that to draw them by
hand through paintEvent().
Regards,
Alex
Kari Laine a écrit :
> Hi Alex,
>
> On Tue, Dec 1, 2009 at 6:24 PM, Alexandre Beraud <aberaud at infflux.com> wrote:
>
>> Hi,
>>
>> If you draw waves on your widget, then I assume that you have redefined
>> the paintEvent() of the widget. In that case why not just call
>> QPainter::fillRect() ? Also, if you really want to freely draw on a
>> widget, I would advise to use QGraphicsScene/QGraphicsView, and use the
>> setBackgroundBrush() method.
>>
>
> Thanks for answering. I did try to get hang of that
> QGraphicsScene/QGraphicsView stuff.
> Looked at the examples which come with QT. Nice ones are they!
>
> Anyway I somehow got a picture that scene/view are oriented to
> applications which have
> 1. bigger work area than what can be shown at one time. Therefore you
> have the View to look at part of bigger buffer.
> 2. you create objects and put them on the scene
>
> Why they use QPainter also did not open to me. I got so lost with
> scene and view that I backed up to QPainter, which is quite simple.
>
> Like I have mentioned I am trying to write an oscilloscope program for
> Velleman PCSGU250. There is no timetable so I can learn when I go.
>
> So could you people whine in and absolutely say that to scope program
> QGraphicScene/QGraphicsView is the right path to take.
> One nice person already told so but now I need some points which make
> it really so.
>
> This list seems awesome resource - hopefully I am kicked out for
> stupid questions....
>
> Best Regards
> Kari
>
>
>
--
Alexandre BERAUD
Ingénieur Développement
Infflux - Informatique & Flux
Tel: 01 49 57 92 00 - Fax : 01 49 57 92 01
Mail: aberaud at infflux.com
Visitez notre site : www.infflux.com
More information about the Qt-interest-old
mailing list