[Qt-interest] Which one is better? Graphics View or paintEvent()?
Mihail Naydenov
mlists at ymail.com
Tue Dec 22 10:38:38 CET 2009
>
>From: 程梁 <chengliang.soft at gmail.com>
>To: qt-interest at trolltech.com
>Sent: Tue, December 22, 2009 10:30:15 AM
>Subject: [Qt-interest] Which one is better? Graphics View or paintEvent()?
>
>>Hi, there! I want to develop a drawing and photo editing program.
>It may be like Photoshop or Paint.NET with items drawing, photo loading, processing, filters and layers.
>But I've no idea which one to choose to implement this program. At first I chose Graphics View it is simple
>to add items but I don't know is it still simple to do some process on photos such as some image filter algorithms?
>Or should I use QWidget and override its paintEvent() in order to get this feature? But if this is the better way, I'm
>afraid I have to create classes as QGraphicsItems?
>
>
>Now I don't know which one is better, could you give me some idea?
The default advise to study the hell out of Qt, if you intend to build such a big and complex app as PS or even Paint.net.
Now, about, you question. In both you probably will eventually override some paint() - be it in QWidget's or a QGraphicsItem's...
In general you should choose Graphics View if you have a lot of items to interact with (and/or they are animated) - this is its purpose.
About "override its paintEvent() in order to get this feature"...what feature? Filters? Filter are probably done offscreen with the help of some lib, then drawn in some paint() (again be it Item's or Widget's, its basically the same) as pixmap.
If you ask more concrete question it will be easier answering.
MihailNaydenov
>
>
>Thank you all and have a happy holiday!
>
>--
>Cheng Liang
>from: chengliang.soft at gmail.com
>
More information about the Qt-interest-old
mailing list